Changing the relative pose of a link in simulation

asked 2018-12-03 15:55:04 -0500

Tao_Gazebo gravatar image

updated 2018-12-04 09:51:58 -0500

azeey gravatar image


I'd like to write a plugin that could change the relative position of a link to its parent. For now I can get the pointer of the link and use "SetRelativePose()" or "UpdateParameters()" to change the relative position. However, right after the position shift, the link immediately shifts back to its original position. I'd like it to stay. It's kinda like the changing the geometry of the model without relaunching the simulation or respawn the entire model. But so far I haven't been able to find a way to do it. Can anyone help?

edit retag flag offensive close merge delete


Are you using ROS in your simulation?

brschettini gravatar imagebrschettini ( 2018-12-05 10:54:50 -0500 )edit

Can you try first pausing simulation, then setting the relative pose, then unpausing simulation? The physics engine might be overriding your set relative pose call.

nkoenig gravatar imagenkoenig ( 2018-12-06 10:11:10 -0500 )edit

I'm attempting to do the same thing, did you ever figure this out?

wil gravatar imagewil ( 2019-05-07 09:46:02 -0500 )edit

Has anybody got this working? I'm trying similar thing but it didn't work so I ended up here. What I'm doing is that I create a model plugin that changes pose of a link in that model. I have one target joint in that model and I want to change the pose of its child. Using Link::SetInitialRelativePose, Link::SetRelativePose, and Link::SetWorldTwist to zero doesn't work. The link does change the orientation when I started in pause, but go back on play. By stepping it slowly rotates.

Veerachart gravatar imageVeerachart ( 2021-03-18 04:39:05 -0500 )edit