Spin
Invokes the Spin ROS 2 action server, which is implemented by the nav2_behaviors module. It performs an in-place rotation by a given angle. This action is used in nav2 Behavior Trees as a recovery behavior.
Input Ports
spin_dist
- Type:
doubleDefault:1.57 -
Spin distance (radians).
time_allowance
- Type:
doubleDefault:10.0 -
Time to invoke behavior for, if exceeds considers it a stuck condition or failure case (seconds).
is_recovery
- Type:
boolDefault:true -
True if the action is being used as a recovery.
disable_collision_checks
- Type:
boolDefault:false -
Disable collision checking.
server_name
- Type:
stringDefault:N/A -
Action server name. If not specified,
spinis used.
server_timeout
- Type:
chrono::millisecondsDefault:N/A -
Action server timeout (ms). If not provided, uses the BT Navigator's
default_server_timeoutparameter value (20 ms by default).
Output Ports
error_code_id
- Type:
uint16Default:N/A -
Spin error code. See
Spinaction message for the enumerated set of error codes.
error_msg
- Type:
stringDefault:N/A -
Spin error message. See
Spinaction message for the enumerated set of error codes.
Example
<Spin spin_dist="1.57" server_name="spin" server_timeout="10" is_recovery="true"
disable_collision_checks="false" error_code_id="{spin_error_code}"
error_msg="{spin_error_msg}"/>