Page 1 of 1

Setting LH Origin Position Automatically

Posted: Fri Aug 07, 2020 5:17 pm
by cgpenguin
Hey,
The current method to configure origin position in a LH setup space using a drone is to run a python script that communicates to drone via radio and either just returns base station coordinates that can be written into firmware, or by using --write argument the origin can be temporarily stored in drone's memory.
However, my goal is to have the drone function autonomously (without the need to communicate with the computer apart from simple tasks such as giving the drone instruction to start doing it's task). In order to achieve this I'd like the drone to be able to calculate it's origin position and store it temporarily (similarly to how --write on the Python script does it) upon it being turned on by itself (no communication with a computer). Is such a thing possible and what would be the best way to approach this?

So to put things shortly - I want the drone to use it's current position as origin point and store that temporarily (until it's turned off) the moment it gets turned on and is ready to use LH deck sensors.

Re: Setting LH Origin Position Automatically

Posted: Mon Aug 10, 2020 11:58 am
by kristoffer
The script that calculates the basestation geometry is based on the opencv function solvePnP (https://docs.opencv.org/2.4/modules/cal ... ction.html).

I don't know much about the implementation or the resource requirements for that function, but assuming that it does not require a lot of memory, I don't see why it could not be implemented in the Crazyflie. It will probably take a bit longer to do the calculations, but that is hopefully not a problem as you have to wait for the calibration data to arrive anyway to get a reasonable result.

If you implement this, please consider sharing it in a pull request. I think it would be a nice function (provided it is fast enough).