See the Operator Tutorial for an example how to setup the Operator in Stage and use a Joystick to simulate commands from a higher level node.

ROS Interface


The operator takes motion commands from a path planner and outputs control commands to the robot hardware avoiding obstacles in front of the robot.

Subscribed Topics

scan (sensor_msgs/LaserScan)
  • Laser scans to update local costmap.
tf (tf/tfMessage)
  • Transforms.
cmd (nav2d_operator/cmd)
  • Motion command comming from a higher level node, e.g. a path planner. Velocity ranges from full speed backward (-1.0) over stop (0.0) to full speed forward (1.0). Turn ranges from maximum left (-1.0, turn in place ccw) over straight (0) to maximum right (1.0, turn in place cw). The parameter Mode defines how to handle obstacles, either by avoiding them (0) or stopping in front of them (1).

Published Topics

cmd_vel (geometry_msgs/Twist)
  • Control command to robot platform.
~desired (nav_msgs/GridCells)
  • Visualizes the received input command.
~route (nav_msgs/GridCells)
  • Visualizes the control command send to the robot.
~local_map/costmap (nav_msgs/OccupancyGrid)
  • Visualizes the internal Costmap2D.


~max_free_space (double, default: 5.0)
  • Maximum considered trajectory length. All turn directions with longer trajectories will have an equal distance-value of 1.0.
~safety_decay (double, default: 0.95)
  • Obstacles will be discounted by this value for every cell distance in the costmap. A lower value (<1.0) causes the robot to avoid obstacles later and ignore obstacles that are far away.
~max_velocity (double, default: 1.0)
  • Maximum velocity command to be send to the robot when no obstacles present. A value of 1.0 means 100% of the platforms own max speed.
~safety_weight (int, default: 1)
  • Relative influence of a trajectories distance to obstacles.
~distance_weight (int, default: 1)
  • Relative influence of free space in front of the robot.
~conformance_weight (int, default: 1)
  • Relative influence of the conformance with the desired turn direction from path planner etc.
~continue_weight (int, default: 1)
  • Relative influence of the continuity of control commands.
~publish_route (bool, default: false)
  • Whether to publish the desired and route topics.

Wiki: nav2d_operator (last edited 2014-03-25 14:16:35 by SebastianKasperski)