Gazebo | Ignition | Community
Ask Your Question

set the position of a robot while joint/SetAngle is used

asked 2015-08-11 10:46:09 -0600

scarlett gravatar image

updated 2015-08-12 02:50:35 -0600

Hi! I am working on a real and a simulated robot to compare the real sensors to the "perfect" ones in gazebo. I have a system to detect the position of the real robot, and I am able to position the simulated robot in a simulated room, by publishing in the topic /gazebo/setmodelstate. This is working fine. I also need the simulated robot to mimic the position of the joints of the robot. I created a plugin that uses

this->model->GetJoint(vecteur_str[i])->SetAngle(0, angle);

This is also working fine, but if I use both programs together, a strange behavior happens:

image description

The robot on the right is the one that is positionned by my tracking program and with the plugin working, and the left one is the robot with just the plugin working. I made the robot look up for the screenshot, the left one is good whereas the head of the second one comes off the rest of the body as if the rotation of the joint was from another origin. If anyone has an idea of why I get this behaviour? I also would like to set the position of the model from my plugin ( because maybe it could solve the problem if there is just one pg to set the model) but I can't find a relevant function in the API.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-12 09:52:33 -0600

scarlett gravatar image

I managed to solve my problem, I used

gazebo::math::Pose mapose(this->vect3_pose_model, this->rot_pose_model);

to set the position of my model from my plugin and now it is good.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2015-08-11 10:46:09 -0600

Seen: 724 times

Last updated: Aug 12 '15