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

multiple Turtlebot3 navigation and simulation

asked 2018-08-16 01:47:54 -0600

Pujie gravatar image

I found the relative source Multiple robots simulation and navigation.

I need to launch a turtlebot3 with navigation, and others can be controlled by teleop. My questions are: 1. Why my launch file doesn't work 2. Can I use the launch file to load the models in gazebo and use the second part of Multiple robots simulation and navigation.

I tried to compile the launch file, according to the link:Multiple robots simulation and navigation and Turtlebot3.

First, I tried to copy the Multiple robots simulation and navigation.

one_robot.launch
    <launch>
        <arg name="robot_name"/>
        <arg name="init_pose"/>
        <node name="spawn_minibot_model" pkg="gazebo" type="spawn_model"
              args="$(arg init_pose) -urdf -param /robot_description -model $(arg robot_name)"
              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 -->
    </launch>

then robots.launch

<launch>
    <!-- No namespace here as we will share this description.
         Access with slash at the beginning -->
    <!--param name="robot_description"
           command="$(find xacro)/xacro.py $(find turtlebot_description)/urdf/turtlebot.urdf.xacro" /-->

    <!-- BEGIN ROBOT 1-->

    <group ns="robot1">
        <param name="tf_prefix" value="robot1_tf" />
        <param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
        <include file="$(find turtlebot3_gazebo)/launch/one_robot.launch" >
            <arg name="init_pose" value="-x 1 -y 1 -z 0" />
            <arg name="robot_name"  value="Robot1" />
        </include>
    </group>

    <!-- BEGIN ROBOT 2-->
    <group ns="robot2">
        <param name="tf_prefix" value="robot2_tf" />
        <param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
        <include file="$(find turtlebot3_gazebo)/launch/one_robot.launch" >
            <arg name="init_pose" value="-x -1 -y 1 -z 0" />
            <arg name="robot_name"  value="Robot2" />
        </include>
    </group>
</launch>

new_simulation.launch

<launch>
    <param name="/use_sim_time" value="true" />
    <!-- start world -->
    <node name="gazebo" pkg="gazebo" type="gazebo"
          args="$(find turtlebot3_gazebo)/worlds/turtlebot3_world.world" respawn="false" output="screen" />
    <!-- start gui -->
    <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
    <!-- include our robots -->
    <include file="$(turtlebot3_gazebo)/launch/robots.launch"/>
</launch>

Up to now, I think the first part of launch the models in Gazebo. However, it doesn't.

roslaunch turtlebot3_gazebo new_simulation.launch 
... logging to /home/ise-admin/.ros/log/c26e921e-a106-11e8-841a-509a4c311940/roslaunch-ise-linux-1-25593.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Unknown substitution command [turtlebot3_gazebo]. Valid commands are ['find', 'env', 'optenv', 'anon', 'arg']
The traceback for the exception was written to the log file

The original launch multi TB3 in Gazebo on TB3 emanual is:

    <launch>
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="first_tb3"  default="tb3_0"/>
  <arg name="second_tb3" default="tb3_1"/>
  <arg name="third_tb3"  default="tb3_2"/>

  <arg name="first_tb3_x_pos" default="-2.0"/>
  <arg name="first_tb3_y_pos" default="-1.0"/>
  <arg name="first_tb3_z_pos" default=" 0.0"/>
  <arg name="first_tb3_yaw"   default=" 0.0"/>

  <arg name="second_tb3_x_pos" default=" 2.0"/>
  <arg name="second_tb3_y_pos" default="-1.0"/>
  <arg name="second_tb3_z_pos" default=" 0.0"/>
  <arg name="second_tb3_yaw"   default=" 0.0"/>

  <arg name="third_tb3_x_pos" default ...
(more)
edit retag flag offensive close merge delete

Comments

=>Unknown substitution command [turtlebot3_gazebo]. Valid commands are ['find', 'env', 'optenv', 'anon', 'arg']

I think the turtlebot3_gazebo package are not included in your workspace

Darby Lim gravatar image Darby Lim  ( 2018-08-16 19:48:42 -0600 )edit

No, I can find them by rospack find turtlebot3_gazebo. Anyway thank you for your comment.

Pujie gravatar image Pujie  ( 2018-08-16 20:19:03 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-19 15:54:35 -0600

David Lu gravatar image

In new_simulation.launch, you're missing the word find.

<include file="$(turtlebot3_gazebo)/launch/robots.launch"/>

should be

<include file="$(find turtlebot3_gazebo)/launch/robots.launch"/>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-16 01:47:54 -0600

Seen: 2,154 times

Last updated: Sep 19 '18