Gazebo | Ignition | Community
Ask Your Question

The SetJointPositions function is not working in Gazebo 1.2

asked 2012-11-19 18:18:51 -0500

shuai gravatar image

updated 2013-01-11 19:55:28 -0500

nkoenig gravatar image

Hi all,

I am trying to use set_model_configurations to move the joints arbitrarily in Gazebo 1.20. The problem is that when I set the configuration, the model didn't move at all! I look inside the codes of setModelCofiguration and found that the SetJointPositions function is probably not working. Did anyone notice this problem or I did something wrong? Any suggestions? Thank you!

edit retag flag offensive close merge delete


How are you calling SetJointPositions?

hsu gravatar imagehsu ( 2012-11-19 23:52:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-29 19:11:00 -0500

Gwen gravatar image

I did something similar in a c++ model plugin.

I have a private member variable of type

private: physics::JointController * j2_controller;

Which is initialized in the Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf) function as follows

// Initialize the JointController with the model pointer
    this->j2_controller = new physics::JointController(_parent);

In, for instance, the OnUpdate() function, I have code that boils down to this:

double angle(0.0);
std::string j2name("j2name");    

However, my model is dynamic--I'm not sure if this would work to animate a static model. Hope that helps.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2012-11-19 18:18:51 -0500

Seen: 593 times

Last updated: Jan 11 '13