Skip to content

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: double Default: 1.57

Spin distance (radians).

time_allowance

Type: double Default: 10.0

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

is_recovery

Type: bool Default: true

True if the action is being used as a recovery.

disable_collision_checks

Type: bool Default: false

Disable collision checking.

server_name

Type: string Default: N/A

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

Spin error code. See Spin action message for the enumerated set of error codes.

error_msg

Type: string Default: N/A

Spin error message. See Spin action 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}"/>