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

How is the correct way to attach the base link to world?

asked 2020-11-13 07:00:23 -0500

Hugo gravatar image

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__base_link' 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?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2020-11-13 08:54:23 -0500

JackB gravatar image

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.

edit flag offensive delete link more

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

Hugo gravatar image Hugo  ( 2020-11-13 10:55:14 -0500 )edit

I don't think that is the intended use case of what you are doing. But I am not a modeling expert.

JackB gravatar image JackB  ( 2020-11-13 12:08:29 -0500 )edit
0

answered 2020-11-13 07:35:33 -0500

shiraz_baig gravatar image

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

edit flag offensive delete link more

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.

Hugo gravatar image Hugo  ( 2020-11-13 08:00:27 -0500 )edit

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

shiraz_baig gravatar image shiraz_baig  ( 2020-11-13 10:23:05 -0500 )edit

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

Hugo gravatar image Hugo  ( 2020-11-13 11:00:12 -0500 )edit

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

random_enthusiast gravatar image random_enthusiast  ( 2020-12-24 17:28:03 -0500 )edit

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.

Hugo gravatar image Hugo  ( 2020-12-29 13:38:51 -0500 )edit

@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:

    
<link name="dummy"/>  
<joint name="dummy_to_base_link=" type="fixed">  
    <parent link="dummy"/>  
     <child link="base_link"/>  
< /joint>  

http://gazebosim.org/tutorials/?tut=r...

longhongc gravatar image longhongc  ( 2021-11-11 22:14:27 -0500 )edit

Question Tools

Stats

Asked: 2020-11-13 07:00:23 -0500

Seen: 4,049 times

Last updated: Nov 13 '20