Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Why does the spring joint plugin not work?

$
0
0
I followed the example [here](https://bitbucket.org/osrf/gazebo/src/19ae3a34ec8e5ce126f62da3fd6c9e59f29c73bb/test/plugins/SpringTestPlugin.cc) and created a model plugin, that at each update call this function: void SpringJointPlugin::OnUpdate() { this->current_angle = this->joint_ptr_->GetAngle(0).Radian(); this->joint_ptr_->SetForce( 0, (this->rest_angle-this->current_angle)*this->stiffness); } the `joint_ptr_` is of `physics::JointPtr` format. When I try to build this plugin, I get error SpringJointPlugin.cc:80:45: error: ‘class gazebo::physics::Joint’ has no member named ‘GetAngle’; did you mean ‘GetForce’? this->current_angle = this->joint_ptr_->GetAngle(0).Radian(); ^~~~~~~~ GetForce When I look into [the documentation](http://osrf-distributions.s3.amazonaws.com/gazebo/api/2.2.1/classgazebo_1_1physics_1_1Joint.html), this method is listed. When I use the the `GetForce` method as suggested, or any other function listed in the documentation, it still gives me errors. Why and how to fix this?

Viewing all articles
Browse latest Browse all 7017

Trending Articles