Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Not sure if this answer is relevant after all it's been 2 years.

Anyways, here goes. There are 2 things that the model needs to spawn in gazebo and rviz

  1. --namespace : Changing this in robot_description changes the model name.

  2. tf_prefix : This parameter changes your TF description. WHY??? So that we can find the relationship between the models.

  3. group ns : changing this parameter changes your node names. type /rosnode list or rostopic list

OK here are some examples:

1 node name="robot1_controller_spawner" pkg="controller_manager" type="spawner" args="--namespace=/robot1

Model name of base_link is now .... robot1/base_link robot1/sexy_link

2 Conditions ....

a. if (tf_prefix=null) No transform from [robot1/sexy_link] to [robot1/base_link]
b. if(tf_prefix=robot1) Your model works fine.

BUT WAIT, THERE'S more Why does my model still not work??? and the error No transform from [robot1/sexy_link] to [robot1/base_link] is still present???

Here are the steps 1. go to somefile.rviz Instructions below are the two changes

  1. find Fixed Frame , change this to Fixed Frame: robot1/base_link

  2. find Link Tree Style, change the parameter to Joints in Alphabetic Order,

    like so... Link Tree Style: Joints in Alphabetic Order

^Knowing this information... Will help u understand rviz better Here's a more modular answer.

Step 1: change Fixed Frame : map

Step 2: add this into launch file

node pkg="tf" type="static_transform_publisher" name="odom_map_broadcaster" args="0 0 0 0 0 0 map robot1/base_link 100"