Get LPS Node Position via CF2.0

All discussions related to the Loco Positioning system
Post Reply
HuzayfaaN
Beginner
Posts: 14
Joined: Mon Nov 26, 2018 2:20 pm

Get LPS Node Position via CF2.0

Post by HuzayfaaN »

Hi,

I am looking at getting the positioning of the nodes, via the CF2.0 and as part of a python script, and printing this information. This would help identify that the nodes are correctly assigned and have been identified prior to a script continuing to run.

I have spend much time looking around and also tried various code to try and achieve this, however I have been unsuccessful and was wondering if this could be achieved and if so how?

Many thanks,
Huzayfaa
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Get LPS Node Position via CF2.0

Post by kristoffer »

Hi!

The node positions are available through a memory mapping in the memory sub system, https://github.com/bitcraze/crazyflie-l ... em.py#L526.

Use the memory type MemoryElement.TYPE_LOCO2 and the LocoMemory2 class.
The anchor_data member is a dictionary containing mappings from anchor id ==> AnchorData2 objects.

For a (somewhat convoluted) usage example see the Loco Positioning tab in the python client.
https://github.com/bitcraze/crazyflie-c ... ab.py#L317
https://github.com/bitcraze/crazyflie-c ... ab.py#L272
https://github.com/bitcraze/crazyflie-c ... ab.py#L903
Post Reply