Home | Tutorials | Wiki | Issues
Ask Your Question

How to create a joint with sensor programatically?

asked 2017-04-20 07:23:13 -0500

lubiluk gravatar image

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="libBreakableJointPlugin.so">

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-25 03:10:37 -0500

AndreiHaidu gravatar image

Hi there,

you could use the logic from Gripper.cc to create dynamically soft breakable joints. See fixedJoint as example.

Cheers, Andrei

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-04-20 07:23:13 -0500

Seen: 19 times

Last updated: 2 days ago