0
$\begingroup$

Gazebo Answers logo

hi there. I am trying to load a costume world for Hector_quadrotor_gazebo , lets say 3.world which is basically roslaunch hector_quadrotor_gazebo quadrotor_empty_world.launch then added some buildings and objects and saved the new world as 3.world.

how can launch this world later on ? i had followed the tutorial in 'http://learn.turtlebot.com/2015/02/03/6/' which worked fine for turtlebot but didnt work for hector_quadrotor.

iam new to ROS and Gazebo so excuse my question.


Originally posted by Caesar84 on Gazebo Answers with karma: 3 on 2018-04-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

So if you look at the contents of the quadrotor_empty_world.launch take note of the following section:

<include file="$(find gazebo_ros)/launch/empty_world.launch">
  <arg name="paused" value="$(arg paused)"/>
  <arg name="use_sim_time" value="$(arg use_sim_time)"/>
  <arg name="gui" value="$(arg gui)"/>
  <arg name="headless" value="$(arg headless)"/>
  <arg name="debug" value="$(arg debug)"/>
</include>

This .launch file passes arguments to gazebo_ros's empty_world.launch file. If you look at the empty_world.launch file, you'll see the following line:

<arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->

This line means that you can pass this file a world_name argument to open any .world file you'd like.

So to answer your question, add a line (or make a copy if you don't want to change the original file) to the quadrotor_empty_world.launch file like so:

<include file="$(find gazebo_ros)/launch/empty_world.launch">
  <arg name="paused" value="$(arg paused)"/>
  <arg name="use_sim_time" value="$(arg use_sim_time)"/>
  <arg name="gui" value="$(arg gui)"/>
  <arg name="headless" value="$(arg headless)"/>
  <arg name="debug" value="$(arg debug)"/>
  <arg name="world_name" value="path/to/3.world"/>
</include>

And then obviously input the correct path to your 3.world file.


Originally posted by Raskkii with karma: 376 on 2018-04-03

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.