Skip to content

Commit

Permalink
Fix Staubli IO
Browse files Browse the repository at this point in the history
  • Loading branch information
visose committed Nov 22, 2024
1 parent 7f85e15 commit 67a6bee
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/Robots/Commands/SetAO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ string CodeUR(RobotSystem robotSystem, Target target)

string CodeStaubli(RobotSystem robotSystem, Target target)
{
var number = GetNumber(robotSystem);
return $"aioSet(aos[{number}], {Name})";
return $"aioSet(aos[{AO}], {Name})";
}

string CodeDoosan(RobotSystem robotSystem, Target target)
Expand Down
4 changes: 1 addition & 3 deletions src/Robots/Commands/SetDO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ string CodeUR(RobotSystem robotSystem, Target target)

string CodeStaubli(RobotSystem robotSystem, Target target)
{
var number = GetNumber(robotSystem);

string textValue = Value ? "true" : "false";
return $"waitEndMove()\r\ndos[{number}] = {textValue}";
return $"waitEndMove()\r\ndos[{DO}] = {textValue}";
}

string CodeDoosan(RobotSystem robotSystem, Target target)
Expand Down
10 changes: 5 additions & 5 deletions src/Robots/PostProcessors/KRLPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public PostInstance(SystemKuka system, Program program)

for (int i = 0; i < _system.MechanicalGroups.Count; i++)
{
var groupCode = new List<List<string>>
{
MainFile(i),
DatFile(i)
};
List<List<string>> groupCode =
[
MainFile(i),
DatFile(i)
];

for (int j = 0; j < program.MultiFileIndices.Count; j++)
groupCode.Add(SrcFile(j, i));
Expand Down
8 changes: 4 additions & 4 deletions src/Robots/PostProcessors/RapidPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public PostInstance(SystemAbb system, Program program)

for (int i = 0; i < _system.MechanicalGroups.Count; i++)
{
var groupCode = new List<List<string>>
{
MainModule(i)
};
List<List<string>> groupCode =
[
MainModule(i)
];

for (int j = 0; j < program.MultiFileIndices.Count; j++)
groupCode.Add(SubModule(j, i));
Expand Down
2 changes: 1 addition & 1 deletion src/Robots/RobotSystems/CobotSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static DefaultPose GetDefaultPose(RobotArm robot)

public override double DegreeToRadian(double degree, int i, int group = 0)
{
return degree.ToRadians();
return Robot.DegreeToRadian(degree, i);
}

internal override double Payload(int group)
Expand Down
2 changes: 1 addition & 1 deletion src/Robots/TargetAttributes/Frame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Frame : TargetAttribute, IEquatable<Frame>
public int? Number { get; }
internal int CoupledPlaneIndex { get; set; }

public bool IsCoupled => (CoupledMechanicalGroup != -1);
public bool IsCoupled => CoupledMechanicalGroup != -1;

public Frame(Plane plane, int coupledMechanism = -1, int coupledMechanicalGroup = -1, string? name = null, bool useController = false, int? number = null)
: base(name)
Expand Down

0 comments on commit 67a6bee

Please sign in to comment.