Evan Drumwright
Evan Drumwright

Reputation: 21

Changing weld joint pose

I've constructed an MBP with two objects, A (welded to world) and B (unwelded). B sits on top of A. After simulating for a while, I'd like to remove A (or otherwise disable contact) to allow B to begin falling.

It seems I should be able to do this by either (1) changing collision filtering on the fly or by (2) changing the pose of the weld joint. Haven't investigated (1), but (2) seems to be out- there does not appear to be a way to alter the pose of a weld after construction. True? If true, why not?

Upvotes: 2

Views: 106

Answers (3)

joemasterjohn
joemasterjohn

Reputation: 143

Currently you can achieve this by making one of the frames of the weld joint a FixedOffsetFrame and modifying the parameters of that. Here's a snippet with an example:

// Weld body B to body A and move body B.

// Original transform for the weld between body_A and body_B
math::RigidTransform<double> X_AB(...);

const FixedOffsetFrame<double>& frame_on_A = plant->AddFrame(
    std::make_unique<FixedOffsetFrame<double>>(body_A.body_frame(), X_AB));

plant->WeldFrames(frame_on_A, body_B.body_frame());

// ... create a context and simulate ...

// New transform for the weld between body_A and body_B
math::RigidTransform<double> X_AB_new(...)

frame_on_A.SetPoseInBodyFrame(context, X_AB_new);

I'll work on #13520 to make this more convenient by changing a parameter on the weld joint itself.

Upvotes: 1

Mitiguy
Mitiguy

Reputation: 191

Perhaps consider using the LinearBushingRollPitchYaw and change the translational and rotational stiffness/damping from stiff values to 0.

For how to pick values to emulate a weld: https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_linear_bushing_roll_pitch_yaw.html#Basic_bushing_torque_stiffness_and_damping

Joe Masterjohn may know if there is a way to example of how to parameterize the bushing.

Upvotes: 0

Alejandro
Alejandro

Reputation: 1099

We do not have the capability to modify a weld joint pose yet. See issue #13520.

Upvotes: 0

Related Questions