Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding switch statements to incorporate FixedPositive and FixedNegative Constraint6DOF #549

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Nazeefa710
Copy link

@Nazeefa710 Nazeefa710 commented Aug 2, 2024

Issues addressed by this PR

Closes #530

Test files

https://burohappold.sharepoint.com/:f:/s/BHoM/EvWSc5Jc0PtFvwM7upa8hRAB65IoKfVBQrjlRdRF3ucbtg?e=FMujFI

Changelog

  • Added support for FixedNegative and FixedPositive Constraint6DOF.

Additional comments

@Nazeefa710 Nazeefa710 added good first issue Good for newcomers type:feature New capability or enhancement labels Aug 2, 2024
@Nazeefa710 Nazeefa710 added this to the BHoM 7.3 β MVP milestone Aug 2, 2024
@Nazeefa710 Nazeefa710 self-assigned this Aug 2, 2024
Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start @Nazeefa710! Some suggestions below.

We should also make sure we can Pull back to the supports correctly.

Comment on lines 36 to 45
//if (constraint.TranslationZ == DOFType.Fixed)
// suppData.UZ = 1;
//else if (constraint.TranslationZ == DOFType.FixedPositive)
// suppData.SetOneDir(IRobotNodeSupportFixingDirection.I_NSFD_UZ, IRobotNodeSupportOneDirectionFixingType.I_NSODFT_PLUS);
//else if (constraint.TranslationZ == DOFType.FixedNegative)
// suppData.SetOneDir(IRobotNodeSupportFixingDirection.I_NSFD_UZ, IRobotNodeSupportOneDirectionFixingType.I_NSODFT_MINUS);
//else
// suppData.UZ = 0;


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//if (constraint.TranslationZ == DOFType.Fixed)
// suppData.UZ = 1;
//else if (constraint.TranslationZ == DOFType.FixedPositive)
// suppData.SetOneDir(IRobotNodeSupportFixingDirection.I_NSFD_UZ, IRobotNodeSupportOneDirectionFixingType.I_NSODFT_PLUS);
//else if (constraint.TranslationZ == DOFType.FixedNegative)
// suppData.SetOneDir(IRobotNodeSupportFixingDirection.I_NSFD_UZ, IRobotNodeSupportOneDirectionFixingType.I_NSODFT_MINUS);
//else
// suppData.UZ = 0;

Remove commented code,

Comment on lines 94 to 107
//suppData.UX = constraint.TranslationX == DOFType.Fixed ? 1 : 0;
//suppData.UY = constraint.TranslationY == DOFType.Fixed ? 1 : 0;
//suppData.UZ = constraint.TranslationZ == DOFType.Fixed ? 1 : 0;
//suppData.RX = constraint.RotationX == DOFType.Fixed ? 1 : 0;
//suppData.RY = constraint.RotationY == DOFType.Fixed ? 1 : 0;
//suppData.RZ = constraint.RotationZ == DOFType.Fixed ? 1 : 0;


//suppData.KX = constraint.TranslationalStiffnessX;
//suppData.KY = constraint.TranslationalStiffnessY;
//suppData.KZ = constraint.TranslationalStiffnessZ;
//suppData.HX = constraint.RotationalStiffnessX;
//suppData.HY = constraint.RotationalStiffnessY;
//suppData.HZ = constraint.RotationalStiffnessZ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//suppData.UX = constraint.TranslationX == DOFType.Fixed ? 1 : 0;
//suppData.UY = constraint.TranslationY == DOFType.Fixed ? 1 : 0;
//suppData.UZ = constraint.TranslationZ == DOFType.Fixed ? 1 : 0;
//suppData.RX = constraint.RotationX == DOFType.Fixed ? 1 : 0;
//suppData.RY = constraint.RotationY == DOFType.Fixed ? 1 : 0;
//suppData.RZ = constraint.RotationZ == DOFType.Fixed ? 1 : 0;
//suppData.KX = constraint.TranslationalStiffnessX;
//suppData.KY = constraint.TranslationalStiffnessY;
//suppData.KZ = constraint.TranslationalStiffnessZ;
//suppData.HX = constraint.RotationalStiffnessX;
//suppData.HY = constraint.RotationalStiffnessY;
//suppData.HZ = constraint.RotationalStiffnessZ;

Remove commented code,

break;
}

switch (constraint.TranslationX)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
switch (constraint.TranslationX)
switch (constraint.TranslationX)

Can these be in order of X,Y and Z. We also need to add the rotations.

@MayaAroraJonsson
Copy link

MayaAroraJonsson commented Aug 8, 2024

Tested using test script (530 test script).
Translations: Fixed, Free, FixedPositive, FixedNegative give expected results. Other DOF-types are pushed as Free
Rotations: All DOF types are pushed as Fixed
TranslationStiffness and RotationsStiffness values are not pushed.

…ode and put translations in order of x, y, z.
@MayaAroraJonsson
Copy link

MayaAroraJonsson commented Aug 12, 2024

Tested 12/08/24 using test script
DOF Types Free, Fixed, FixedPositive and FixedNegative return expected results for both translations and rotations (with correction of RZ, see above). All other DOF-types are pushed as Free. Stiffness not pushed.

switch (constraint.RotationZ)
{
case DOFType.Fixed:
suppData.UZ = 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
suppData.UZ = 1;
suppData.RZ = 1;

@peterjamesnugent peterjamesnugent added the status:do-not-merge For instance, test PR, for discussion, or dependant PRs not ready for merge label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers status:do-not-merge For instance, test PR, for discussion, or dependant PRs not ready for merge type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOFType: FixedPositive/FixedNegative for Translation in Constrain6DOF Not Working
3 participants