Gazebo | Ignition | Community
Ask Your Question
0

How to create a joint with sensor programatically?

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

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">
    <parent>link_a</parent>
    <child>link_b</child>
    ...
    <sensor name="force_torque_a_b" type="force_torque">
        <always_on>true</always_on>
        <update_rate>1000</update_rate>
        <plugin name="breakable_a_b" filename="libBreakableJointPlugin.so">
            <breaking_force_N>1</breaking_force_N>
        </plugin>
    </sensor>
</joint>"

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
0

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

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

Question Tools

1 follower

Stats

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

Seen: 527 times

Last updated: Apr 25 '17