Behavior Server
Source code on Github.
The Behavior Server implements the server for handling various behavior, such as recoveries and docking, requests and hosting a vector of plugins implementing various C++ behaviors. It is also possible to implement independent behavior servers for each custom behavior, but this server will allow multiple behaviors to share resources such as costmaps and TF buffers to lower incremental costs for new behaviors.
Note: the wait recovery behavior has no parameters, the duration to wait is given in the action request.
Behavior Server Parameters
local_costmap_topic
- Type:
stringDefault:"local_costmap/costmap_raw" -
Raw costmap topic for collision checking on the local costmap.
global_costmap_topic
- Type:
stringDefault:"global_costmap/costmap_raw" -
Raw costmap topic for collision checking on the global costmap.
local_footprint_topic
- Type:
stringDefault:"local_costmap/published_footprint" -
Topic for footprint in the local costmap frame.
global_footprint_topic
- Type:
stringDefault:"global_costmap/published_footprint" -
Topic for footprint in the global costmap frame.
cycle_frequency
- Type:
doubleDefault:10.0 -
Frequency to run behavior plugins.
transform_tolerance
- Type:
doubleDefault:0.1 -
TF transform tolerance.
local_frame
- Type:
stringDefault:"odom" -
Local reference frame.
global_frame
- Type:
stringDefault:"map" -
Global reference frame.
robot_base_frame
- Type:
stringDefault:"base_link" -
Robot base frame.
introspection_mode
- Type:
stringDefault:"disabled" -
The introspection mode for services and actions. Options are
"disabled","metadata","contents".
behavior_plugins
- Type:
vector<string>Default:["spin", "backup", "drive_on_heading", "wait"] -
List of plugin names to use, also matches action server names.
- Note
-
Each plugin namespace defined in this list needs to have a
pluginparameter defining the type of plugin to be loaded in the namespace.Example:
behavior_server: ros__parameters: behavior_plugins: ["spin", "backup", "drive_on_heading", "wait"] spin: plugin: "nav2_behaviors::Spin" backup: plugin: "nav2_behaviors::BackUp" drive_on_heading: plugin: "nav2_behaviors::DriveOnHeading" wait: plugin: "nav2_behaviors::Wait"
Default Plugins
When the behavior_plugins parameter is not overridden, the following default plugins are loaded:
| Namespace | Plugin |
|---|---|
| "spin" | "nav2_behaviors::Spin" |
| "backup" | "nav2_behaviors::BackUp" |
| "drive_on_heading" | "nav2_behaviors::DriveOnHeading" |
| "wait" | "nav2_behaviors::Wait" |
Spin Behavior Parameters
Spin distance is given from the action request
simulate_ahead_time
- Type:
doubleDefault:2.0 -
Time to look ahead for collisions (s).
max_rotational_vel
- Type:
doubleDefault:1.0 -
Maximum rotational velocity (rad/s).
min_rotational_vel
- Type:
doubleDefault:0.4 -
Minimum rotational velocity (rad/s).
rotational_acc_lim
- Type:
doubleDefault:3.2 -
Maximum rotational acceleration (rad/s^2).
enable_stamped_cmd_vel
- Type:
boolDefault:true -
Whether to use
geometry_msgs::msg::Twistorgeometry_msgs::msg::TwistStampedvelocity data.trueusesTwistStamped,falseusesTwist.
BackUp Behavior Parameters
Backup distance, speed and time_allowance is given from the action request.
simulate_ahead_time
- Type:
doubleDefault:2.0 -
Time to look ahead for collisions (s).
enable_stamped_cmd_vel
- Type:
boolDefault:true -
Whether to use
geometry_msgs::msg::Twistorgeometry_msgs::msg::TwistStampedvelocity data.trueusesTwistStamped,falseusesTwist.
backup.acceleration_limit
- Type:
doubleDefault:2.5 -
Maximum acceleration limit (m/s^2). This parameter limits the rate at which speed increases when moving backward.
backup.deceleration_limit
- Type:
doubleDefault:-2.5 -
Maximum deceleration limit (m/s^2). Negative value. This parameter limits the rate at which speed decreases when moving backward.
backup.minimum_speed
- Type:
doubleDefault:0.1 -
Minimum speed to move, the deadband velocity of the robot behavior (m/s). Positive value.
DriveOnHeading Behavior Parameters
DriveOnHeading distance, speed and time_allowance is given from the action request.
simulate_ahead_time
- Type:
doubleDefault:2.0 -
Time to look ahead for collisions (s).
enable_stamped_cmd_vel
- Type:
boolDefault:true -
Whether to use
geometry_msgs::msg::Twistorgeometry_msgs::msg::TwistStampedvelocity data.trueusesTwistStamped,falseusesTwist.
bond_heartbeat_period
- Type:
doubleDefault:0.25 -
The lifecycle node bond mechanism publishing period (on the
/bondtopic). Disabled if inferior or equal to0.0.
allow_parameter_qos_overrides
- Type:
boolDefault:true -
Whether to allow QoS profiles to be overwritten with parameterized values.
drive_on_heading.acceleration_limit
- Type:
doubleDefault:2.5 -
Maximum acceleration limit (m/s^2).
drive_on_heading.deceleration_limit
- Type:
doubleDefault:-2.5 -
Maximum deceleration limit (m/s^2). Negative value.
drive_on_heading.minimum_speed
- Type:
doubleDefault:0.1 -
Minimum speed to move, the deadband velocity of the robot behavior (m/s). Positive value.
AssistedTeleop Behavior Parameters
AssistedTeleop time_allowance is given in the action request
projection_time
- Type:
doubleDefault:1.0 -
Time to look ahead for collisions (s).
simulation_time_step
- Type:
doubleDefault:0.1 -
Time step for projections (s).
cmd_vel_teleop
- Type:
stringDefault:"cmd_vel_teleop" -
Topic to listen for teleop messages.
enable_stamped_cmd_vel
- Type:
boolDefault:true -
Whether to use
geometry_msgs::msg::Twistorgeometry_msgs::msg::TwistStampedvelocity data.trueusesTwistStamped,falseusesTwist.
Example
behavior_server:
ros__parameters:
local_costmap_topic: local_costmap/costmap_raw
local_footprint_topic: local_costmap/published_footprint
global_costmap_topic: global_costmap/costmap_raw
global_footprint_topic: global_costmap/published_footprint
cycle_frequency: 10.0
behavior_plugins: ["spin", "backup", "drive_on_heading", "wait", "assisted_teleop"]
spin:
plugin: "nav2_behaviors::Spin"
backup:
plugin: "nav2_behaviors::BackUp"
drive_on_heading:
plugin: "nav2_behaviors::DriveOnHeading"
wait:
plugin: "nav2_behaviors::Wait"
assisted_teleop:
plugin: "nav2_behaviors::AssistedTeleop"
local_frame: odom
global_frame: map
robot_base_frame: base_link
transform_tolerance: 0.1
simulate_ahead_time: 2.0
max_rotational_vel: 1.0
min_rotational_vel: 0.4
rotational_acc_lim: 3.2
enable_stamped_cmd_vel: true