Skip to content

DriveOnHeading

Invokes the DriveOnHeading ROS 2 action server, which causes the robot to drive on the current heading by a specific displacement. It performs a linear translation by a given distance. The nav2_behaviors module implements the DriveOnHeading action server.

Input Ports

dist_to_travel

Type: double Default: 0.15

Distance to travel (m).

speed

Type: double Default: 0.025

Speed at which to travel (m/s).

time_allowance

Type: double Default: 10.0

Time to invoke behavior for, if exceeds considers it a stuck condition or failure case (seconds).

disable_collision_checks

Type: bool Default: false

Disable collision checking.

server_name

Type: string Default: N/A

Action server name. If not specified, drive_on_heading is used.

server_timeout

Type: chrono::milliseconds Default: N/A

Action server timeout (ms). If not provided, uses the BT Navigator's default_server_timeout parameter value (20 ms by default).

Output Ports

error_code_id

Type: uint16 Default: N/A

Drive on heading error code. See DriveOnHeading action message for the enumerated set of error codes.

error_msg

Type: string Default: N/A

Drive on heading error message. See DriveOnHeading action message for the enumerated set of error codes.

Example

<DriveOnHeading dist_to_travel="0.2" speed="0.05"
                server_name="backup_server" server_timeout="10" disable_collision_checks="false"
                error_code_id="{drive_on_heading_error_code}" error_msg="{drive_on_heading_error_msg}"/>