Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imu and pose fusion #1

Open
antithing opened this issue Mar 15, 2023 · 2 comments
Open

Imu and pose fusion #1

antithing opened this issue Mar 15, 2023 · 2 comments

Comments

@antithing
Copy link

Hi, thanks for making this code available.

I am looking to add imu sensor fusion to an existing tracking system output, to both smooth the data and predict a transformation when tracking is lost.

Is this code suitable for this purpose? Is there any examples that I can use to get started?

Thanks!

@ParkerBarrett959
Copy link
Owner

Hey, thanks for reaching out! I think you could use pieces of this library for sure for your specific application. My thoughts are that there are probably three main parts of the library that would potentially be of use to you:

  1. Inertial Modules - Strapdown Integration, measurement error compensation, initialization, etc.
  2. Filter Modules - Kalman Filtering to fuse multiple data sources
  3. Utility Modules - Helpful navigation functions that are easy to use and are unit tested!

How you would use it would depend on how you wanted to do the fusion (loosely-coupled vs tightly-coupled architectures for example). In terms of building the code, the library is static so the build is fairly easy. I would recommend using the CMake Fetch Content Macro. Here is an example of how I use this in another project with NavFuse which you could copy:

https://github.com/ParkerBarrett959/sensor-simulator/blob/main/sensor_simulator/CMakeLists.txt#L15-L19)

There is one tagged release version of the library you may want to specify on line 18 rather than main. The reason is that I make upgrades and changes, you do not want to lose compatability in the future. I then make sure to link the libraries like this (navigation is the NavFuse Libray):

https://github.com/ParkerBarrett959/sensor-simulator/blob/main/sensor_simulator/CMakeLists.txt#L43-L46

Finally, to use the library classes in your code, you can include the headers like this:

https://github.com/ParkerBarrett959/sensor-simulator/blob/main/sensor_simulator/include/sensor_simulator/imuSensor.hpp#L16-L19

In terms of using the actual functions, I would recommend reviewing the header files which has the inputs/outputs along with a brief description for each function. For a more practical implementation guide, You could use the sensor-simulator project I linked above as a reference for a few select functions which were used, but the most complete set of examples will be in the unit tests for the library:

https://github.com/ParkerBarrett959/NavFuse/tree/main/test

Every function in the library should have unit tests so there should be quite a few examples of how you could use them in practice. I hope this was helpful, please feel free to reach out if you have any additional questions or anything was unclear. Best of luck!

@antithing
Copy link
Author

Hi, thanks for getting back to me.

I am planning to do it like this: (I believe this is 'loosely coupled', is that right?)

input:

Position xyz, rotation xyzw (in world space) at 24 HZ
Accelerometer and gyro data at 400 Hz
Output:

Smoothed pose (in world space) when input 1 is valid, predicted pose (in world space) when input 1 is lost (and between measurements)

I don't suppose there is a pre-built example that i can just feed this data into? Or would that be too easy? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants