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

Robot_Toolkit: Can't push load with local axis #270

Closed
JonathanNillius opened this issue Oct 24, 2019 · 0 comments · Fixed by #271
Closed

Robot_Toolkit: Can't push load with local axis #270

JonathanNillius opened this issue Oct 24, 2019 · 0 comments · Fixed by #271
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@JonathanNillius
Copy link
Contributor

Description:

In this part of the code:

public static void RobotLoad(this BarUniformlyDistributedLoad load, RobotSimpleCase sCase, RobotGroupServer rGroupServer)
{
if (load.Force.Length() == 0 && load.Moment.Length() == 0)
{
Engine.Reflection.Compute.RecordError("Zero forces and moments are not pushed to Robot");
return;
}
if (load.Force.Length() != 0)
{
IRobotLoadRecord loadRecordForce = sCase.Records.Create(IRobotLoadRecordType.I_LRT_BAR_UNIFORM);
loadRecordForce.Objects.FromText(load.CreateIdListOrGroupName(rGroupServer));
loadRecordForce.SetValue((short)IRobotBarUniformRecordValues.I_BURV_PX, load.Force.X);
loadRecordForce.SetValue((short)IRobotBarUniformRecordValues.I_BURV_PY, load.Force.Y);
loadRecordForce.SetValue((short)IRobotBarUniformRecordValues.I_BURV_PZ, load.Force.Z);
}
if (load.Moment.Length() != 0)
{
IRobotLoadRecord loadRecordMoment = sCase.Records.Create(IRobotLoadRecordType.I_LRT_BAR_MOMENT_DISTRIBUTED);
loadRecordMoment.Objects.FromText(load.CreateIdListOrGroupName(rGroupServer));
loadRecordMoment.SetValue((short)IRobotBarMomentDistributedRecordValues.I_BMDRV_MX, load.Moment.X);
loadRecordMoment.SetValue((short)IRobotBarMomentDistributedRecordValues.I_BMDRV_MY, load.Moment.Y);
loadRecordMoment.SetValue((short)IRobotBarMomentDistributedRecordValues.I_BMDRV_MZ, load.Moment.Z);
}
}

there is no part allowing for custom set axis, thus it picks the global axis.

This part allows for a custom set axis:

if (load.Axis == LoadAxis.Local)
loadRecord.SetValue((short)IRobotUniformRecordValues.I_URV_LOCAL_SYSTEM, 1);
if(load.Projected)
loadRecord.SetValue((short)IRobotUniformRecordValues.I_URV_PROJECTED, 1);

If you just take that code that allows for it and pastes it into the if statements it works.

How to replicate:

Push a load with local axis specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant