Gazebo | Ignition | Community
Ask Your Question

Physics::Joint::Position() returning incorrect values for small angles

asked 2021-04-06 03:46:55 -0500

dregel gravatar image

updated 2021-04-06 08:21:56 -0500

I am modeling an elastic ball joint (composed of two revolute joints, because I am using urdf) and have an issue, where Joint angle values reported from gazebo seem to fluctuate from negative to positive for small angles at seemingly random. I saw a similar issue mentioned here before, but without a good solution or means to debug:

The picture looks relatively similar (taken from plotjuggler, y axis is joint angle in radians, x axis is seconds). Note that I am using a joint_state_controller from gazebo_ros_pkgs to publish these values, looking at it's source it calls the newer Joint::Position method, but issue looks similar. This picture is taken after moving the platform in a direction parallel to x axis (first 17 seconds), then moving it parallel to y axis (angle at 0.1 radians) and then moving it in a few other directions.

image description

I am using these elastic joints for sensing the environment, and also need them to be accurate on small angles. What can I do to get joint accurate angles? Should I try to calculate them also from world pose of the joints, like done on the previous question?

I am able to share the project, if someone more capable is interested to take a look at why this is happening. I've already added the model to the post (it is actually urdf, but renamed to sdf, because I cannot upload an urdf). model

Also added the whole project to git, in case that is easier to look at:

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2021-04-27 04:00:24 -0500

Clément Rolinat gravatar image

updated 2021-04-27 04:10:24 -0500

hello, it looks like some sort of integration instability, did you try to reduce the integration timestep, and see if the oscillation amplitude reduces ? if it is really an integration instability, check that you use <implicitspringdamper> on every problematic joint, and try to increase the joint friction (with the damping tag, inside the dynamics tag of the joint).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-04-06 03:46:55 -0500

Seen: 141 times

Last updated: Apr 27 '21