ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

multiplexing between two topic

asked 2014-10-21 15:34:08 -0500

Hi i am using P3AT(USARSim simulator) and want to drive it from my ROS-Fuerte. what i want to do is,

  1. Driving the robot using keyboard (using teleop_twist_keyboard)

  2. Automated navigation of robot (using Navigation stack)

I want to drive the robot using keyboard but when i commit mistake(i.e. approaching to hit a wall) the automated behavior need to be activated.

by following this, i have my configuration file

example_cfg.yaml

subscribers:
  - name:        "Human_is_Driving"
    topic:       "teleop_cmd_vel"
    timeout:     0.5
    priority:    5
  - name:        "MACHINE_TAKES_OVER"
    topic:       "auto_cmd_vel"
    timeout:     0.5
    priority:    5
publisher:       "velocity_multiplexer/mux_cmd_vel"

standalone.launch

<launch>
  <node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager"/>
  <node pkg="nodelet" type="nodelet" name="velocity_multiplexer" args="load cmd_vel_mux/CmdVelMuxNodelet nodelet_manager">

    <param name="subscribers_cfg_file" value="$(find cmd_vel_mux)/param/example_cfg1.yaml"/>

    <remap from="cmd_vel_mux/mux_cmd_vel" to="mobile_base/commands/velocity"/>
    <remap from="cmd_vel_mux/web_cmd_vel" to="web_app_teleop"/>
    <remap from="cmd_vel_mux/key_cmd_vel" to="key_cmd_vel"/>
    <remap from="velocity_multiplexer/amcl_pose" to="amcl_pose" />
    <remap from="velocity_multiplexer/move_base_simple/goal" to="move_base_simple/goal" />

  </node>
</launch>

resulting rqt graphs of

  1. teleoperation

  2. automated navigation

i am not able to understand the complexity of the problem.

please help me to understand "how can i switch between cmd_vel used by teleop & cmd_vel used by move_base"

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-10-21 15:44:40 -0500

ahendrix gravatar image

Take a look at the assisted_teleop package: http://wiki.ros.org/assisted_teleop

It isn't documented, but there are a few sample launch files like https://github.com/ros-planning/navig...

edit flag offensive delete link more

Comments

@ahendrix thank you for reply

i have read about cmd_vel_mux, can we use it for the same purpose. i am also using the same. but not able to write the launch file.

sumant gravatar image sumant  ( 2014-10-22 17:16:33 -0500 )edit

cmd_vel_mux allows switching between topics, but is generally useful in the cases where manual control should preempt autonomous control; not the other way around.

ahendrix gravatar image ahendrix  ( 2014-10-22 20:07:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-10-21 15:34:08 -0500

Seen: 6,557 times

Last updated: Oct 21 '14