Skip to content

Planning simulation#

Preparation#

Download and unpack a sample map.

  • You can also download the map manually.
gdown -O ~/autoware_map/ 'https://docs.google.com/uc?export=download&id=1499_nsbUbIeturZaDj7jhUownh5fvXHd'
unzip -d ~/autoware_map ~/autoware_map/sample-map-planning.zip

Note

Sample map: Copyright 2020 TIER IV, Inc.

Check if you have ~/autoware_data folder and files in it.

$ cd ~/autoware_data
$ ls -C -w 30
image_projection_based_fusion
lidar_apollo_instance_segmentation
lidar_centerpoint
tensorrt_yolo
tensorrt_yolox
traffic_light_classifier
traffic_light_fine_detector
traffic_light_ssd_fine_detector
yabloc_pose_initializer

If not, please, follow Manual downloading of artifacts.

Basic simulations#

Using Autoware Launch GUI

If you prefer a graphical user interface (GUI) over the command line for launching and managing your simulations, refer to the Using Autoware Launch GUI section at the end of this document for a step-by-step guide.

Lane driving scenario#

1. Launch Autoware#

source ~/autoware/install/setup.bash
ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/autoware_map/sample-map-planning vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit

Warning

Note that you cannot use ~ instead of $HOME here.

If ~ is used, the map will fail to load.

after-autoware-launch

2. Set an initial pose for the ego vehicle#

set-initial-pose

a) Click the 2D Pose estimate button in the toolbar, or hit the P key.

b) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose. An image representing the vehicle should now be displayed.

Warning

Remember to set the initial pose of the car in the same direction as the lane.

To confirm the direction of the lane, check the arrowheads displayed on the map.

3. Set a goal pose for the ego vehicle#

a) Click the 2D Goal Pose button in the toolbar, or hit the G key.

b) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose. If done correctly, you will see a planned path from initial pose to goal pose.

set-goal-pose

4. Start the ego vehicle#

Now you can start the ego vehicle driving by clicking the AUTO button on OperationMode in AutowareStatePanel. Alteratively, you can manually start the vehicle by running the following command:

source ~/autoware/install/setup.bash
ros2 service call /api/operation_mode/change_to_autonomous autoware_adapi_v1_msgs/srv/ChangeOperationMode {}

After that, you can see AUTONOMOUS sign on OperationMode and AUTO button is grayed out.

start-driving

Parking scenario#

  1. Set an initial pose and a goal pose, and engage the ego vehicle.

    after-set-goal-pose

  2. When the vehicle approaches the goal, it will switch from lane driving mode to parking mode.

  3. After that, the vehicle will reverse into the destination parking spot.

    parking-maneuver

Pull out and pull over scenario#

  1. In a pull out scenario, set the ego vehicle at the road shoulder.

    pullover-pullout

  2. Set a goal and then engage the ego vehicle.

  3. In a pull over scenario, similarly set the ego vehicle in a lane and set a goal on the road shoulder.

Lane change scenario#

  1. Download and unpack Nishishinjuku map.

    gdown -O ~/autoware_map/ 'https://github.com/tier4/AWSIM/releases/download/v1.1.0/nishishinjuku_autoware_map.zip'
    unzip -d ~/autoware_map ~/autoware_map/nishishinjuku_autoware_map.zip
    
  2. Launch autoware with Nishishinjuku map with following command:

    source ~/autoware/install/setup.bash
    ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/autoware_map/nishishinjuku_autoware_map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit
    

    open-nishishinjuku-map

  3. Set an initial pose and a goal pose in adjacent lanes.

    set-position-and-goal

  4. Engage the ego vehicle. It will make a lane change along the planned path.

    lane-changing

Avoidance scenario#

  1. Set an initial pose and a goal pose in the same lane. A path will be planned.

    set-position-and-goal

  2. Set a "2D Dummy Bus" on the roadside. A new path will be planned.

    set-dummy-bus

  3. Engage the ego vehicle. It will avoid the obstacle along the newly planned path.

Advanced Simulations#

Placing dummy objects#

  1. Click the 2D Dummy Car or 2D Dummy Pedestrian button in the toolbar.
  2. Set the pose of the dummy object by clicking and dragging on the map.
  3. Set the velocity of the object in Tool Properties -> 2D Dummy Car/Pedestrian panel.

    !!! note

    Changes to the velocity parameter will only affect objects placed after the parameter is changed.

    set-dummy-car

  4. Delete any dummy objects placed in the view by clicking the Delete All Objects button in the toolbar.

  5. Click the Interactive button in the toolbar to make the dummy object interactive.

    set-interactive-dummy-car

  6. For adding an interactive dummy object, press SHIFT and click the right click.

  7. For deleting an interactive dummy object, press ALT and click the right click.
  8. For moving an interactive dummy object, hold the right click drag and drop the object.

    move-interactive-dummy-car

Traffic light recognition simulation#

