I’m currently attempting to write a script in Python that will enable me to fetch IMU data (currently streaming at a rate of 2 outputs per second-- or 1 output each 0.5 seconds) from the BlueROV, and I would like to take the double integral to (albeit roughly) calculate the position, in the given discrete time interval, of the ROV. I plan on storing these values of position in a .csv file to analyze at a later time. I’m wondering what would be the most efficient method to continually retrieve IMU data and then perform the integration, and finally write this new position data to the file. I’m not quite sure as to how I should go about retrieving the data at each given time interval, and then performing the integration (over the same discrete time interval?) continuously for the duration of the ROV’s motion.
For reference, I am trying to track the position (from the on-board IMU) with the ultimate goal of identifying an error estimate (from a given command to the actual distance moved) to be later implemented in a Kalman Filter.
My apologies for any poor phrasing or description, I’m an undergrad and still pretty new to all of this, any help would be appreciated!
To test a Kalman filter you can do post-processing, right?
Take a look at our documentation on log analysis. I advise you to get this data from the dataflash log, as it usually has a higher rate. You should be able to get this data into a CSV by using mavlogdump the get the IMU messages.
Hi Willian,
Thank you for the quick reply. Yes, my goal is to gain some understanding of error accumulation (from drift, noise in IMU data, etc.) and will test the filter in post-processing (most likely through MATLAB).
I’ll whip something up using mavlogdump and see how far I can get.
Thought I might post an update here in case others come across the this thread, I managed to abstract the code for fetching IMU data, and can now produce a matrix of all the values
Now I just need to figure out how to roughly integrate over the same time interval to produce a displacement matrix, a question probably more suited for StackOverflow Thanks again for the help @williangalvani
@mseskar, I will point out that what you are trying to do will probably not work well. The imu data from the autopilot board is not suitable (precise) for dead reckoning.
@jwalser I fully agree, in fact I’m really gathering the data to prove that statement true. I want to show the noise from the IMU and resulting error accumulation is too significant to ignore/ make useful predictions from. Thank you for the link, I’ll read through it and see what I can find.
This is interesting. How did it go for you in the end? Would be interested if approximate locations could be extracted and maybe assigned to an image at a certain time.
Hi Jacob,
Is the new navigator any better at this? how accurate are the x,y,z, velocities?
The pixhawk usually shows a velocity of at least 10 cm/s even while it is sitting still or may falsely show negative values.
I don’t believe this is something we’ve tested, because it’s generally something we expect to have poor enough results to not be worth the effort, unless high position external sensors are used which we currently expect to be prohibitively expensive and/or impractical on vehicles in the size range of ours.
In case it’s of interest, I believe this is the latest relevant discussion on the software/implementation side of things.