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

Thank you nbeyers. That was the hint I needed to get everything working. it was not clear to me, and is still not completely clear, how the controller_manager loads these controllers into gazebo, but for now I have a working example.

I was able to avoid having multiple control.yaml files for each robot by setting the base_frame_id parameter directly, overwriting the value form the control.yaml file.

 <rosparam command="load" file="$(find husky_control)/config/control.yaml" />
 <rosparam param="husky_velocity_controller/base_frame_id" subst_value="True">$(arg tfpre)/base_link</rosparam>
  <node name="base_controller_spawner" pkg="controller_manager" type="spawner" args="husky_joint_publisher husky_velocity_controller --shutdown-timeout 3"/>

This lead to a somewhat satisfying result where I could spawn multiple Huskies succinctly by only changing one launch file. Something like this...

<group ns="h1">
  <include file="$(find nre_simmultihusky)/launch/husky.launch">
    <arg name="namespace" value="h1" />
    <arg name="initX" value="2" />
    <arg name="initY" value="2" />
    <arg name="initYaw" value="0" />
   </include>

</group>

<group ns="h2">
  <include file="$(find nre_simmultihusky)/launch/husky.launch">
    <arg name="namespace" value="h2" />
    <arg name="initX" value="-3" />
    <arg name="initY" value="-3" />
    <arg name="initYaw" value="3.14" />
  </include>
</group>

I wish I could find a way to cleanly only have to enter the namespace (e.g., 'h1') once instead of having to repeat it in group and arg tags.

I've posted my solution here https://github.com/bsb808/nre_simmultihusky

I have to say, I was pretty surprised by how much effort it took to change the namespace and tf_prefix in all the appropriate places to get this to run correctly. I'm new to ROS, but I expected the use of the group tag with a namespace to percolate through components better. I also didn't appreciate the headache that the propagating the tf_prefix appropriately would be - to a new person it seems redundant with the namespace.

Thanks again - glad to get it up and running.

Thank you nbeyers. That was the hint I needed to get everything working. it was not clear to me, and is still not completely clear, how the controller_manager loads these controllers into gazebo, but for now I have a working example.

I was able to avoid having multiple control.yaml files for each robot by setting the base_frame_id parameter directly, overwriting the value form the control.yaml file.

 <rosparam command="load" file="$(find husky_control)/config/control.yaml" />
 <rosparam param="husky_velocity_controller/base_frame_id" subst_value="True">$(arg tfpre)/base_link</rosparam>
  <node name="base_controller_spawner" pkg="controller_manager" type="spawner" args="husky_joint_publisher husky_velocity_controller --shutdown-timeout 3"/>

This lead to a somewhat satisfying result where I could spawn multiple Huskies succinctly by only changing one launch file. Something like this...

<group ns="h1">
  <include file="$(find nre_simmultihusky)/launch/husky.launch">
    <arg name="namespace" value="h1" />
    <arg name="initX" value="2" />
    <arg name="initY" value="2" />
    <arg name="initYaw" value="0" />
   </include>

</group>

 </group>

<group ns="h2">
  <include file="$(find nre_simmultihusky)/launch/husky.launch">
    <arg name="namespace" value="h2" />
    <arg name="initX" value="-3" />
    <arg name="initY" value="-3" />
    <arg name="initYaw" value="3.14" />
  </include>
</group>

I wish I could find a way to cleanly only have to enter the namespace (e.g., 'h1') once instead of having to repeat it in group and arg tags.

I've posted my solution here https://github.com/bsb808/nre_simmultihusky

I have to say, I was pretty surprised by how much effort it took to change the namespace and tf_prefix in all the appropriate places to get this to run correctly. I'm new to ROS, but I expected the use of the group tag with a namespace to percolate through components better. I also didn't appreciate the headache that the propagating the tf_prefix appropriately would be - to a new person it seems redundant with the namespace.

Thanks again - glad to get it up and running.