Skip to content

Commit

Permalink
Replaced README information with links to the relevant parts of the d…
Browse files Browse the repository at this point in the history
…ocumentation
  • Loading branch information
corkyw10 committed Apr 14, 2021
1 parent a02565a commit 6951952
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 378 deletions.
45 changes: 2 additions & 43 deletions carla_ackermann_control/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
# Carla Ackermann Control
# CARLA Ackermann Control

ROS Node to convert [AckermannDrive](http://docs.ros.org/api/ackermann_msgs/html/msg/AckermannDrive.html) messages to [CarlaEgoVehicleControl](carla_ros_bridge/msg/CarlaEgoVehicleControl.msg).

- A PID controller is used to control the acceleration/velocity.
- Reads the Vehicle Info, required for controlling from Carla (via carla ros bridge)

## Prerequisites

#install python simple-pid
pip install --user simple-pid

### Configuration

Initial parameters can be set via [configuration file](config/settings.yaml).

In ROS1, it is possible to modify the parameters during runtime via the `dynamic reconfigure` package.

## Available Topics

| Topic | Type | Description |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `/carla/<ROLE NAME>/ackermann_cmd` (subscriber) | [ackermann_msgs.AckermannDrive](http://docs.ros.org/api/ackermann_msgs/html/msg/AckermannDrive.html) | Subscriber for stearing commands |
| `/carla/<ROLE NAME>/ackermann_control/control_info` | [carla_ackermann_control.EgoVehicleControlInfo](msg/EgoVehicleControlInfo.msg) | The current values used within the controller (for debugging) |

The role name is specified within the configuration.

### Test control messages

You can send command to the car using the topic `/carla/<ROLE NAME>/ackermann_cmd`.

Examples for a ego vehicle with role_name 'ego_vehicle':

Forward movements, speed in in meters/sec.

rostopic pub /carla/ego_vehicle/ackermann_cmd ackermann_msgs/AckermannDrive "{steering_angle: 0.0, steering_angle_velocity: 0.0, speed: 10, acceleration: 0.0,
jerk: 0.0}" -r 10

Forward with steering

rostopic pub /carla/ego_vehicle/ackermann_cmd ackermann_msgs/AckermannDrive "{steering_angle: 1.22, steering_angle_velocity: 0.0, speed: 10, acceleration: 0.0,
jerk: 0.0}" -r 10

Info: the steering_angle is the driving angle (in radians) not the wheel angle.
Find documentation about the CARLA Ackermann Control package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_ackermann_control/).
38 changes: 1 addition & 37 deletions carla_ad_agent/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
# CARLA AD Agent

An AD agent that can follow a given route.

It avoids crashs with other vehicles and respects the state of the traffic lights by accessing the ground truth data.

