how to change uwb update rate

All discussions related to the Loco Positioning system
arix
Member
Posts: 47
Joined: Fri Sep 01, 2017 1:45 am

how to change uwb update rate

Post by arix »

hello i have made pcb according to your support , and i write the TDOA program by serial data and i use 6 anchor. i use ros publish the PoseStamped, but the rostopic hz only 10 hz can you tell me how to improve update rate . i have try change rospy.rate() but don't have any change. thank you~!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to change uwb update rate

Post by arnaud »

Hi,
You will have to be a bit more precise about your exact setup. What are you trying to achieve and how?
arix
Member
Posts: 47
Joined: Fri Sep 01, 2017 1:45 am

Re: how to change uwb update rate

Post by arix »

arnaud wrote: Tue Oct 17, 2017 9:40 am Hi,
You will have to be a bit more precise about your exact setup. What are you trying to achieve and how?
hello

1、I make 6 anchor and 1 tag
2、I use computer read 6 twr datas from tag by python serial
3、I write a tdoa program and use ros to publish
4、Then i use rostopic hz ,and the data update rate only 10hz

At present, the distance measurement results read back 10 times a second. Now I want to read at least 50 times a second.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to change uwb update rate

Post by arnaud »

If by tag you mean the lps-node-firmware in tag mode. The tag mode is currently setup to run at 10Hz: https://github.com/bitcraze/lps-node-fi ... #L241-L242. If you change this 10 into a lower value it will accelerate the ranging. Be careful though since the returned value is the event timeout so putting 0 might break the state machine. You can look at the Crazyflie firmware which is setup in a similar way and ranges at full speed: https://github.com/bitcraze/crazyflie-f ... psTwrTag.c, it returns 0 when a full ranging has completed.
arix
Member
Posts: 47
Joined: Fri Sep 01, 2017 1:45 am

Re: how to change uwb update rate

Post by arix »

arnaud wrote: Wed Oct 18, 2017 9:02 am If by tag you mean the lps-node-firmware in tag mode. The tag mode is currently setup to run at 10Hz: https://github.com/bitcraze/lps-node-fi ... #L241-L242. If you change this 10 into a lower value it will accelerate the ranging. Be careful though since the returned value is the event timeout so putting 0 might break the state machine. You can look at the Crazyflie firmware which is setup in a similar way and ranges at full speed: https://github.com/bitcraze/crazyflie-f ... psTwrTag.c, it returns 0 when a full ranging has completed.
thanks! i have solve this problem~
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to change uwb update rate

Post by arnaud »

Great! How did you solve it? Have you made your own ROS node to get the position out of the nodes measurement? Anything you would care to share? ;-)
arix
Member
Posts: 47
Joined: Fri Sep 01, 2017 1:45 am

Re: how to change uwb update rate

Post by arix »

switch(event) {
case eventPacketReceived:
rxcallback(dev);
// 10ms between rangings
return 0.1;
break;
case eventPacketSent:
txcallback(dev);
return 2
break;
case eventTimeout:
initiateRanging(dev);
//return 1;
break;
case eventReceiveFailed:
// Try again ranging in 10ms
//return 1;
break;
default:
configASSERT(false);

this i get 41 hz with 4 anchor , 35 hz with anchor

case eventPacketSent:
txcallback(dev);
return 2
break; 2 is the lowest , another such as 1 1.5 1.9 i can't get data from serial. 1.5 1.9 i see led work well .1 tag can't work .

i also read you provide https://github.com/bitcraze/crazyflie-f ... psTwrTag.c but i can't understand how it work,because some function i can't understand and i want solve it only with lps-node-firmware . how many hz work with full speed can achieve ? it can get to 50 hz with 6 anchor? can you help me?thank you!
Last edited by arix on Thu Oct 19, 2017 12:39 pm, edited 1 time in total.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to change uwb update rate

Post by arnaud »

Hi,

I have cleaned up all the duplicate messages you have posted, do you experience problems with using the forum?

Thanks for the explanation of what you have done! What kind of positioning algorithm are you using in ROS?

The algorithm in the Crazyflie is running as fast as possible. The algorithm structure in the Crazyflie and in the node is fairly similar so you should be able to port it. The main difference is that the Crazyflie algorithm is immediately starting a new ranging after the previous one has been done, if I remember well it allows to range at about 480 TWR per seconds, with 6 anchors it means about 80 update of the full system per seconds.
arix
Member
Posts: 47
Joined: Fri Sep 01, 2017 1:45 am

Re: how to change uwb update rate

Post by arix »

arnaud wrote: Mon Oct 23, 2017 12:17 pm Hi,

I have cleaned up all the duplicate messages you have posted, do you experience problems with using the forum?

Thanks for the explanation of what you have done! What kind of positioning algorithm are you using in ROS?

The algorithm in the Crazyflie is running as fast as possible. The algorithm structure in the Crazyflie and in the node is fairly similar so you should be able to port it. The main difference is that the Crazyflie algorithm is immediately starting a new ranging after the previous one has been done, if I remember well it allows to range at about 480 TWR per seconds, with 6 anchors it means about 80 update of the full system per seconds.
i use Ordinary Least Square and kalaman filter to calculate positioning.
now i have a problem about tag .
i delete all print only have distance printf and these follow printf .
printf("%02x%08x", (unsigned int)poll_tx.high8, (unsigned int)poll_tx.low32);
printf("%02x%08x", (unsigned int)poll_rx.high8, (unsigned int)poll_rx.low32);
printf("%02x%08x", (unsigned int)answer_tx.high8, (unsigned int)answer_tx.low32);
printf("%02x%08x", (unsigned int)answer_rx.high8, (unsigned int)answer_rx.low32);
printf("%02x%08x", (unsigned int)final_tx.high8, (unsigned int)final_tx.low32);
printf("%02x%08x", (unsigned int)final_rx.high8, (unsigned int)final_rx.low32);
if i also delete these printf my distance will be very inaccurate can you help me only print distance ?
distance 3: -298mm
distance 3: 2059mm
distance 3: 1454mm
distance 3: 884mm
distance 3: 1469mm
distance 3: 294mm
distance 3: -337mm
distance 3: 1454mm
distance 3: 3272mm
distance 3: 872mm
distance 3: 850mm
distance 3: 1480mm
distance 3: 872mm
distance 3: 2040mm
distance 3: -339mm
distance 3: 869mm
distance 3: 2077mm
distance 3: 1474mm
distance 3: 251mm
distance 3: 255mm
distance 3: -302mm
distance 3: 858mm
distance 3: -316mm
distance 3: 290mm
distance 3: 309mm
distance 3: 1493mm
distance 3: 2073mm
and how to use tdoa mode with node?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: how to change uwb update rate

Post by arnaud »

Do you mean that by changing the printf you get different precision? Are you sure you are printing the anchor ID correctly?

For TDoA mode, you can put the node in sniffer mode and switch the sniffer to binary (there is a python script for that). This will give you all the raw packets and they can be used to calculate TDoA. If you are interested I might have some experimental python script to calculate TDoA lying around.

What you are doing in ROS is interesting, are you planning on sharing the work at some point?
Post Reply