Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions configuration/packages/configuring-collision-monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ Parameters
============== =============================
Type Default
-------------- -----------------------------
string "cmd_vel_raw"
string "cmd_vel_smoothed"
Comment thread
SteveMacenski marked this conversation as resolved.
Outdated
============== =============================

Description:
Input ``cmd_vel`` topic with desired robot velocity.
Please note, pre-`Jazzy` this was set to `cmd_vel_raw` by default.

:cmd_vel_out_topic:

Expand Down Expand Up @@ -404,7 +405,7 @@ For more information how to bring-up your own Collision Monitor node, please ref
ros__parameters:
base_frame_id: "base_footprint"
odom_frame_id: "odom"
cmd_vel_in_topic: "cmd_vel_raw"
cmd_vel_in_topic: "cmd_vel_smoothed"
cmd_vel_out_topic: "cmd_vel"
state_topic: "collision_monitor_state"
transform_tolerance: 0.5
Expand Down
32 changes: 19 additions & 13 deletions tutorials/docs/using_collision_monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The whole ``nav2_collision_monitor/params/collision_monitor_params.yaml`` file i
use_sim_time: True
base_frame_id: "base_footprint"
odom_frame_id: "odom"
cmd_vel_in_topic: "cmd_vel_raw"
cmd_vel_in_topic: "cmd_vel_smoothed"
cmd_vel_out_topic: "cmd_vel"
transform_tolerance: 0.5
source_timeout: 5.0
Expand Down Expand Up @@ -111,35 +111,41 @@ Preparing Nav2 stack
====================

The Collision Monitor is designed to operate below Nav2 as an independent safety node.
This acts as a filter on the ``cmd_vel`` topic coming out of the Controller Server.
If no such zone is triggered, then the Controller's ``cmd_vel`` is used.
It acts as a filter for the `cmd_vel` messages from the controller to avoid potential collisions.
Comment thread
AlexeyMerzlyakov marked this conversation as resolved.
Outdated
If no such zone is triggered, then the Velocity Smoother's ``cmd_vel`` message is used.
Comment thread
SteveMacenski marked this conversation as resolved.
Outdated
Else, it is scaled or set to stop as appropriate.
For correct operation of the Collision Monitor with the Controller, it is required to add the ``cmd_vel -> cmd_vel_raw`` remapping to the ``navigation_launch.py`` bringup script as presented below:
For correct operation of the Collision Monitor with the Velocity Smoother, it is required to remove the Velocity Smoother's `cmd_vel_smoothed` remapping in the ``navigation_launch.py`` bringup script as presented below to make the output topic of the server ``cmd_vel_smoothed``, which will be the input to the newly added collision monitor:
Comment thread
AlexeyMerzlyakov marked this conversation as resolved.
Outdated
Comment thread
AlexeyMerzlyakov marked this conversation as resolved.
Outdated

.. code-block:: python

Node(
package='nav2_controller',
executable='controller_server',
package='nav2_velocity_smoother',
executable='velocity_smoother',
name='velocity_smoother',
output='screen',
respawn=use_respawn,
respawn_delay=2.0,
parameters=[configured_params],
+ remappings=remappings + [('cmd_vel', 'cmd_vel_raw')]),
arguments=['--ros-args', '--log-level', log_level],
remappings=remappings +
- [('cmd_vel', 'cmd_vel_nav'), ('cmd_vel_smoothed', 'cmd_vel')]),
+ [('cmd_vel', 'cmd_vel_nav')]),
...
ComposableNode(
package='nav2_controller',
plugin='nav2_controller::ControllerServer',
name='controller_server',
package='nav2_velocity_smoother',
plugin='nav2_velocity_smoother::VelocitySmoother',
name='velocity_smoother',
parameters=[configured_params],
+ remappings=remappings + [('cmd_vel', 'cmd_vel_raw')]),
remappings=remappings +
- [('cmd_vel', 'cmd_vel_nav'), ('cmd_vel_smoothed', 'cmd_vel')]),
+ [('cmd_vel', 'cmd_vel_nav')]),

Please note, that the remapped ``cmd_vel_raw`` topic should match to the input velocity ``cmd_vel_in_topic`` parameter value of the Collision Monitor node, and the output velocity ``cmd_vel_out_topic`` parameter value should be actual ``cmd_vel`` to fit the replacement.
If you have changed Collision Monitor's default ``cmd_vel_in_topic`` and ``cmd_vel_out_topic`` configuration, make sure Velocity Smoother's default output topic ``cmd_vel_smoothed`` should match to the input velocity ``cmd_vel_in_topic`` parameter value of the Collision Monitor node, and the output velocity ``cmd_vel_out_topic`` parameter value should be actual ``cmd_vel`` to fit the replacement.
Comment thread
AlexeyMerzlyakov marked this conversation as resolved.
Outdated

Demo Execution
Comment thread
SteveMacenski marked this conversation as resolved.
==============

Once Collision Monitor node has been tuned and ``cmd_vel`` topics remapped, Collision Monitor node is ready to run.
Once Collision Monitor node has been tuned and ``cmd_vel`` topics adjusted, Collision Monitor node is ready to run.
For that, run Nav2 stack as written in :ref:`getting_started`:

.. code-block:: bash
Expand Down