Revision history [back]

I can't load the file I saved which has turtlebot and garage willow.

When saving a world in Gazebo you don't save it with the robot in it, you have to create your world with only your obstacles and then save the world. To add your robot in a world you use a service : /gazebo/spawn_urdf_model that is called when you use the node spawn_model(you can find it here in the kobuki.launch that is included from turtlebot_world.launch).

To tell which world you want to use there is the argument world_file in the turtlebot_world.launch so you just have to specify it when using roslaunch :

roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/PATH/TO/YOUR/WORLD


You can also modify the launch file to change the default value, or in that case the launch file use the environment variable TURTLEBOT_GAZEBO_WORLD_FILE so you can set it in your terminal to the path of your world file using :

export TURTLEBOT_GAZEBO_WORLD_FILE = /PATH/TO/YOUR/WORLD


I can't load the file I saved which has turtlebot and garage willow.

When saving a world in Gazebo you don't save it with the robot in it, you have to create your world with only your obstacles and then save the world. To add your robot in a world you use a service : /gazebo/spawn_urdf_model that is called when you use the node spawn_model(you can find it here in the kobuki.launch that is included from turtlebot_world.launch).

To tell which world you want to use there is the argument world_file in the turtlebot_world.launch so you just have to specify it when using roslaunch :

roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/PATH/TO/YOUR/WORLD


You can also modify the launch file to change the default value, or in that case the launch file use the environment variable TURTLEBOT_GAZEBO_WORLD_FILE so you can set it in your terminal to the path of your world file using :

export TURTLEBOT_GAZEBO_WORLD_FILE = /PATH/TO/YOUR/WORLD


to make the turtlebot is in the garage willow filed with the same place and pose with those of when I made the map of garage

Now when you call the service to spawn the model you can specify the position you want to for the robot:

 <node name="spawn_turtlebot_model" pkg="gazebo_ros" type="spawn_model"
args="-x 0 -y 0 -Y -unpause -urdf -param robot_description -model mobile_base"/>


You have to use the arguments -x, -y, -z, -R, -P, -Y to set x, y, z and the roll, pitch and yaw of our robot.

I can't load the file I saved which has turtlebot and garage willow.

When saving a world in Gazebo you don't save it with the robot in it, you have to create your world with only your obstacles and then save the world. To add your robot in a world you use a service : /gazebo/spawn_urdf_model that is called when you use the node spawn_model(you can find it here in the kobuki.launch that is included from turtlebot_world.launch).

To tell which world you want to use there is the argument world_file in the turtlebot_world.launch so you just have to specify it when using roslaunch :

roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/PATH/TO/YOUR/WORLD


You can also modify the launch file to change the default value, or in that case the launch file use the environment variable TURTLEBOT_GAZEBO_WORLD_FILE so you can set it in your terminal to the path of your world file using :

export TURTLEBOT_GAZEBO_WORLD_FILE = /PATH/TO/YOUR/WORLD


to make the turtlebot is in the garage willow filed with the same place and pose with those of when I made the map of garage

Now when you call the service to spawn the model you can specify the position you want to for the robot:

 <node name="spawn_turtlebot_model" pkg="gazebo_ros" type="spawn_model"
args="-x 0 -y 0 -Y -unpause -urdf -param robot_description -model mobile_base"/>


You have to use the arguments -x, -y, -z, -R, -P, -Y to set x, y, z and the roll, pitch and yaw of our robot.