-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Thanks for your excellent work on 'minimu9-ahrs'. I'm creating a ROS driver from it and it's basically working, especially if I use 'fuse_gyro_only()'. But when running with 'fuse_default()', the robot appears upside down (in the ROS rviz visualizer). Also, rotations of the robot about the x-axis sees changes in the z-axis (in the visualization).
ROS uses ENU, whereas minimu9-ahrs uses NED. So I tried changing the code like this (see "// JJ"):
/*
doesn't work...
we want East North Up (ENU), but existing is NED... how to convert?
*/
matrix rotation_from_compass(const vector & acceleration, const vector & magnetic_field)
{
vector up = acceleration; // JJ - removed negation
vector east = up.cross(magnetic_field); // actually it's magnetic east
vector north = east.cross(up);
east.normalize();
north.normalize();
up.normalize();
matrix r;
r.row(0) = east; // JJ - swapped these
r.row(1) = north;
r.row(2) = up;
return r;
}
Could you offer some advice about how I should change the code to support ENU?
Thanks for any hints!
Metadata
Metadata
Assignees
Labels
No labels