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 sensor support for Odometry #11

Open
BattleCh1cken opened this issue Apr 20, 2023 · 2 comments
Open

IMU sensor support for Odometry #11

BattleCh1cken opened this issue Apr 20, 2023 · 2 comments

Comments

@BattleCh1cken
Copy link

Describe the problem
Currently Okapilib only supports Odometry with 2 to 3 tracking wheels, or the integrated motor encoders. It would be nice to have support for 2 tracking wheels and an IMU for rotation.

Describe the solution you'd like
Add an additional odometry implementation that allows for two ADI or Rotational Encoders and an IMU to be passed into the withSensors method of the ChassisControllerBuilder Class.

@BattleCh1cken
Copy link
Author

After having a further look at this, the implementation wouldn't be as simple as I thought it would be. The actual Odometry implementation would be very simple. All that needs to be done for this is create another class that derives Odometry, and then add an option for it in the buildOdometry method of the ChassisControllerBuilder. The most annoying part is creating a model for the chassis that has the left or right encoders and and IMU. The SkidSteerModel inherently has a left and right right encoders, meaning any class derived from it also needs left and right encoders. I could just pass nullptr into one of the encoders, but this feels like very bad practice, but the alternative seems like a lot of work.

Once PROS 4 comes out I'll open a PR for this. If anybody has any ideas on how to fix this that would be great.

@drdeaton
Copy link

I have a rather not so great implementation of such a thing which mostly conforms to OkapiLib's API, but it required doing some things that should probably be illegal. I don't think this form of odom can realistically be implemented into Okapilib without a major overhaul of the whole library.

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