ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi @Qilos,
To launch a custom world you do not need to change the gazebo_ros
launcher, you just need to pass the world file location to the launcher. The error is telling you that the launch file you are passing does not exist. You will need to do something like:
<?xml version="1.0"?>
<launch>
<!-- [...] Tutlebot things-->
<!-- Coordinates to spawn model -->
<arg name="x" default="0.0"/>
<arg name="y" default="0.0"/>
<arg name="z" default="0.02"/>
<arg name="roll" default="0.0"/>
<arg name="pitch" default="0.0"/>
<arg name="yaw" default="0.0"/>
<arg name="world" default="$(find turtlebot3_gazebo)/worlds/simpleWorld.world"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/>
</include>
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="$(arg output)"
args="-urdf -model turtlebot3_$(arg model) -param robot_description -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)"/>
</launch>
Please note that the launch file is not changed but the world_name
param.
Hope this helps with your problem.
Regards.
2 | No.2 Revision |
Hi @Qilos,
To launch a custom world you do not need to change the gazebo_ros
launcher, you just need to pass the world file location to the launcher. The error is telling you that the launch file you are passing does not exist. You will need to do something like:
<?xml version="1.0"?>
<launch>
<!-- [...] Tutlebot things-->
<!-- Coordinates to spawn model -->
<arg name="x" default="0.0"/>
<arg name="y" default="0.0"/>
<arg name="z" default="0.02"/>
<arg name="roll" default="0.0"/>
<arg name="pitch" default="0.0"/>
<arg name="yaw" default="0.0"/>
<arg name="output" default="log"/>
<arg name="world" default="$(find turtlebot3_gazebo)/worlds/simpleWorld.world"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/>
</include>
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="$(arg output)"
args="-urdf -model turtlebot3_$(arg model) -param robot_description -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)"/>
</launch>
Please note that the launch file is not changed but the world_name
param.
Hope this helps with your problem.
Regards.