Gazebo | Ignition | Community
Ask Your Question
0

"Error [Joint.cc:408] Invalid joint index [2] when trying to apply force" with Gazebo 1.3

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

Stefan Kohlbrecher gravatar image

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

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

Error [Joint.cc:408] 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
2

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

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)
    this->childLink->SetEnabled(true);
  if (this->parentLink)
    this->parentLink->SetEnabled(true);
  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
0

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

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

Comments

Ok, did the indexing change between Gazebo versions?

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

No, but the error message maybe new.

nkoenig gravatar imagenkoenig ( 2013-01-31 10:17:33 -0600 )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 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 946 times

Last updated: Feb 05 '13