Skip to content

Commit

Permalink
Revert change from negating angle
Browse files Browse the repository at this point in the history
  • Loading branch information
aeshub committed Jun 9, 2023
1 parent b2b2aa5 commit ef27555
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 2 additions & 5 deletions backend/api.test/Database/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ public void AssertCoordinateConversion()
predefinedOrientation
);

var flotillaPose = new Pose(
echoPose.Position,
echoPose.Orientation.Angle
);
var flotillaPose = new Pose(echoPose.Position, echoPose.Orientation.Angle);
Assert.Equal(predefinedOrientation, flotillaPose.Orientation);
}

Expand All @@ -67,7 +64,7 @@ private static AxisAngle ConvertOrientation(Orientation orientation)
if (orientation.Z >= 0)
angle = 2 * MathF.Acos(qw);

return new AxisAngle(new EchoVector(0, 0, 1), -angle);
return new AxisAngle(new EchoVector(0, 0, 1), angle);
}

public class AxisAngle
Expand Down
5 changes: 2 additions & 3 deletions backend/api/Database/Models/Pose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class Pose
[Required]
public Orientation Orientation { get; set; }

// Since this is a ground robot the only quaternion vector
// Since this is a ground robot the only quaternion vector
// that makes sense is up (0, 0, 1)
public Orientation AxisAngleToQuaternion(float angle)
{
Expand Down Expand Up @@ -127,9 +127,8 @@ float w

public Pose(EchoVector enuPosition, float angle)
{
float clockAngle = -angle;
Position = new Position(enuPosition.East, enuPosition.North, enuPosition.Up);
Orientation = AxisAngleToQuaternion(clockAngle);
Orientation = AxisAngleToQuaternion(angle);
}

public Pose(Position position, Orientation orientation)
Expand Down

0 comments on commit ef27555

Please sign in to comment.