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

Revision history [back]

click to hide/show revision 1
initial version

Minutes after posting this question I managed to resolve it:

First of all you have to remove the namespace tag from the .xacro/urdf file in order for the robots to get a namespece you specify, like so:

 <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
  </gazebo>

Second, you have to specify the namespace almost everywhere even if you have the group tag, qn i aill give an example for one robot:

<group ns="/robot1">
   <rosparam file="$(find YOUR_PACKAGE)/config/control.yaml" command="load" ns="/robot1" /> 
   <param name="/robot1/robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
      <node name="urdf_spawner_1" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot1 -param robot_description " respawn="false" output="screen">
      </node>

      <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher_1">
        <param name="publish_frequency" type="double" value="30.0" />
      </node>

      <node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" 
        args="--namespace=/robot1
        joint_state_controller
        tri_wheel_controller
        arm_controller
        --shutdown-timeout 3">
      </node>

      <node name="rqt_robot_steering1" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/robot1/tri_wheel_controller/cmd_vel"/>
      </node>
  </group>

And so on for qnother robot. Keep in mind that i redefined the robot_description each time in order for the controller to find it in the same namespace. It didn't work for me to define it outside and the use it in the group like /robot_description

Minutes after posting this question I managed to resolve it:

First of all you have to remove the namespace tag from the .xacro/urdf file in order for the robots to get a namespece you specify, like so:

 <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
  </gazebo>

Second, you have to specify the namespace almost everywhere even if you have the group tag, qn i aill and I'll give an example for one robot:

<group ns="/robot1">
   <rosparam file="$(find YOUR_PACKAGE)/config/control.yaml" command="load" ns="/robot1" /> 
   <param name="/robot1/robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
      <node name="urdf_spawner_1" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot1 -param robot_description " respawn="false" output="screen">
      </node>

      <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher_1">
        <param name="publish_frequency" type="double" value="30.0" />
      </node>

      <node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" 
        args="--namespace=/robot1
        joint_state_controller
        tri_wheel_controller
        arm_controller
        --shutdown-timeout 3">
      </node>

      <node name="rqt_robot_steering1" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/robot1/tri_wheel_controller/cmd_vel"/>
      </node>
  </group>

And so on for qnother robot. Keep in mind that i redefined the robot_description each time in order for the controller to find it in the same namespace. It didn't work for me to define it outside and the use it in the group like /robot_description

Minutes after posting this question I managed to resolve it:

First of all you have to remove the namespace tag from the .xacro/urdf file in order for the robots to get a namespece you specify, like so:

 <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
  </gazebo>

Second, you have to specify the namespace almost everywhere even if you have the group tag, and I'll give an example for one robot:

<group ns="/robot1">
  <param name="tf_prefix" value="atlas1" />
   <rosparam file="$(find YOUR_PACKAGE)/config/control.yaml" command="load" ns="/robot1" /> 
   <param name="/robot1/robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
      <node name="urdf_spawner_1" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot1 -param robot_description " respawn="false" output="screen">
      </node>

      <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher_1">
        <param name="publish_frequency" type="double" value="30.0" />
      </node>

      <node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" 
        args="--namespace=/robot1
        joint_state_controller
        tri_wheel_controller
        arm_controller
        --shutdown-timeout 3">
      </node>

      <node name="rqt_robot_steering1" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/robot1/tri_wheel_controller/cmd_vel"/>
      </node>
  </group>

And so on for qnother robot. Keep in mind that i redefined the robot_description each time in order for the controller to find it in the same namespace. It didn't work for me to define it outside and the use it in the group like /robot_description

tf_prefix is used in order to see all the robots in rviz. I am not sure how does it work without it, or how to use something else as tf_prefix is deprecated. For now it does not work to see it in rviz so I figures it does not calculate the tf for the link. I don't know how to solve this

Minutes after posting this question I managed to resolve it:

First of all you have to remove the namespace tag from the .xacro/urdf file in order for the robots to get a namespece namespace you specify, like so:

 <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
  </gazebo>

Second, you have to specify the namespace almost everywhere even if you have the group tag, and I'll give an example for one robot:

<group ns="/robot1">
  <param name="tf_prefix" value="atlas1" />
   <rosparam file="$(find YOUR_PACKAGE)/config/control.yaml" command="load" ns="/robot1" /> 
   <param name="/robot1/robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
      <node name="urdf_spawner_1" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot1 -param robot_description " respawn="false" output="screen">
      </node>

      <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher_1">
        <param name="publish_frequency" type="double" value="30.0" />
      </node>

      <node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" 
        args="--namespace=/robot1
        joint_state_controller
        tri_wheel_controller
        arm_controller
        --shutdown-timeout 3">
      </node>

      <node name="rqt_robot_steering1" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/robot1/tri_wheel_controller/cmd_vel"/>
      </node>
  </group>

And so on for qnother robot. Keep in mind that i redefined the robot_description each time in order for the controller to find it in the same namespace. It didn't work for me to define it outside and the use it in the group like /robot_description

tf_prefix is used in order to see all the robots in rviz. I am not sure how does it work without it, or how to use something else as tf_prefix is deprecated. For now it does not work to see it in rviz so I figures it does not calculate the tf for the link. I don't know how to solve this

Minutes after posting this question I managed to resolve it:

First of all you have to remove the namespace tag from the .xacro/urdf file in order for the robots to get a namespace you specify, like so:

 <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    </plugin>
  </gazebo>

Second, you have to specify the namespace almost everywhere even if you have the group tag, and I'll give an example for one robot:

<group ns="/robot1">
  <param name="tf_prefix" value="atlas1" />
   <rosparam file="$(find YOUR_PACKAGE)/config/control.yaml" command="load" ns="/robot1" /> 
   <param name="/robot1/robot_description" command="$(find xacro)/xacro --inorder $(arg model)"/>
      <node name="urdf_spawner_1" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot1 -param robot_description " respawn="false" output="screen">
      </node>

      <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher_1">
        <param name="publish_frequency" type="double" value="30.0" />
      </node>

      <node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" 
        args="--namespace=/robot1
        joint_state_controller
        tri_wheel_controller
        arm_controller
        --shutdown-timeout 3">
      </node>

      <node name="rqt_robot_steering1" pkg="rqt_robot_steering" type="rqt_robot_steering">
        <param name="default_topic" value="/robot1/tri_wheel_controller/cmd_vel"/>
      </node>
  </group>

And so on for qnother another robot. Keep in mind that i I redefined the robot_description each time in order for the controller to find it in the same namespace. It didn't work for me to define it outside and the use it in the group like /robot_description

tf_prefix is used in order to see all the robots in rviz. I am not sure how does it work without it, or how to use something else as tf_prefix is deprecated. For now it does not work to see it in rviz so I figures figured it does not calculate the tf for the link. I don't know how to solve this