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.
Incorrect Weld Constraint Orientation
- B.J. Fregly
- Posts: 51
- Joined: Wed Mar 12, 2008 6:55 am
Incorrect Weld Constraint Orientation
- Attachments
-
- WeldConstraintMisalignment.jpg (283.3 KiB) Viewed 1223 times
Tags:
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Incorrect Weld Constraint Orientation
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
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
- B.J. Fregly
- Posts: 51
- Joined: Wed Mar 12, 2008 6:55 am
Re: Incorrect Weld Constraint Orientation
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!
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!
- Pablo Delgado
- Posts: 24
- Joined: Tue Feb 11, 2020 3:39 pm
Re: Incorrect Weld Constraint Orientation
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:
I would really appreciate the help.
Thank you very much!
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>
Thank you very much!