# How to achieve planar joint?

I need to define a joint that is moving in x-y plane but is fixed in z plane. On ROS wiki page, there is a list of joints, which says a planar type of joint can be defined, but if I run the model in Gazebo simulation, it says the type of joint is unknown.

[ WARN] [1539099575.602332867]: Converting unknown joint type of joint 'joint_planar' into a fixed joint


I have defined two link each of which I assigned a prismatic joint, one in y axis, the other in x axis. If I could somehow use one mesh for the both links, it would be sufficient, but I can't imagine how could that be possible.

I need a way how to make my mesh element move in plane in Gazebo simulation. How can I do that?

edit retag close merge delete

Sort by ยป oldest newest most voted

Hi,

I give you here two ways that you could achive a "plannar like" movement:

1) With two primsatic joints in tandem 2) With a plugin that taps into the speed of an object that moves on the plane

I leave you here with the CodeGit for each one, a Video explaining all the process and a ROSJECT with the code ready to go.

1) Two prismatic Joints:

The URDF that we spawn that has the two prismatic joints and at the end the elemnt that you want to move in the plane: ( Its a urdf but because of the platform limitations it had to have the sdf extension) plannar_mover.urdf

The launch files to spawn the URDF and the empty world:

C:\fakepath\kinetic_main.launch

C:\fakepath\spawn_with_controlers_plannar_mover.launch

C:\fakepath\spawn_robot_urdf.launch

C:\fakepath\spawn_plannar_mover.launch

C:\fakepath\plannar_mover_control.launch

C:\fakepath\plannar_mover_empty.world

The main disavantage of this method is that you have phisical elements moving, which give always problems and worst is that prismatic joints don't behave very well, they bend and do some strange stuff. Sure that if you play around with the weights and physical properties of the links you can improve the performance.

2) Create a plugin and add seting speed capabilities to any model that has this plugin:

This is in my opinion the method that works best, the only downside is that the model has to have zero friction with the ground or it has to have some kind of wheels to avoid it flipping.

This is the code for the model plugin:

C:\fakepath\plannar_mover.cpp

The world with the plugin in a box dummy model:

C:\fakepath\plannar_mover.world

And the launch file for it:

C:\fakepath\kinetic_main_v2.launch

Hope it helped ;).

more

Thank you! I appreciate your help a lot. First when I laid my eyes on the first variant I facepalmed myself. Of course that is a possible solution. Just attach one prismatic joint to another. This is genius. Sadly, due to some, I guess, gazebo bug (as you mentioned in the video the planar movement is flawed), this solution didn't work for my use case. I didn't fully explain what I want to do with the link moving in plane.

( 2018-10-11 08:13:15 -0600 )edit

In my case, I have a robot with a case that is supposed to work as a bumper. So the case encapsulates the robot and if the robot hits a wall, the case moves with respect to the robot and springs the robot back.

( 2018-10-11 08:18:18 -0600 )edit

When I tried to attach the case to two planar joints in tandem, first I thought the y_axis_link would need its collision element to interact with obstacles at sides of the robot and the collision element of the x_axis_link needs to interact with obstacles in front and at back of the robot. The x_axis_link holding the case mesh would be attached to the y_axis_link, so they won't be able to move in the y axis with respect to each other. This assumption was wrong.

( 2018-10-11 08:22:30 -0600 )edit

However, if I let the collision element of the x_axis_link to interact with all the obstacles from all direction, the case does behave like a bumper, so the goal was reached. And when I think about it, it does make sense for the links to behave this way. I just don't understand how can x_axis_link move in y direction wtr to y_axis_link if the x_axis_link is attached to the y_axis_link with the prismatic joint in the x axis. Thank you one more time!

( 2018-10-11 08:26:28 -0600 )edit