Incorrect Weld Constraint Orientation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
B.J. Fregly
Posts: 51
Joined: Wed Mar 12, 2008 6:55 am

Incorrect Weld Constraint Orientation

Post by B.J. Fregly » Mon Mar 08, 2021 11:04 pm

I am trying to weld the hand of an arm model to the hand rest of a robot model, but the weld constraint keeps welding the two bodies together with incorrect relative orientation.

To explore the issue, I created a box body that I connected to ground with a 6 DOF custom joint. I then welded the box to the hand rest with the orientations for both PhysicalOffsetFrames in the WeldConstraint set to <orientation>0 0 0</orientation>. I expected the corresponding x, y, and z axes of the box and hand rest to all point in the same directions.

As shown in the attached picture, the y axes of the box and handset point upward as they should, but the x and z axes of the two bodies point in opposite directions.

Am I wrong to expect that the corresponding x, y, and z axes of the box and hand rest should point in the same directions? And if not, could the fact that the hand rest is part of a closed kinematic chain be the source of the problem?

B.J.
Attachments
WeldConstraintMisalignment.jpg
WeldConstraintMisalignment.jpg (283.3 KiB) Viewed 1213 times

Tags:

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: Incorrect Weld Constraint Orientation

Post by Ayman Habib » Tue Mar 09, 2021 10:32 am

Hi BJ,

Generally, you could see if there's an issue with a constraint by disabling it and observing how the model assembles.

Keeping in mind that a PhysicalOffsetFrame is relative to some base Frame, I'd suggest you create two PhysicalOffsetFrames one on each body, make it visible in the GUI, then adjust the parameters (translation/rotation) to make sure it point in the right orientation. After the two frames look visually aligned or close enough, then you can add the constraint.

At the end of the day the assembly process performs an optimization and it's possible it gets stuck in a local minimum where the angles are 180 degrees off but if we make it easier for the optimization by getting it started close to a solution then it has a better chance to succeed.

Please let me know if that works or if you run into issues following this approach.

All the best,
-Ayman

User avatar
B.J. Fregly
Posts: 51
Joined: Wed Mar 12, 2008 6:55 am

Re: Incorrect Weld Constraint Orientation

Post by B.J. Fregly » Wed Mar 10, 2021 10:31 pm

Thanks Dr. Habib. You were 100% correct.

When I gave the second body close to the correct orientation as its initial orientation, then the weld constraint assembled the bodies exactly as it should have.

I appreciate the fast and extremely helpful response!

User avatar
Pablo Delgado
Posts: 24
Joined: Tue Feb 11, 2020 3:39 pm

Re: Incorrect Weld Constraint Orientation

Post by Pablo Delgado » Wed Feb 23, 2022 1:59 pm

Hello,

I am running into the same problem as BJ. It has been explained that I would need to add a PhysicalOffsetFrame on each body. I would like to know if you can share a sample code how to define those extra frames and then, how to reference them into the Welded Constraint parameter:

Code: Select all

        
        <WeldConstraint name="weld">
            <isEnforced>true</isEnforced>
            <socket_frame1> /bodyset/foot_r </socket_frame1>
            <socket_frame2> /ground </socket_frame2>
        </WeldConstraint>
 
I would really appreciate the help.

Thank you very much!

POST REPLY