Skip to content

Commit

Permalink
Update for ARINC 705 format for interpolated platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoesmp committed May 31, 2024
1 parent 937ac2f commit fd2fb38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/maths/Directions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

// *** CONSTANTS *** //
// ******************* //
// Canonical basis
const glm::dvec3 Directions::right = glm::dvec3(1, 0, 0);
const glm::dvec3 Directions::forward = glm::dvec3(0, 1, 0);
const glm::dvec3 Directions::up = glm::dvec3(0, 0, 1);

// ARINC 705 norm
const glm::dvec3 Directions::yaw = glm::dvec3(0, 0, -1);
const glm::dvec3 Directions::roll = glm::dvec3(0, 1, 0);
const glm::dvec3 Directions::pitch = glm::dvec3(1, 0, 0);
10 changes: 5 additions & 5 deletions src/platform/InterpolatedMovingPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ InterpolatedMovingPlatform::InterpolatedMovingPlatform(
break;
case RotationSpec::ARINC_705:
calcAttitude = [] (arma::Col<double> const x) -> Rotation {
return Rotation(Directions::yaw, x[2]).applyTo(
Rotation(Directions::roll, x[0])
return Rotation(Directions::right, x[1]).applyTo(
Rotation(Directions::forward, x[0])
).applyTo(
Rotation(Directions::pitch, x[1])
Rotation(Directions::up, -x[2])
);
};
_getRollPitchYaw = [] (
double &roll, double &pitch, double &yaw, Rotation &attitude
) -> void {
attitude.getAngles(&RotationOrder::ZYX, yaw, pitch, roll);
yaw = (yaw < M_PI) ? -yaw : PI_2 - yaw;
attitude.getAngles(&RotationOrder::XYZ, pitch, roll, yaw);
yaw = -yaw;
};
break;
default:
Expand Down

0 comments on commit fd2fb38

Please sign in to comment.