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

Revision history [back]

I am implementing this technique in ridgeback robots by Clear path robotics. It is launching the 2 robots in gazebo world but I am cannot control them inidividually. Publishing in one cmd_vel moves both the robots. I am aslo getting a error that control manager service already exist. I tried giving them different namespaces, But still it is not working. Please help, I am attaching my launch files one_robot.launch

<launch> <arg name="x" default="0"/> <arg name="y" default="0"/> <arg name="z" default="1"/> <arg name="yaw" default="0"/> <arg name="robot_name" default="ridgeback"/>

<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" args="-urdf -model $(arg robot_name) -param /robot_description -x $(arg x) -y $(arg y) -z $(arg z) -Y $(arg yaw)"/> respawn="false" output="screen" />

<node pkg="robot_state_publisher" type="state_publisher" 
      name="robot_state_publisher" output="screen"/>

<!-- The odometry estimator, throttling, fake laser etc. go here -->
<!-- All the stuff as from usual robot launch file -->

  <rosparam param="/gazebo_ros_control/pid_gains">
    front_left_wheel:
      p: 1
      i: 0.1
      d: 0
    front_right_wheel:
      p: 1
      i: 0.1
      d: 0
    rear_left_wheel:
      p: 1
      i: 0.1
      d: 0
    rear_right_wheel:
      p: 1
      i: 0.1
      d: 0
  </rosparam>

<!-- control -->
   <rosparam command="load" file="$(find ridgeback_control)/config/control.yaml" ns="/$(arg robot_name)"/>

  <group if="$(optenv RIDGEBACK_CONTROL_EXTRAS 0)" >
    <rosparam command="load" file="$(env RIDGEBACK_CONTROL_EXTRAS_PATH)" />
  </group>

  <node name="controller_spawner_$(arg robot_name)"  pkg="controller_manager" type="spawner"
        args=" --namespace=/$(arg robot_name) ridgeback_joint_publisher ridgeback_velocity_controller --shutdown-timeout 50 " />

  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" />

  <node pkg="topic_tools" type="relay" name="cmd_vel_relay"
        args="/cmd_vel ridgeback_velocity_controller/cmd_vel" />

  <arg name="joy_dev" default="/dev/input/js0" />
  <arg name="joystick" default="true" />

  <group ns="bluetooth_teleop" if="$(arg joystick)">

<group unless="$(optenv RIDGEBACK_PS3 0)" >
  <rosparam command="load" file="$(find ridgeback_control)/config/teleop_ps4.yaml" />
</group>

<group if="$(optenv RIDGEBACK_PS3 0)" >
  <rosparam command="load" file="$(find ridgeback_control)/config/teleop_ps3.yaml" />
  <param name="joy_node/dev" value="$(arg joy_dev)" />
</group>

<node pkg="joy" type="joy_node" name="joy_node" />

<node pkg="teleop_twist_joy" type="teleop_node" name="teleop_twist_joy">
  <remap from="cmd_vel" to="/cmd_vel" />
</node>

</group>

<arg name="config" default="linear"/>

<node pkg="interactive_marker_twist_server" type="marker_server" name="twist_marker_server"> <remap from="twist_marker_server/cmd_vel" to="/cmd_vel"/> <rosparam command="load" file="$(find interactive_marker_twist_server)/config/$(arg config).yaml"/> </node> </launch>

robots.launch

<launch>
    <arg name="debug" default="false"/>
    <arg name="gui" default="true"/>
    <arg name="pause" default="false"/>
    <arg name="world" value="$(find hybrid_astar)/world/hospital_04.world"/>

    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" default="$(arg world)"/>
        <arg name="debug" value="$(arg debug)"/>
        <arg name="gui" value="$(arg gui)"/>
        <arg name="paused" value="$(arg pause)"/>
        <arg name="use_sim_time" value="true"/>
    </include> 

  <!-- <param name="/use_sim_time" value="true" />


  <node name="gazebo" pkg="gazebo_ros" type="gazebo" 
   args="$(find hybrid_astar)/world/empty_wall.world" respawn="false" output="screen" /> -->


 <!-- <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>-->

<arg name="config" default="dual_hokuyo_lasers" />
    <param name="robot_description"
        command="$(find ridgeback_description)/scripts/env_run
            $(find ridgeback_description)/urdf/configs/$(arg config)
            $(find xacro)/xacro $(find ridgeback_description)/urdf/ridgeback.urdf.xacro
            --inorder " />

<group ns ="robot1">
    <param name = "tf_prefix" value="robot1_tf"/>
    <include file="$(find hybrid_astar)/launch/one_robot.launch">
        <arg name="x" default="-17.000000"/>
        <arg name="y" default="0"/>
        <arg name="z" default="0.025893"/>
        <arg name="yaw" default="0.000000"/>
        <arg name="robot_name" value="robot1"/>
        <remap from ="/cmd_vel" to = "/robot1/cmd_vel"/>

    </include>
</group>

<group ns ="robot2">
    <param name = "tf_prefix" value="robot2_tf"/>
    <include file="$(find hybrid_astar)/launch/one_robot.launch">
        <arg name="x" default="-12.000000"/>
        <arg name="y" default="2"/>
        <arg name="z" default="0.025893"/>
        <arg name="yaw" default="0.000000"/>
        <arg name="robot_name" value="robot2"/>
        <remap from ="/cmd_vel" to = "/robot2/cmd_vel"/>

    </include>
</group> 
</launch>

Error in terminal

[ERROR] [1635243293.936003882, 31.487000000]: Tried to advertise a service that is already advertised in this node [/gazebo_ros_control/pid_gains/front_left_wheel/set_parameters]
[ERROR] [1635243294.072894760, 31.487000000]: Tried to advertise a service that is already advertised in this node [/gazebo_ros_control/pid_gains/front_right_wheel/set_parameters]
[ERROR] [1635243294.193618271, 31.487000000]: Tried to advertise a service that is already advertised in this node [/gazebo_ros_control/pid_gains/rear_left_wheel/set_parameters]
[ERROR] [1635243294.336273897, 31.487000000]: Tried to advertise a service that is already advertised in this node [/gazebo_ros_control/pid_gains/rear_right_wheel/set_parameters]
[ERROR] [1635243294.477445195, 31.487000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/rear_left_cart_wheel_joint
[ERROR] [1635243294.483662618, 31.487000000]: No p gain specified for pid.  Namespace: /gazebo_ros_control/pid_gains/rear_right_cart_wheel_joint
[ERROR] [1635243294.485140100, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controllers]
[ERROR] [1635243294.485794121, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/list_controller_types]
[ERROR] [1635243294.486308903, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/load_controller]
[ERROR] [1635243294.486801583, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/unload_controller]
[ERROR] [1635243294.487054319, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/switch_controller]
[ERROR] [1635243294.487499566, 31.487000000]: Tried to advertise a service that is already advertised in this node [/controller_manager/reload_controller_libraries]