0
$\begingroup$

Gazebo Answers logo

Hi,

I'm trying to implement an interface to a different physics engine than the four already available in Gazebo. In my case, an axis must be specified for each part attached to the joint. For instance, in the example tutorial "Making a mobile robot" found on the Gazebo website (its a differential-based robot with two motorized wheels), I would need to specify for both revolute joints, the axis on the wheel AND the axis on the chassis.

When I look at the code for the physics interface there is this method :

Joint::SetAxis(const unsigned int _index, const math::Vector3 &_axis)

which takes the axis value from the SDF and saves it into the physics engine data structure. My understanding is that the _index parameter gives me the part this axis is related to, but I can't see how to specify that index in an SDF, if it is possible.

If someone can tell me I am on the right direction or give me a hint about how to solve this, it will be truly appreciated!

Thanks to all!


Originally posted by dbrodeur on Gazebo Answers with karma: 38 on 2017-05-01

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

The _index parameter in any method from Joint class is for specifying the coordinate ID which is an unsigned int value less than GetAngleCount(). Thus, in the case of an Hinge, GetAngleCount() returns 1 and the only possible index value is 0.

In Hinge2, , GetAngleCount() returns 2 and the only possible index value are 0 and 1.

SetAxis has only one value per angle and it applies to both parts attached. If a different engines needs to specify different values, than an sdf tag like those for , , etc. should be use to specify that particular property of the specific engine.


Originally posted by dbrodeur with karma: 38 on 2017-05-05

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.