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
Get LPS Node Position via CF2.0
-
- Bitcraze
- Posts: 630
- Joined: Tue Jun 30, 2015 7:47 am
Re: Get LPS Node Position via CF2.0
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
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