LPS client not same as in the documentation

All discussions related to the Loco Positioning system
Post Reply
Yoyasp
Beginner
Posts: 19
Joined: Mon Jan 14, 2019 2:41 am

LPS client not same as in the documentation

Post by Yoyasp »

Dear fellow programmers,

I recently obtainted a couple of CF's with lps decks, a PA antenna and 4 lps nodes. I had a great time flying the drones around with a controller, but now i am looking into flying autonomously with the locopositioning system. However: When i launch the client from the Bitcraze VM the lps tab doenst look the same as any image i can find online. i have attached a screenshot so you know what im looking at.
Knipsel.PNG
When trying to update the anchor positions i get the following endless stream of PyQT errors in my console:
Knipsel2.PNG
AttributeError: 'Nonetype' object has no attribute 'parentItem'.

I have confirmed that my nodes are working as putting them in tag mode yields an accurate distance reading.

I have also tried to manually code a script that updates the nodes position using a cf as a bridge with the lps example. I do not get any errors running the code, but when i look at the TOC of the CF all the anchor positions are still at 0.
Following code is running in a thread after the connection callback is called.

Code: Select all

anchors_pos = [	(0,0,0),
		(2,0,2),
		(0,2,2),
		(2,2,0)
		]

anchors = LoPoAnchor(self._cf)
print('setting positions')
for retry in range(10):
	for anchor_id, pos in enumerate(anchors_pos):
		anchors.set_position(anchor_id, pos)
		anchors.set_mode(anchor_id, anchors.MODE_TWR)
		time.sleep(0.1)
self._cf.close_link()
Am i missing something obvious here?
Note that i only have 4 Nodes, i figured this shouldn't be an issue as only 4 nodes are needed for the algorithm (Or so i thought i read somewhere.), but 6 is recommended in the setup page.
Yoyasp
Beginner
Posts: 19
Joined: Mon Jan 14, 2019 2:41 am

Re: LPS client not same as in the documentation

Post by Yoyasp »

I've found this thread that explains a solution for my UI fix: viewtopic.php?f=5&t=2812#p14010

Turns out i have been using the old VM that still had a git bug.
Yoyasp
Beginner
Posts: 19
Joined: Mon Jan 14, 2019 2:41 am

Re: LPS client not same as in the documentation

Post by Yoyasp »

Everything is updated now! :D

However, i stil have an issue where i cannot see my anchors in the client.
Knipsel3.PNG
Does anyone have an idea what the issue could be?
Yoyasp
Beginner
Posts: 19
Joined: Mon Jan 14, 2019 2:41 am

Re: LPS client not same as in the documentation

Post by Yoyasp »

Turns out that the "default" radio mode (bitrate and preamble) are not the modes that get flashed onto the nodes.
After setting these to default i got accurate localisation!
Post Reply