Gazebo | Ignition | Community
Ask Your Question

"Error [] Invalid joint index [2] when trying to apply force" with Gazebo 1.3

asked 2013-01-31 09:03:53 -0500

Stefan Kohlbrecher gravatar image

updated 2013-01-31 09:04:14 -0500

When spawning a URDF model using some custom controller plugins I get

Error [] Invalid joint index [2] when trying to apply force

spammed to the terminal when I spawn it using Gazebo 1.3 in Groovy (using .debs from the shadow-fixed repo). The controller plugins worked fine with fuerte before. Before I try delving deep into the differences between Gazebo plugin interfaces: Has anyone else encountered this and can provide some hints on where to look first? The model otherwise appears to work (sensor data streaming for example).

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-02-05 14:05:31 -0500

hsu gravatar image

In older version of gazebo (1.0.x) that was in fuerte, index was ignored inside of ODEHingeJoint::SetForce):

void ODEHingeJoint::SetForce(int /*index*/, double _torque)
  if (this->childLink)
  if (this->parentLink)
  dJointAddHingeTorque(this->jointId, _torque);

In latest groovy, ODEHigneJoint::SetForce was fixed to use the index correctly, thus exposing the bug you are seeing.

edit flag offensive delete link more

answered 2013-01-31 09:27:59 -0500

nkoenig gravatar image

I think the error message should read "...when trying to get force". I've fixed the message.

The error means that someone is trying to get the force on a joint with an invalid index. The relevant function call is Joint::GetForce(int), and a valid index is 0 or 1 where 0 is the first axis of the joint and 1 is the second axis.

So, I would look in a plugin that is calling GetForce with a value of 2.

edit flag offensive delete link more


Ok, did the indexing change between Gazebo versions?

Stefan Kohlbrecher gravatar imageStefan Kohlbrecher ( 2013-01-31 10:09:55 -0500 )edit

No, but the error message maybe new.

nkoenig gravatar imagenkoenig ( 2013-01-31 10:17:33 -0500 )edit

Stuff that worked previously doesn't work anymore though, so my guess is the error message and the vehicle not moving have a common cause. Will update later if I find the time to look into it in more detail.

Stefan Kohlbrecher gravatar imageStefan Kohlbrecher ( 2013-01-31 11:02:22 -0500 )edit

The error message vanished after updating our controller plugins to use 0 as joint index all the time instead of 0,1,2 for the x,y,z axis. Was there a change in the semantics of the index or why did the plugins work with previous versions of Gazebo (e.g. 1.0.2 in fuerte)?

Johannes Meyer gravatar imageJohannes Meyer ( 2013-02-02 13:52:55 -0500 )edit

Question Tools


Asked: 2013-01-31 09:03:53 -0500

Seen: 915 times

Last updated: Feb 05 '13