Skip to content

Commit bd0eefc

Browse files
committed
Work in radian.
1 parent 9bd28dd commit bd0eefc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Packages/ReachySimulator/Scripts/JointServiceServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ public override async Task<FullBodyCartesianCommandAck> StreamFullBodyCartesianC
451451

452452
private float ChangeAngleRange(float orbita_angle)
453453
{
454-
float modified_angle = orbita_angle % (Mathf.Deg2Rad*360);
455-
modified_angle = modified_angle > (Mathf.Deg2Rad*180) ? modified_angle - (Mathf.Deg2Rad*360) : modified_angle;
454+
float modified_angle = orbita_angle % (2.0f * (float)Math.PI);
455+
modified_angle = modified_angle > (float)Math.PI ? modified_angle - (2.0f * (float)Math.PI) : modified_angle;
456456
return modified_angle;
457457
}
458458
}

0 commit comments

Comments
 (0)