Setting LH Origin Position Automatically

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
cgpenguin
Beginner
Posts: 16
Joined: Wed Aug 05, 2020 3:49 pm

Setting LH Origin Position Automatically

Post 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.
kristoffer
Bitcraze
Posts: 322
Joined: Tue Jun 30, 2015 7:47 am

Re: Setting LH Origin Position Automatically

Post 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).
Post Reply