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

To save gazebo setting and launch

asked 2020-01-22 19:42:26 -0500

kane_choigo gravatar image

Hello, I'm working with ROS kinect on Ubuntu 16.04.

I'm trying to make my own navigation file based on turtlebot.

As far as I know, it is essential to make the robot be in the same place and pose with these of when it started to make its map.

But what I can do now is just,

roslaunch turtlebot_gazebo turtlebot_world.launch

Of course I can insert garage willow in gazebo after I launch the above,

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

What I want to do is,

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

Anyone who can give me help?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-01-24 02:02:30 -0500

Delb gravatar image

updated 2020-01-24 02:08:27 -0500

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 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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-01-22 19:42:26 -0500

Seen: 1,502 times

Last updated: Jan 24 '20