By default, traffic lights on the map are all treated as if they are set to green. As a result, when a path is created that passed through an intersection with a traffic light, the ego vehicle will drive through the intersection without stopping.

The following steps explain how to set and reset traffic lights in order to test how the Planning component will respond.

Set traffic light#

  1. Go to Panels -> Add new panel, select TrafficLightPublishPanel, and then press OK.

  2. In TrafficLightPublishPanel, set the ID and color of the traffic light.

  3. Click the SET button. set-traffic-light

  4. Finally, click the PUBLISH button to send the traffic light status to the simulator. Any planned path that goes past the selected traffic light will then change accordingly.

send-traffic-light-color

By default, Rviz should display the ID of each traffic light on the map. You can have a closer look at the IDs by zooming in the region or by changing the View type.

In case the IDs are not displayed, try the following troubleshooting steps:

a) In the Displays panel, find the traffic_light_id topic by toggling the triangle icons next to Map > Lanelet2VectorMap > Namespaces.

b) Check the traffic_light_id checkbox.

c) Reload the topic by clicking the Map checkbox twice.

see-traffic-light-ID

Update/Reset traffic light#

You can update the color of the traffic light by selecting the next color (in the image it is GREEN) and clicking SET button. In the image the traffic light in front of the ego vehicle changed from RED to GREEN and the vehicle restarted.

after-traffic-light-color-update

To remove a traffic light from TrafficLightPublishPanel, click the RESET button.

Reference video tutorials

Driving across a crosswalk#

When driving across a crosswalk, ego vehicle will respond to objects on the crosswalk and the traffic light. You can check crosswalk for more details

Non-signalized crosswalk#

To pass through a non-signalized crosswalk, if the crosswalk is free of target objects, the ego vehicle will cross it without slowing down. However, if target objects are detected close to the planned path, the ego vehicle will slow down and stop for a yield decision. Once it's confirmed safe to proceed, the ego vehicle will start moving.

  1. Set an initial pose and a goal pose for the ego vehicle driving across an non-signalized crosswalk. A path will be planned.

    unsignalized-placing-ego-vehicle

  2. Place a dummy pedestrian on the crosswalk and set its pose as if it is crossing the street.

    unsignalized-crosswalk-start

  3. Engage the ego vehicle. The ego vehicle will decelerate and stop before the crosswalk. The marked crosswalk in the figure indicates that the stopping behavior is caused by the objects on the crosswalk.

    unsignalized-crosswalk-stop

  4. Wait for about a few seconds. The ego vehicle will start moving again and cross the crosswalk.

    unsignalized-crosswalk-move-again

Signalized crosswalk#

  1. Set the ego vehicle and a dummy pedestrian at an intersection, similar to the previous scenario. Given that the traffic light for vehicles is GREEN by default and the dummy pedestrian is close to the planned path, the ego vehicle behaves as it would at a non-signalized crosswalk, decelerating and stopping.

    signalized-placing-ego-vehicle

  2. Delete the dummy pedestrian and set the traffic light to RED. The ego vehicle will decelerate and stop before the crosswalk. The marked traffic_light in the figure indicates that the stop is caused by the traffic_light. The ego vehicle will not move until the traffic light turns green.

    signalized-traffic-light-stop

  3. Set a dummy pedestrian on the crosswalk again. It can be seen that both the traffic_light and crosswalk (the two markings may overlap) affect the stopping behavior.

    signalized-traffic-light-crosswalk-stop.png

  4. Set the traffic light to GREEN and engage the vehicle, the ego vehicle will stop for a yield decision and then start moving.

    signalized-passing

Using Autoware Launch GUI#

This section provides a step-by-step guide on using the Autoware Launch GUI for planning simulations, offering an alternative to the command-line instructions provided in the Basic simulations section.

Getting Started with Autoware Launch GUI#

  1. Installation: Ensure you have installed the Autoware Launch GUI. Installation instructions.

  2. Launching the GUI: Open the Autoware Launch GUI from your applications menu.

    GUI screenshot for launching the GUI

Launching a Planning Simulation#

Lane Driving Scenario#

  1. Set Autoware Path: In the GUI, set the path to your Autoware installation.

    GUI_screenshot_for_setting_Autoware_path

  2. Select Launch File: Choose planning_simulator.launch.xml for the lane driving scenario.

    GUI screenshot for selecting launch file

  3. Customize Parameters: Adjust parameters such as map_path, vehicle_model, and sensor_model as needed.

    GUI screenshot for customizing parameters GUI screenshot for customizing parameters

  4. Start Simulation: Click the launch button to start the simulation.

    GUI screenshot for starting simulation

  5. Any Scenario: From here, you can follow the instructions in the

Monitoring and Managing the Simulation#

  • Real-Time Monitoring: Use the GUI to monitor CPU/Memory usage and Autoware logs in real-time.
  • Profile Management: Save your simulation profiles for quick access in future simulations.
  • Adjusting Parameters: Easily modify simulation parameters on-the-fly through the GUI.