Skip to content

ComputeRoute

Invokes the ComputeRoute ROS 2 action server, which is implemented by the nav2_route module. The server address can be remapped using the server_name input port.

Input Ports

start

Type: geometry_msgs::msg::PoseStamped Default: N/A

Start pose. Optional. Only used if not left empty. Takes in a blackboard variable, e.g. "{start}".

goal

Type: geometry_msgs::msg::PoseStamped Default: N/A

Goal pose. Takes in a blackboard variable, e.g. "{goal}".

start_id

Type: unsigned int Default: N/A

Start node ID to use.

goal_id

Type: unsigned int Default: N/A

Goal node ID to use.

use_start

Type: bool Default: false

Whether to use the start or use TF to obtain the robot's start pose.

use_poses

Type: bool Default: false

Whether to use the start and goal poses or start and goal node IDs.

server_name

Type: string Default: N/A

Action server name. If not specified, compute_route 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

route

Type: nav2_msgs::msg::Route Default: N/A

Route created by action server. Takes in a blackboard variable, e.g. "{route}".

path

Type: nav_msgs::msg::Path Default: N/A

Path created by action server. Takes in a blackboard variable, e.g. "{path}".

planning_time

Type: builtin_interfaces::msg::Duration Default: N/A

Time it took to compute the route.

error_code_id

Type: uint16 Default: N/A

Compute route error code. See ComputeRoute action message for the enumerated set of error codes.

error_msg

Type: string Default: N/A

Compute route error message. See ComputeRoute action message for the enumerated set of error codes.

Example

<ComputeRoute start="{start}" goal="{goal}" use_poses="{true}" use_start="{true}" path="{path}"
              server_name="ComputeRoute" server_timeout="10"
              error_code_id="{compute_route_error_code}" error_msg="{compute_route_error_msg}"/>