How is the correct way to attach the base link to world?
I am trying to move my mobile robot in gazebo and rviz, but when I try to create a floating joint to attach the base link to world link, like this:
<link name="world"/>
<joint name="world__${base_link}" type="floating">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="world"/>
<child link="${base_link}"/>
</joint>
<!-- Base Link -->
<link name="${base_link}">
I receive the warning message:
"[ WARN] [1605271103.966351116]: Converting unknown joint type of joint 'world_baselink' into a fixed joint"
and the rviz can not transform this joint (I have checked with tf view_frames and the world link doesn't appear). When I change this joint to "fixed", everything works well, but my robot is not able to move arround the world like in gazebo.
Is there another way to do it?
Asked by Hugo on 2020-11-13 08:00:23 UTC
Answers
Try this. I think it will work.
<link name="world" />
<joint name="world_to_base_link=" type="fixed">
<parent link="world"/>
<child link="base_link"/>
< /joint>
................... remaining links and joints ...................
Asked by shiraz_baig on 2020-11-13 08:35:33 UTC
Comments
Hi @shiraz_baig I already have tried this. Indeed, it works, but the base link remains fixed and the robot doesn't move around the space in Rviz. What I expected was that the robot was able to move freely, but it not happens.
Asked by Hugo on 2020-11-13 09:00:27 UTC
of course, the link I have suggested will not allows movement of the whole model. I suggest do not use the "floating" type of joint. In fact remove this joint altogether. Thus also remove the "floating" joint. See this example of urdf in this link https://github.com/ros/urdf_sim_tutorial/blob/master/urdf/09-publishjoints.urdf.xacro. Specifically the urdf file 10-firsttransmission.urdf.xacro It has no links with world. It is not using floating joints. It has four wheels and it freely moves in gazebo. The whole package is available on github. It should give you a good starting point.
Asked by shiraz_baig on 2020-11-13 11:23:05 UTC
When I try to remove the dummy link (here called world) from URDF, it doesn't work and I receive the following message: "[ WARN] [1605286721.912463036]: The root link base_link has an inertia specified in the URDF, but KDL does not support a root link with an inertia. As a workaround, you can add an extra dummy link to your URDF. "
Asked by Hugo on 2020-11-13 12:00:12 UTC
Hi @Hugo, were you able to connect the world frame with base link anyhow? I want my robot to move freely, but in RViz the visualization of the robot gets really messed up whenever I join the robot's base link with the world frame through a floating joint. Did you find any workaround for this problem? Thanks
Asked by random_enthusiast on 2020-12-24 18:28:03 UTC
Hi @random_enthusiast, the way that I found to workaround was to maintain the joint as "floating" and create a node to broadcast the position between /world and /base_link from the gazebo to rviz. I use the gazebo's service get_link_srv('base_link', 'world') to get the position and broadcast it following this example: https://www.theconstructsim.com/publish-position-robot-using-transformbroadcaster-python/ I don't know if it is the best option to do it, but it works in my case.
Asked by Hugo on 2020-12-29 14:38:51 UTC
@Hugo You should change the name of the dummy link to anything other than "world", if you want to attach the base_link to the world but remain movable. If the dummy link's name is world, it will stick rigidly on the gazebo.
For example:
http://gazebosim.org/tutorials/?tut=ros_urdf
< /joint>
Asked by longhongc on 2021-11-11 23:14:27 UTC
If you are meaning to localize a mobile robot I strongly suggest you take a look first at REP 105 and then take a look at a package like amcl or robot_localization.
I think you should be using the transformation tree for what you want, not joints and links. Cheers.
Asked by JackB on 2020-11-13 09:54:23 UTC
Comments
Hi @JackB, at this stage, I just want to mimic the Gazebo's robot movements in Rviz. I am not worried about localization yet.Cheers
Asked by Hugo on 2020-11-13 11:55:14 UTC
I don't think that is the intended use case of what you are doing. But I am not a modeling expert.
Asked by JackB on 2020-11-13 13:08:29 UTC
Comments