I am trying to send data using UDP protocol from mambo mini drone to my laptop. However, I feel the data is not being properly sent. It has too much variation.
Currently, the setup that I am using is as follows:
I am trying to use Vicon to send position data to my latop using UDP. I am able to do this and it works perfectly. Please see the attached image (error.jpg). The 3 graphs on the right hand side show X,Y and Z position of drone in Vicon arena. As you can see, the error in the values is extremely small. All the dimensions are in mm.
Now, I am trying to send this data from my laptop to drone for controlling it. Firstly, I am trying to verify whether data being received by drone is correct or not. I am using UDP parrot send block to send this data to drone and on the drone side, I have a UDP receive block. Please check the attached model images.
1) Vicon_data_to_laptop-shows the blocks used to receive data from Vicon tracker software to my laptop. I am sending the position and rotation data from this to drone using UDP send.
2) udp_receive_block_on_drone=This block receives position data from host computer (my laptop) and uses for further processing. Currently, I am sending back the X coordinate to the host computer for verification. This is on the target side.
3) Error.jpg-The left image shows the X coordinate of the drone. This data is being collected by using UDP send block on the drone side and UDP receive block on my laptop. As you can see, it does not match the Vicon's x coordinate at all. There is too much error and the sign is also not matching.
The model on the drone runs at 0.005 seconds whereas the vicon data is being sent at 100 Hz (0.01 seconds)
Please could anyone explain how to solve this.