Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have resolved the problem. It was about conflicting namespaces for the controller manager. I have removed the control.launch file and included the stuff in the rover.launch itself. then i had to include namespaces everywhere.

<launch>
  <arg name="init_pose"/>
  <arg name="robot_name"/>
  <param name="robot_description" command="$(find xacro)/xacro $(find leo_description)/urdf/new.urdf.xacro" />

  <!-- push robot_description to factory and spawn robot in gazebo -->
  <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" ns="/$(arg robot_name)"
        args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description " respawn="false" output="screen"/>
  <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher" ns="leo">
    <param name="publish_frequency" type="double" value="30.0" />
  </node> 
  <arg name="model" default="$(find leo_description)/urdf/new.urdf.xacro"/>

  <!-- Load controller configuration />-->
  <rosparam command="load" file="$(find leo_control)/config/control.yaml" ns="/$(arg robot_name)" />
  <node name="controller_spawner_$(arg robot_name)" pkg="controller_manager" type="spawner" ns="/$(arg robot_name)"
    respawn="false" args=" leo/leo_velocity_controller leo/leo_joint_publisher --namespace=/$(arg robot_name)" output="screen"/>   
</launch>

and i had also removed the namespace from the urdf/xacro file at the bottom with the help of this answer's first part.