Closed adegroote closed 9 years ago
Generally speaking, the PR looks good to me (even though I can not comment on the calculations themselves).
Since MORSE is now quite capable in terms of coordinate manipulation, it would be nice to create a tutorial involving a drone that would briefly explain the different frames, how to use one or the other, etc.
I would note the tutorial idea on my long TODO list :) (I need also to export ECEF interface for GPS sensor)
I don't understand what you want to achieve with angle_against_north
, or what you mean wiht "real north".
If angle_against_north
is supposed to be the difference between geograpic north and magnetic north, then it should be called "magnetic_declination".
But then I don't see why you would take that into account in the GPS sensor.
Or do you rather mean that this is a rotation of the LTP frame wrt. "true/geographic" north?
The second. Initially, we assume (if that matter) that East is along X blender axis, and North against the blender Y axis (i.e. we identify the blender frame as the LTP frame). Nowadays, I want to be able to differentiate it, allowing to have an arbitrary rotation between the Blender Frame, and the LTP ENU frame.
My current use case is the Blender frame is based on our motion-capture frame, which is not at all aligned with East/North. But for magnemoter, or when we go out of the room, we want to use the "real North" (not the Y Axis so).
Does it clarify ?
Yes, that makes sense.... was just confused because it still says "magnetic" in a few places and the pull request title...
So the docs needs to be fixed because it still says
**angle_against_north** in degrees is the angle between magnetic north and the blender X axis
But it is not magnetic north, but geodetic/true north... important difference ;-)
The magnetometer will already give you the actual geo-magnetic field vector, so also magnetic declination and inclination.
Also it is not immediately clear which "direction" this angle_against_north
has (at least to me)...
But it is not magnetic north, but geographic north... important difference ;-)
True. I will fix that
The magnetometer will already give you the actual geo-magnetic field vector, so also magnetic declination and inclination.
Yes. Through, the magnetic field is computed on the based on the geodetic coordinates, which are derived from the ltp one (which assumed east -> x, north -> y). So, the change has an impact on what is returned by magnetometer.
Also it is not immediately clear which "direction" this angle_against_north has (at least to me)...
To be frank, I need to think twice about it each time. If it helps (and if you have a good sentence to explain it):
Yes. Through, theYes. Through, the magnetic field is computed on the based on the geodetic coordinates, which are derived from the ltp one (which assumed east -> x, north -> y). So, the change has an impact on what is returned by magnetometer. magnetic field is computed on the based on the geodetic coordinates, which are derived from the ltp one (which assumed east -> x, north -> y). So, the change has an impact on what is returned by magnetometer.
Yes, of course. Just wanted to point out that you need to specify the angle to true north and not to magnetic north. Since the magnetometer sensor uses the WMM model you will get the magnetic vector (and hence deviation) wrt to true north. Of course if you calculate north from the magnetometer it will give you magnetic north and in your code using the magnetometer you can't make the assumption that magnetic north equals true north anymore (unless you happen to be at a location where this is actually the case). Just like in the real world.
Regarding documentation, how about something like:
angle_against_north
is positive when the blender x-axis is east of true north, and negative when it is to the west.
Of course if you calculate north from the magnetometer it will give you magnetic north and in your code using the magnetometer you can't make the assumption that magnetic north equals true north anymore (unless you happen to be at a location where this is actually the case). Just like in the real world.
True. So to be rigorous, I should add the declination into to the attitude sensor to return magnetic north and not geographic north.
So to be rigorous, I should add the declination into to the attitude sensor to return magnetic north and not geographic north.
No, I don't think so. An attitude sensor does not imply it uses a magnetometer.... And a proper "AHRS" using a mag gives you heading wrt. true north since it was calibrated or knows the local magnetic field.
I have reworked my commits to take in account your remarks. It should be ok for final integration now. Please review the new version (and thanks for all feedback).
Looks OK to me.
Ok. Thanks. Just merged it.
This set to commit allow to handle a rotation between Blender frame and the LTP ENU frame (i.e. to configure the rotation between the X axis and the magnetic North). It is useful in several scenarios, where you have fixed frame, but still need some measurements against the "real" north.