Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to create a joint with sensor programatically?

I'm trying to create a joint from a plugin code that would look as follows:

<joint name="joint_a_b" type="revolute">
    <sensor name="force_torque_a_b" type="force_torque">
        <plugin name="breakable_a_b" filename="">

I was able to create the joint using physicsEngine->CreateJoint() and setting it's properties directly on the Joint object. However, I can't figure out how to attach a sensor to it. A sensor that uses a plugin. I tried to create the whole thing by creating an SDF object with the above XML and passing it to Joint::Load() method. But because that XML is not a full world or model description it get's rejected.

I also tried to make some sense out of sensors::create_sensor but I got stuck on the same problem with XML.