Skip to content

Commit

Permalink
Fix attitude error calculation in sim
Browse files Browse the repository at this point in the history
  • Loading branch information
okalachev committed Dec 4, 2023
1 parent 1c28b07 commit 21f6536
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gazebo/flix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ class ModelFlix : public ModelPlugin

// calculate attitude estimation error

float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, -1)), Vector(0, 0, -1));
Quaternion groundtruthAttitude(estimateModel->WorldPose().Rot().W(), estimateModel->WorldPose().Rot().X(), -estimateModel->WorldPose().Rot().Y(), -estimateModel->WorldPose().Rot().Z());
float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, -1)), groundtruthAttitude.rotate(Vector(0, 0, -1)));
if (angle < 0.3) {
//gzwarn << "att err: " << angle << endl;
// TODO: warning
Expand Down

0 comments on commit 21f6536

Please sign in to comment.