Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

simple_cmd_vel_mux

A simple ROS node that multiplexes multiple geometry_msgs/msg/Twist topics onto a single cmd_vel output, picking the active source by priority with per-source timeouts.

Configuration

Subscribers and the publisher are configured from a YAML file. The three subscriber lists are aligned by index:

/**:
  ros__parameters:
    subscribers:
      priorities: [0, 1, 2]
      topics:
        - /joy_controller/cmd_vel
        - /navigation/cmd_vel
        - /other/cmd_vel
      time_outs: [3.0, 3.0, 3.0]
    publisher:
      topic: /cmd_vel
      rate: 30.0
      stop_publishing_on_timeout: true
  • time_outs are in seconds. After this much silence on a topic, that source is marked inactive.

  • rate is the output publish rate in Hz.

  • priorities are integers; lower wins. Values do not have to be dense (e.g. [0, 5, 10] is fine) but must be non-negative and unique.

  • stop_publishing_on_timeout (optional, default false): when true, the mux publishes a single zero Twist on the transition from active to inactive and then stops publishing until a source becomes active again. When false, zero Twists are published continuously at rate while no source is active.

Use

Quick Start with Docker

cd docker
docker compose build
docker compose up

Environment variables (COLCON_WORKSPACE_DIR, ROS_DOMAIN_ID, RMW_IMPLEMENTATION) are read from docker/.env.

Inside Local Workspace

Alternatively clone the repo into your local workspace, build and...

ros2 launch simple_cmd_vel_mux init.launch.py

...optionally override the namespace or config file:

ros2 launch simple_cmd_vel_mux init.launch.py name_space:=my_mux configuration:=my.yaml

About

Simple cmd_vel multiplexer for ROS.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages