Skip to content

Enable Turn Signal for Lane Change

Implemented feature

This PR adds turn signals to be triggered at waypoints before lane changes.

Description

By law, the vehicle must use turn signals at every lane changes and decision_maker currently does not support this for waypoint following. While the turn signals are triggered at intersections as decision_maker inserts turn signal triggers in waypoints' steering_state for lane changes, there's nothing in decision_maker for lane changes.

Implementation description

The fix extends the existing solution for turn signals at intersections. The waypoints not used at intersections for turn signals are used for turn signals at lane changes. The filtered waypoints will iterate through white lines of the road (lanes) to determine if any of these waypoints cross the lane. If any of these waypoints cross a lane, the turning steering_state will be inserted to trigger turn signals 30 meters (100 ft) before the intersecting point.

Note

The fix avoids code changes to autoware_msgs by using already available steering_state for turn signals. https://gitlab.com/autowarefoundation/autoware.ai/messages/blob/master/autoware_msgs/msg/WaypointState.msg#L8-11

How to test - Simulate using a bag

  1. Start roscore
  2. Play a rosbag with sensor data from a map with vector map components while running Autoware
  3. Localize
  4. Make sure to Engage using decision_maker so it will simulate driving scenario in state machine.
  5. Check for turn signal commands: rostopic echo /vehicle_cmd | grep lamp_cmd -A 8 to check l value should change to 1 at left turns and r value should change to 1 at right turns. You can also run rqt_plot /vehicle_cmd/lamp_cmd to see these values spike up to 1 from 0.

Test

Tested on Ubuntu 16.04 & ROS Kinetic and 18.04 & ROS Melodic on Peoria Downtown map with OAP4 test path astuff/autoware.ai/core_planning!9 (merged)

Edited by Joshua Whitley

Merge request reports