Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to deal multiple erratic robots in gazebo?

Hi, I am stuck in a problem. I want use two/three erratic robots in gazebo. I have got help from link here. I am successful in spawning two erratic robots. I am using this two_robots.launch

<launch> <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>

<group ns="robot1">

    <param name="tf_prefix" value="robot1"/>

    <!-- send the erratic robot XML to param server -->

<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->

   <node name="spawn_robot1" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -z 0.01
                -model robot1"
          respawn="false" output="screen" /> 




    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher1" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    <remap from="odom" to="beta/odom" /> 

    </node>

<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>



</group>

<group ns="robot2">
    <param name="tf_prefix" value="robot2"/>

    <!-- send the erratic robot XML to param server -->
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot2" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 1.00
                -z 0.01
                -model robot2"
          respawn="false" output="screen" />

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>


<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>


</group>

</launch>

Its working very fine. But I have a problem here I can not publish separate topic /odom and subscribe separate topic /cmd_vel for each robot. Here I can do one thing that I can change code "erratic_gazebo_plugins/src/diffdrive_plugin.cpp" for each robot, but its not a good approach.

Is it possible that I can overcome that problem in my launch file. Thanks

how to deal multiple erratic robots in gazebo?

Hi, I am stuck in a problem. I want to use two/three erratic robots in gazebo. I have got help from link here. I am successful in spawning two erratic robots. I am using this two_robots.launch

<launch> <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>

<group ns="robot1">

    <param name="tf_prefix" value="robot1"/>

    <!-- send the erratic robot XML to param server -->

<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->

   <node name="spawn_robot1" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -z 0.01
                -model robot1"
          respawn="false" output="screen" /> 




    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher1" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    <remap from="odom" to="beta/odom" /> 

    </node>

<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>



</group>

<group ns="robot2">
    <param name="tf_prefix" value="robot2"/>

    <!-- send the erratic robot XML to param server -->
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot2" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 1.00
                -z 0.01
                -model robot2"
          respawn="false" output="screen" />

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>


<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>


</group>

</launch>

Its working very fine. But I have a problem here I can not publish separate topic /odom and subscribe separate topic /cmd_vel for each robot. Here I can do one thing that I can change code "erratic_gazebo_plugins/src/diffdrive_plugin.cpp" for each robot, but its not a good approach.

Is it possible that I can overcome that problem in my launch file. Thanks

how to deal multiple erratic robots in gazebo?

Hi, I am stuck in a problem. I want to use two/three erratic robots in gazebo. I have got help from link here. I am successful in spawning two erratic robots. I am using this two_robots.launch

<launch> <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>

<group ns="robot1">

    <param name="tf_prefix" value="robot1"/>

    <!-- send the erratic robot XML to param server -->

<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->

   <node name="spawn_robot1" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -z 0.01
                -model robot1"
          respawn="false" output="screen" /> 




    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher1" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    <remap from="odom" to="beta/odom" /> 

    </node>

<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>



</group>

<group ns="robot2">
    <param name="tf_prefix" value="robot2"/>

    <!-- send the erratic robot XML to param server -->
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot2" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 1.00
                -z 0.01
                -model robot2"
          respawn="false" output="screen" />

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>


<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>


</group>

</launch>

Its working very fine. But I have a problem here I can not publish separate topic /odom and subscribe separate topic /cmd_vel for each robot. Here I can do one thing that I can change code "erratic_gazebo_plugins/src/diffdrive_plugin.cpp" for each robot, but its not a good approach.

Is it possible that I can overcome that problem in my launch file. Thanks

how to deal multiple erratic robots in gazebo?

Hi, I am stuck in a problem. I want to use two/three erratic robots in gazebo. I have got help from link here. I am successful in spawning two erratic robots. I am using this two_robots.launch

<launch>
     <param name="use_sim_time" value="true" />
 <node name="gazebo" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>

output="screen"/>

<group ns="robot1">

    <param name="tf_prefix" value="robot1"/>

    <!-- send the erratic robot XML to param server -->

<param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->

   <node name="spawn_robot1" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -z 0.01
                -model robot1"
          respawn="false" output="screen" /> 




    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher1" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    <remap from="odom" to="beta/odom" /> 

    </node>

<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>



</group>

<group ns="robot2">
    <param name="tf_prefix" value="robot2"/>

    <!-- send the erratic robot XML to param server -->
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find erratic_world)/urdf/erratic_laser.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot2" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -urdf
                -x 1.00
                -z 0.01
                -model robot2"
          respawn="false" output="screen" />

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher2" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />
    </node>


<!-- Filter for base laser shadowing/veiling -->
<node pkg="laser_filters" type="scan_to_cloud_filter_chain" respawn="true" name="base_shadow_filter" >
    <remap from="scan" to="base_scan/scan" />
    <remap from="cloud_filtered" to="base_scan/shadow_filtered_old" />
    <param name="target_frame" value="base_footprint" />
    <param name="high_fidelity" value="false" />
    <rosparam command="load" file="$(find erratic_description)/params/shadow_filter.yaml" />
</node>


</group>
</launch>

</launch>

Its working very fine. But I have a problem here I can not publish separate topic /odom and subscribe separate topic /cmd_vel for each robot. Here I can do one thing that I can change code "erratic_gazebo_plugins/src/diffdrive_plugin.cpp" for each robot, but its not a good approach.

Is it possible that I can overcome that problem in my launch file. file? Thanks