Skip to content

Commit

Permalink
init traffic light
Browse files Browse the repository at this point in the history
Signed-off-by: ismetatabay <[email protected]>
  • Loading branch information
ismetatabay committed Oct 10, 2023
1 parent f822e98 commit dd6de08
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ nav:
- Lanelet 2: lanelet2
- Crosswalk: crosswalk
- Stop Line: stop-line
- Traffic light: traffic-light
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/Files/
4. After that, please press `Shift`, then click right click button for inserting pedestrians.
5. You can control inserted pedestrian via dragging right click.

Crosswalk markers on rviz:

<figure markdown>
![crosswalk-test](images/crosswalk-test.png){ align=center }
<figcaption>
Crosswalk test on the created map.
</figcaption>
</figure>

Video Demonstration:

![type:video](https://youtube.com/embed/hhwBku_1qmA)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ So, this process can be tedious and time-consuming.
You need a TIER IV account for using vector map builder tool.
So, if you have not before, please [create a TIER IV account](https://account.tier4.jp/registration?return_to=/oidc/login?login_challenge=81c846efae994bf8a79dac0aab6b8875)
in order to use [vector map builder tool](https://tools.tier4.jp/feature/vector_map_builder_ll2/).
For more information about this tool, please check the [official guide](https://docs.web.auto/en/user-manuals/vector-map-builder/introduction).

You can follow these pages for creating a Lanelet2 map and its regulatory elements.

- [Lanelet 2](./lanelet2)
- [Crosswalk](./crosswalk)
- [Stop Line](./stop-line)
- [Traffic Light](./traffic-light)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In order to operate that, we will add stop line attribute to our lanelet2 map.

In order to create a stop line on your pointcloud map, please follow these steps:

1. Please select lanelet to add stop line.
1. Please select lanelet which stop line to be added.
2. Click `Abstraction` button on top panel.
3. Select `Stop Line` from the panel.
4. Click on the desired area for inserting stop line.
Expand Down Expand Up @@ -59,6 +59,15 @@ ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/Files/
2. Click `2D Goal Pose` button on rviz or press `G` and give a pose for goal point.
3. You can see the stop line marker on the rviz screen.

Stop line markers on rviz:

<figure markdown>
![stop-line-test](images/stop-line-test.png){ align=center }
<figcaption>
Stop line test on the created map.
</figcaption>
</figure>

Video Demonstration:

![type:video](https://youtube.com/embed/cAQ_ulo7LHo)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nav:
- index.md
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Traffic light

Behavior velocity planner's [traffic light module](https://autowarefoundation.github.io/autoware.universe/main/planning/behavior_velocity_traffic_light_module/) plans velocity
according to the traffic light status.
In order to operate that, we will add stop line attribute to our lanelet2 map.

## Creating a traffic light regulatory element

In order to create a traffic light on your pointcloud map, please follow these steps:

1. Please select lanelet which traffic light to be added.
2. Click `Abstraction` button on top panel.
3. Select `Traffic Light` from the panel.
4. Click on the desired area for inserting traffic light.

Video Demonstration:

![type:video](https://youtube.com/embed/P3xcayPkTOg)

### Testing created the traffic light element with planning simulator

After the completing of creating the map, we need to save it.
To that please click `File` --> `Export Lanelet2Maps` then download.

After the download is finished,
we need to put lanelet2 map and pointcloud map on the same location.
The directory structure should be like this:

```diff
+ <YOUR-MAP-DIRECTORY>/
+ ├─ pointcloud_map.pcd
+ └─ lanelet2_map.osm
```

If your .osm or .pcd map file's name is different from these names,
you need to update autoware.launch.xml:

```diff
<!-- Map -->
- <arg name="lanelet2_map_file" default="lanelet2_map.osm" description="lanelet2 map file name"/>
+ <arg name="lanelet2_map_file" default="<YOUR-LANELET-MAP-NAME>.osm" description="lanelet2 map file name"/>
- <arg name="pointcloud_map_file" default="pointcloud_map.pcd" description="pointcloud map file name"/>
+ <arg name="pointcloud_map_file" default="<YOUR-POINTCLOUD-MAP-NAME>.pcd" description="pointcloud map file name"/>
```

Now we are ready to launch the planning simulator:

```bash
ros2 launch autoware_launch planning_simulator.launch.xml map_path:=<YOUR-MAP-FOLDER-DIR> vehicle_model:=<YOUR-VEHICLE-MODEL> sensor_model:=<YOUR-SENSOR-KIT>
```

Example for tutorial_vehicle:

```bash
ros2 launch autoware_launch planning_simulator.launch.xml map_path:=$HOME/Files/autoware_map/tutorial_map/ vehicle_model:=tutorial_vehicle sensor_model:=tutorial_vehicle_sensor_kit vehicle_id:=tutorial_vehicle
```

1. Click `2D Pose Estimate` button on rviz or press `P` and give a pose for initialization.
2. Click `Panels` -> `Add new panel`, select `TrafficLightPublishPanel`, and then press `OK`.
3. In TrafficLightPublishPanel, set the ID and color of the traffic light.
4. Then, Click `SET` and `PUBLISH` button.
5. Click `2D Goal Pose` button on rviz or press `G` and give a pose for goal point.
6. You can see the traffic light marker on the rviz screen if you set the traffic light color as `RED`.

Traffic Light markers on rviz:

<figure markdown>
![traffic-light-test](images/traffic-light-test.png){ align=center }
<figcaption>
Traffic light test on the created map.
</figcaption>
</figure>

Video Demonstration:

![type:video](https://youtube.com/embed/AaFT24uqbJk)

0 comments on commit dd6de08

Please sign in to comment.