Firstly, sorry in advanced for my convoluted description, I think it's always a sign of not understanding the subject when one find its hard to even explain the question in the right terms, hopefully someone can understand my issue.
I am tasked with creating some kind of user interface to fly a drone (semi)autonomously. As this will happen indoors, I do not have access to any GPS information, but simply frequent sensor updates as to what speed the drone is flying, expressed in North-East-Down.
speedX (float): Speed relative to the North (when drone moves to the north, speed is > 0) (in m/s)
speedY (float): Speed relative to the East (when drone moves to the east, speed is > 0) (in m/s)
speedZ (float): Speed on the z axis (when drone moves down, speed is > 0) (in m/s)
In calculating realtime values for these, I sample the sensor data at regular intervals, combining the previous values and the time between them in order to calculate the distance. (eg: distance = previousDistance + (previousSpeedX * secondsSincePreviousSensorReading). However in actually calculating the x,y position relative to my local space - what else do I need?
I originally thought I could simply plot the position based on the angle to north at take off (0,0) but it seems to me that I would actually need to know what direction north is for every subsequent sensor reading as once the drone has moved, subsequent sensor readings of x would be relative to the drone's current relation to north and not its original take off position.
In addition to NED acceleration, I also have access to the yaw,pitch,roll attitudes of the drone (in radians). I considered using the yaw but this also seems to me as if it would not be enough as it relates to the position the front of the drone is facing, whereas what I would need is the angle between the drones centre of gravity and north?
Assuming what I have thought so far is correct (not likely - I never paid much attention to trigonometry in school saldy), is there a way for me to calculate "north" at each intermediary movement of the object?
Many thanks in advance!
More info on the drone specs:
It is a parrot bebop 2, here is a fairly digestible breakdown of its physical specs: https://www.cnet.com/products/parrot-bebop-drone-2/specs/
It contains a magnetometer inside.
There are alot of different types of data received. None of it is really directly from the sensors themselves, but packaged up in "events" that I can tap into. I think the two pieces of information relevant to this are the "speed" and "attitude" event.
In particular the "yaw" attitude returns the angle between the drones "head" (where the camera is facing) and north. I considered this could be something I could use to calculate the north offset....but in the back of my mind I am thinking what I really need is the angle between the drones centre of gravity itself and north, not the front of the drone. Where I am lacking is a way to formally prove this theory or not.