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

After a day of reading a book on ROS, I have a few questions.

asked 2020-04-13 22:19:07 -0500

Hulkthehunter gravatar image

updated 2022-03-20 09:55:55 -0500

lucasw gravatar image

Please bear with me since it will be a tad long. I have 3 questions and each question has sub-sections. I am following the ROS Robotics by example by Dr. Harman. I am asking these questions after a lot of googling but could not find or understand the answers provided. Kindly explain to me the following questions like I am 5.

1) By default, the turtlebot is spawned at the origin. I have a 5x5 map so how can I spawn turtlebot at say, (2,3)?

I thought I could make changes in the .urdf file but I realized there was no .urdf file for turtlebot. Instead, there was .urdf.xacro file in /opt/ros/kinetic/share/turtlebot_description/urdf

Now my understanding is that .xacro files and .urdf files are both.XML files and .xarco files are more cleaned up version of .urdf file.

1.a) So what does it mean if a file has the name `turtlebot_gazebo.urdf.xacro`? 
1.b) Which file does gazebo accept? urdf? .xacro? sdf?
1.c) With which file do you start when you build your own robot?

2) To spawn turlebot in my custom map, I copied the lauch folder from /opt/ros/kinetic/share/turtlebot_gazebo to my package named trial. Then I set the TURTLEBOT_GAZEBO_WORLD_FILE=/home/kacd/catkin_ws/src/trial/worlds/ to load the turtlebot to my custom world.

Alternatively, I could also have done roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=<full path to the world file> But then I would have had to run it from the turtlebot_gazebo package.

2a)What's the best way to do this to spawn turtlebot to a custom map from (?) your package? 
2b) We know that when turtlebot is spawned, a node cmd_vel is already associated with it that we publish the velocities to. Let's say that we spawn our model. How can you associate the same node (cmd_vel) to your model? Do we do it through launch files?

3) On reading further, I realized that we create launch files for Rviz and Gazebo separately

 3a) How can we create launch files?
 3b) What are the requirements for making a .launch file i.e. what all data, files should we have?
 3c) Is the following statement correct: .launch files contain the nodes associated with a robot/model. If not then what does a launch file contain?
edit retag flag offensive close merge delete



I have 3 questions and each question has sub-sections.

since you are new you could not know, but please do not post multiple questions in a single post here on this forum. See the Support Guidelines.

In most cases you'll get partial answers, which then essentialyl make it impossible to select one answer as the answer, leaving your question to look like it never got answered.

Additionally: your question title does not say anything about your actual questions.

Suggestion: post three separate questions. Give them proper titles and tags. Make your questions refer to each other where it makes sense.

And please don't use code-blocks (indented by 4 spaces) for your lists.

As-is, I should've actually closed your question as it violates the guidelines, but I'll give you the opportunity to fix it.

gvdhoorn gravatar image gvdhoorn  ( 2020-04-14 02:45:15 -0500 )edit

Agreed! and @Hulkthehunter you've already asked some similar questions earlier today. Please see if those answers/comments help and try to respond to them. People are willing to help out if you give more feedback and information regarding your questions. If you find an answer helpful and correct, please give an upvote or select it as best answer to reduce the long queue of unanswered questions on ROS Answers. This seem-trivial feedback really helps the ROS Answers community.
btw, @gvdhoorn, you've attached the wrong link to Support Guidelines.

karenchiang gravatar image karenchiang  ( 2020-04-14 04:55:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-14 00:04:21 -0500

electrophod gravatar image

1) Spawn is a service which the turtlebot3 server provides. When you launch the launch file, the spawn service is called with (0,0) as the parameters. IF you wan to spawn the turtle at (x,y) you will have to make changes in the launch file.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-04-13 22:19:07 -0500

Seen: 170 times

Last updated: Apr 14 '20