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">
<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.