For a more comprehensive solution, have a look at [Autoware](https://www.autoware.ai/).

## Subscriptions

| Topic | Type | Description |
| ---------------------------------- | ------------------- | --------------------------- |
| `/carla/<ROLE NAME>/waypoints` | [nav_msgs.Path](http://docs.ros.org/api/nav_msgs/html/msg/Path.html) | Route to follow |
| `/carla/<ROLE NAME>/target_speed` | [std_msgs.Float64](http://docs.ros.org/api/std_msgs/html/msg/Float64.html) | Target speed |
| `/carla/<ROLE NAME>/odometry` | [nav_msgs.Odometry](http://docs.ros.org/en/api/nav_msgs/html/msg/Odometry.html) | localization of ego vehicle |

For risk avoidance, more subscriptions are required:

| Topic | Type | Description |
| ---------------------------------- | ------------------- | --------------------------- |
| `/carla/<ROLE NAME>/vehicle_info` | [carla_msgs.CarlaEgoVehicleInfo](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaEgoVehicleInfo.msg) | Identify the carla actor id of the ego vehicle |
| `/carla/<ROLE NAME>/objects` | [derived_object_msgs.ObjectArray](http://docs.ros.org/api/derived_object_msgs/html/msg/ObjectArray.html) | Information about other actors |
| `/carla/actor_list` | [carla_msgs.CarlaActorList](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaActorList.msg) | Actor list |
| `/carla/world_info` | [carla_msgs.CarlaWorldInfo](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaWorldInfo.msg) | Selects mode for traffic lights (US- or Europe-style) |
| `/carla/traffic_lights/status` | [carla_msgs.CarlaTrafficLightStatusList](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaTrafficLightStatusList.msg) | Get the current state of the traffic lights |

## Publications

| Topic | Type | Description |
| ---------------------------------- | ------------------- | --------------------------- |
| `/carla/<ROLE NAME>/vehicle_control_cmd` | [carla_msgs.CarlaEgoVehicleControl](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaEgoVehicleControl.msg) | Vehicle control command |

## Local Planner Node

Internally, the CARLA AD Agent uses a separate node for [local planning](src/carla_ad_agent/local_planner.py).

This is currently optimized for `vehicle.tesla.model3`, as it does not have any gear shift delays.

The PID parameters were gathered by [Ziegler-Nichols method](https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method).
Find documentation about the CARLA AD Agent package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_ad_agent/).
45 changes: 1 addition & 44 deletions carla_ad_demo/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
# CARLA AD Demo

This meta package provides everything to launch a CARLA ROS environment with an AD vehicle.

![CARLA AD Demo](../docs/images/ad_demo.png "AD Demo in Rviz")

## Startup

export PYTHONPATH=$PYTHONPATH:<path_to_carla>/PythonAPI/carla-<carla_version_and_arch>.egg:<path_to_carla>/PythonAPI/carla/
export SCENARIO_RUNNER_PATH=<path_to_scenario_runner>

# ROS 1
roslaunch carla_ad_demo carla_ad_demo.launch

# ROS 2
ros2 launch carla_ad_demo carla_ad_demo.launch.py

### Modes

#### Following A Random Route

On startup, an ego vehicle is spawned and follows a random route to a goal.

You might want to spawn additional vehicles (or pedestrians) by manually executing:

<CARLA_PATH>/PythonAPI/examples/spawn_npc.py

You can modify start position and goal within the [launch file](launch/carla_ad_demo.launch). The route is currently randomly (regarding the left/right turns) calculated.

#### Scenario Execution

If you prefer to execute a predefined scenario, launch:

# ROS1
roslaunch carla_ad_demo carla_ad_demo_with_scenario.launch

# ROS2
ros2 launch carla_ad_demo carla_ad_demo_with_scenario.launch.py

Select to example scenario "FollowLeadingVehicle" within the RVIZ Carla Plugin and press "Execute". The ego vehicle gets repositioned and the scenario is processed.

You can specify your own scenarios by publishing to `/carla/available_scenarios`. See the [launch file](launch/carla_ad_demo_with_scenario.launch) for an example.

##### Troubleshooting

- If the example scenario fails, please analyze the ros log and follow the scenario runner [Getting Started](https://github.com/carla-simulator/scenario_runner/blob/master/Docs/getting_started.md) to verify that it's working standalone.
Find documentation about the CARLA AD Demo [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_ad_demo/).
18 changes: 2 additions & 16 deletions carla_manual_control/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# Carla Manual Control
# CARLA Manual Control

The node `carla_manual_control` is a ROS-only version of the Carla `manual_control.py`. All data is received
via ROS topics.

## Prerequisites

To be able to use `carla_manual_control`, some sensors need to be attached to the ego vehicle:

- to display an image: a camera with role-name 'view' and resolution 800x600
- to display the current gnss position: a gnss sensor with role-name 'gnss1'
- to get a notification on lane invasions: a lane invasion sensor
- to get a notification on lane invasions: a collision sensor

## Manual steering

In order to steer manually, press 'B'. This will toggle manual-driving mode within carla_ros_bridge.
Find documentation about the CARLA Manual Control package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_manual_control/).
64 changes: 1 addition & 63 deletions carla_ros_scenario_runner/README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,3 @@
# ROS Scenario Runner

This is a wrapper to execute OpenScenarios with the CARLA [scenario runner](https://github.com/carla-simulator/scenario_runner) via ROS.

It is best used from within the [rviz_carla_plugin](../rviz_carla_plugin).

Currently it is not supported to switch the CARLA Town. Therefore the scenario needs to use the currently active Town.

Please have a look at the [example scenario](https://github.com/carla-simulator/ros-bridge/blob/master/carla_ad_demo/config/FollowLeadingVehicle.xosc), especially at the way the ros-controller is set up.

<Controller name="EgoVehicleAgent">
<Properties>
<Property name="module" value="carla_ros_scenario_runner.ros_vehicle_control" />
<Property name="launch" value="carla_ad_agent.launch"/>
<Property name="launch-package" value="carla_ad_agent"/>
</Properties>
</Controller>

By this section within the openscenario definition, an instance of `carla_ad_agent` is launched (i.e. `roslaunch <launch-package> <launch> ..` is executed). Any additional `<Property>` is appened as ros parameter (name:=value).

## Setup

Please follow the scenario runner [Getting Started](https://github.com/carla-simulator/scenario_runner/blob/master/Docs/getting_started.md) and verify, that scenario_runner is working, if started manually.

Additionally, please execute:

sudo apt install python-pexpect

## Startup

The environment variables are forwarded to scenario_runner, therefore set them to:

export PYTHONPATH=$PYTHONPATH:<path_to_carla>/PythonAPI/carla-<carla_version_and_arch>.egg:<path_to_carla>/PythonAPI/carla/

### Using ROS1

To run the ROS node:

roslaunch carla_ros_scenario_runner carla_ros_scenario_runner.launch scenario_runner_path:=<path_to_scenario_runner>

To run a scenario from command line:

rosservice call /scenario_runner/execute_scenario "{ 'scenario': { 'scenario_file': '<full_path_to_openscenario_file>' } }"

### Using ROS2

To run the ROS node:

ros2 launch carla_ros_scenario_runner carla_ros_scenario_runner.launch.py scenario_runner_path:=<path_to_scenario_runner>

To run a scenario from command line:

ros2 service call /scenario_runner/execute_scenario carla_ros_scenario_runner_types/srv/ExecuteScenario "{ 'scenario': { 'scenario_file': '<full_path_to_openscenario_file>' } }"

## Available services

| Service | Description | Type |
| ----------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
| `/scenario_runner/execute_scenario` | Execute a scenario. If another scenario is currently running, it gets stopped. | [carla_ros_scenario_runner_types.ExecuteScenario](../carla_ros_scenario_runner_types/srv/ExecuteScenario.srv) |

## Available topics

| Topic | Description | Type |
| ------------------------------------- | ----------- | -------------------------------------------------------------------- |
| `/scenario_runner/status` | The current status of the scenario runner execution (e.g. used by the [rviz_carla_plugin](../rviz_carla_plugin)) | [carla_ros_scenario_runner_types.CarlaScenarioRunnerStatus](../carla_ros_scenario_runner_types/msg/CarlaScenarioRunnerStatus.msg) |
Find documentation about the ROS Scenario Runner package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_ros_scenario_runner/).
58 changes: 2 additions & 56 deletions carla_spawn_objects/README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,3 @@
# ROS Carla Spawn Objects
# CARLA Spawn Objects

`carla_spawn_objects` can be used to spawn actors (vehicles, sensors, walkers) with attached sensors.

Info: To be able to use `carla_manual_control` a camera with role-name 'view' and resolution of 800x600 is required.

If no specific position is set for vehicles, they will be spawned at a random position.

## Spawning at specific position

- It is possible to specify the position at which the vehicle will be spawned, by defining a ros parameter named `spawn_point_<VEHICLE-NAME>`, with `<VEHICLE-NAME>` specified in the `id` field of the vehicle, in the config file.
- It is also possible to specify the initial position directly in the config file. This is also how the initial positions of sensors should be declared.
- The `spawn_point` specified for a sensor attached to a vehicle, will be considered relative to the vehicle.

It is possible to re-spawn a vehicle at a specific location by publishing to `/carla/<ROLE NAME>/<CONTROLLER_ID>/initialpose`, but only if an `actor.pseudo.control` pseudo-actor (with id `<CONTROLLER_ID>`) is attached to the vehicle. The node `set_initial_pose` should also be running to handle the message on the topic. It can be launched using [set_initial_pose.launch](launch/set_initial_pose.launch), and `<CONTROLLER_ID>` should be specified by setting the ros parameter called `controller_id`.

The preferred way to publish the new pose message is to use RVIZ:

![Autoware Runtime Manager Settings](../docs/images/rviz_set_start_goal.png)

Selecting a Pose with '2D Pose Estimate' will delete the current ego_vehicle and respawn it at the specified position.

## Attach sensor to an existing vehicle

It possible to attach sensors to an existing vehicle. To do so, a `sensor.pseudo.actor_list` should also be spawned (define it in the config file) to give access to a list of active actors. The ROS parameter `spawn_sensors_only` should also be set to True. `carla_spawn_objects` will then check if an actor with same id and type as the one specified in its config file is already active, and if yes attach the sensors to this actor.

## Create your own sensor setup

Sensors, attached to vehicles or not, can be defined via a json file. `carla_spawn_objects` reads it from the file location defined via the private ros parameter `objects_definition_file`.

The format is defined like that:

```json
{ "actors" = [
{
"type": "<SENSOR-TYPE>",
"id": "<NAME>",
"spawn_point": {"x": 0.0, "y": 0.0, "z": 0.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
<ADDITIONAL-SENSOR-ATTRIBUTES>
},
{
"type": "<VEHICLE-TYPE>",
"id": "<VEHICLE-NAME>",
"spawn_point": {"x": 0.0, "y": 0.0, "z": 0.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
"sensors":
[
<SENSORS-TO-ATTACH-TO-VEHICLE>
]
}
...
]
}
```

Define sensors with their attributes as described in the Carla Documentation about [Cameras and Sensors](https://github.com/carla-simulator/carla/blob/master/Docs/cameras_and_sensors.md).

An example is provided by [carla_example_ego_vehicle.launch](launch/carla_example_ego_vehicle.launch). It uses the sensors from [objects.json](config/objects.json)
Find documentation about the CARLA Spawn Objects package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_spawn_objects/).
15 changes: 1 addition & 14 deletions carla_twist_to_control/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Twist to Vehicle Control conversion

This node converts a [geometry_msgs.Twist](http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html) to [carla_msgs.CarlaEgoVehicleControl](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaEgoVehicleControl.msg)

## Subscriptions

| Topic | Type | Description |
| ---------------------------------- | ------------------- | --------------------------- |
| `/carla/<ROLE NAME>/vehicle_info` | [carla_msgs.CarlaEgoVehicleInfo](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaEgoVehicleInfo.msg) | Ego vehicle info, to receive max steering angle |
| `/carla/<ROLE NAME>/twist` | [geometry_msgs.Twist](http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html) | Twist to convert |

## Publications

| Topic | Type | Description |
| ---------------------------------- | ------------------- | --------------------------- |
| `/carla/<ROLE NAME>/vehicle_control_cmd` | [carla_msgs.CarlaEgoVehicleControl](https://github.com/carla-simulator/ros-carla-msgs/tree/master/msg/CarlaEgoVehicleControl.msg) | Converted vehicle control command |
Find documentation about the CARLA Twist to Control package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_twist_to_control/).
42 changes: 1 addition & 41 deletions carla_waypoint_publisher/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,3 @@
# Carla Waypoint Publisher

Carla supports waypoint calculations.
The node `carla_waypoint_publisher` makes this feature available in the ROS context.

It uses the current pose of the ego vehicle with role-name "ego_vehicle" as starting point. If the
vehicle is respawned or moved, the route is newly calculated.

Additionally, services are provided to query CARLA waypoints.

## Startup

As the waypoint publisher requires some Carla PythonAPI functionality that is not part of the python egg-file, you
have to extend your PYTHONPATH.

export PYTHONPATH=$PYTHONPATH:<path-to-carla>/PythonAPI/carla/dist/carla-<carla_version_and_arch>.egg:<path-to-carla>/PythonAPI/carla/

To run it:

roslaunch carla_waypoint_publisher carla_waypoint_publisher.launch

## Set a goal

The goal is either read from the ROS topic `/carla/<ROLE NAME>/goal`, if available, or a fixed spawn point is used.

The preferred way of setting a goal is to click '2D Nav Goal' in RVIZ.

![set goal](../docs/images/rviz_set_start_goal.png)

## Published waypoints

The calculated route is published:

| Topic | Type |
| ------------------------------------- | -------------------------------------------------------------------- |
| `/carla/<ego vehicle name>/waypoints` | [nav_msgs.Path](http://docs.ros.org/api/nav_msgs/html/msg/Path.html) |

## Available services

| Service | Description | Type |
| ----------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
| `/carla_waypoint_publisher/<ego vehicle name>/get_waypoint` | Get the waypoint for a specific location | [carla_waypoint_types.GetWaypoint](../carla_waypoint_types/srv/GetWaypoint.srv) |
| `/carla_waypoint_publisher/<ego vehicle name>/get_actor_waypoint` | Get the waypoint for an actor id | [carla_waypoint_types.GetActorWaypoint](../carla_waypoint_types/srv/GetActorWaypoint.srv) |
Find documentation about the CARLA Waypoint Publisher package [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/carla_waypoint/).
8 changes: 1 addition & 7 deletions rqt_carla_control/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# CARLA Control RQT Plugin

If `carla_ros_bridge` is configured in synchronous-mode, this plugin can be used to control the stepping.

## Startup

You can start it e.g.:

rqt --standalone rqt_carla_control
Find documentation about the CARLA Control RQT Plugin [__here__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/rqt_plugin/).
Loading

0 comments on commit 6951952

Please sign in to comment.