Error in local positioning of Pixhawk4 using ViCON data

Hey,
not sure if this helps

I faced a similar issue a few months back ( was using a zed cam though )
initially everything worked and i was getting good data and performance for my tests. but after sometime, ekf fails and my drone crashes

after multiple crashes i noticed a pattern. my crashes occurred exactly after 81 seconds !!!
this lead me to suspect that the problem was due to the EKF diverging because of bad tuning rather than a hardware fault

i increased EKF2_AID_MASK to 300 ms and did a test flight, my problem was solved

all the best in debugging :+1:

Hello @nikhilprakash99,

Thanks for the reply.

Do you mean setting EV_DELAY to 300 ms? We use AID_MASK to select what kind of data to fuse.

Also, I have experienced that resetting of EKF2 depends on rate of data at which you are feeding the data. If you feed at lower rate it takes longer to reset. Did you realize the same thing?

Please let me know.

Regards,
Kashish Dhal

@kashishdhal
my bad, I meant EV_DEALY only.
about the rate, sorry i didnā€™t play around with the stream rate too much

Thanks @nikhilprakash99, I should try this meanwhile developers reply.

Hello @nikhilprakash99,

I tried setting it to 300 ms and then few other values but that did not help. Do you remember changing anything else apart from this? If you remember something else, please let me know. Also, are you still experimenting? If so, can you please provide me your parameters? You will need to arm and disarm to generate a log file and then upload to log.px4.io and share a link here. I will highly appreciate your help.

Also, since this happened to others as well, maybe @DevTeam should have a look on this meanwhile we hear from @TSC21.

Regards,
Kashish Dhal

@kashishdhal the log you provided is broken. There is not relevant data there. Did you look at it before sharing?

Actually it does have data but somehow the flight logger is extending is time a lot over a long period. How much time did you have the vehicle on?

Anyway, looking at the log and assuming that the vehicle was always in the same place and didnā€™t move, two things might influence this: the first is that there is an assumption that the input data has noise, so if you donā€™t move the vehicle over time, the EKF estimation will certainly diverge over time, since the data is somewhat constant. The second, which is the most probable case, is what @nikhilprakash99 reported - you have problems with your companion link, and the most obvious can even be observed in the log where you see an RTT of 539ms.
So first you need to make sure that you have a stable connection between your companion and the flight controller. Then, you will have to measure the latency of the visual data you are receiving so that you can adjust the delay parameter. Try also reducing the EKF2_EVA_NOISE and EKF2_EVP_NOISE, since you are using a mocap system.

Hello @TSC21,

I ran it for about a minute as is shown in log summary. The VICON data is certainly not noisy, did you look at the rosbag file I shared? You can also see VICON data in log file under visual odometry. I had a look and didnā€™t see any noise. Also, I have plotted position data several times for the Crazyflie which I am experimenting with these days and noise didnā€™t show up.

I can plot from rosbag this data as well if you want me to do that? But you have the rosbag file in case you would like to do it.

Also, @nikhilprakash99 said there was no problems with the hardware. The only problem was with tuning of parameters. If you are insisting on it again and again then I will change FTDI cable. I have already used two different wires but now will check with third one.

Regarding network delay, we have setup a local network using Tri-band Nighthawk wifi router which basically a Gaming router and supposed to have very low latency, high throughput (in GigaBytes per second) and there is almost no load on it (except MAVROS).

But in any case, do you have a way to measure latency? My VICON data transmission and ROS rate frequencies are 100 Hz each. Please let me know. I will do that as well. But letā€™s resolve this issue.

Regards,
Kashish Dhal

@kashishdhal I donā€™t say anywhere that the data is noisy. By the contrary, thatā€™s why I suggested to reduce the noise factor parameters.

I suggested the problem is in the link between the companion computer and the flight controller. Not the link between the VICON system and the companion computer.

Okay please tell me how to measure the delay.

I was referring to this!

Hello @TSC21,

Please confirm once more, do you want me to get a new FTDI cable? (from the reply quoted below)

If yes, then I will buy the following cable from amazon, please tell me if that is okay?

https://www.amazon.com/Serial-Adapter-Female-FT232RL-Windows/dp/B07RBK2P47/ref=sr_1_4?dchild=1&keywords=ftdi+cable+pixhawk&qid=1587668582&sr=8-4

Secondly, what do you want me to do with this? (from the reply quoted below)

Regards,
Kashish Dhal

Hello @TSC21,

Are these related?

Regards,
Kashish Dhal

Hello @TSC21,

I asked you about purchasing a new FTDI cable and you didnā€™t reply but I still went ahead and purchased a new cable.

With the new cable installed I am still getting the same problem.

Please tell me the next steps.

Regards,
Kashish Dhal

Hello @TSC21,

Still waiting for your reply?

So far, I have replaced Pixhawk, FTDI Cable, onboard computer multiple times. I guess what we are left with is either the ground station or network. Could it be a network problem? or should I think of replacing/formatting the ground station?

Itā€™s been couple of months since I am stuck here. Please help.

Regards,
Kashish Dhal

Hello @JulianOes, anyone else can help here?

Maybe @mhkabir has an idea.

1 Like

Hello @mhkabir, are you still around? please let me know if you need additional data from my end? I will be happy to provide data or if you want maybe I can make a new thread and we can continue our discussion there?