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

pros::IMU : Add relative value functions such as set_rotation(), set_heading(), reset_rotation(), reset_heading() etc. #252

Closed
AVMS1 opened this issue Sep 18, 2020 · 5 comments · Fixed by #260
Labels
feature A brand new feature

Comments

@AVMS1
Copy link

AVMS1 commented Sep 18, 2020

Expected Behavior:

set IMU sensor's rotation, yaw and heading to zero value; currently IMU retains the value from the prev reading.

Actual Behavior:

I would like to reset IMU sensor's rotation to zero prior to every turn and don't see method to reset_rotation() like robotmesh api. Are there any methods available to reset heading, rotation etc. in the IMU without actually calibrating the IMU prior to each turn or movement...

Steps to reproduce:

none

System information:

Platform: V5
PROS Kernel Version: 3.2.1

Additional Information

none

Screenshots/Output Dumps/Stack Traces

@WillXuCodes WillXuCodes added the feature A brand new feature label Sep 18, 2020
@HotelCalifornia
Copy link
Contributor

There is not currently a way to do this with the PROS API, but we should add it (cc @kunwarsahni01 / @WillXuCodes). in the meantime, you can make a class that wraps or inherits from the pros::Imu class with this functionality

@AVMS1
Copy link
Author

AVMS1 commented Sep 18, 2020

There is not currently a way to do this with the PROS API, but we should add it (cc @kunwarsahni01 / @WillXuCodes). in the meantime, you can make a class that wraps or inherits from the pros::Imu class with this functionality

Thank you!

@AVMS1
Copy link
Author

AVMS1 commented Sep 22, 2020

I may be missing something here... I have implemented pid functions to turn and move the chassis using pros:Imu. If there is no function, say to reset the rotation, how can I make two turns in autonomous code say 45 degrees and another 90 degrees? Should I 'maintain' previous rotation value and manipulate it for the next?

@WillXuCodes
Copy link
Member

I may be missing something here... I have implemented pid functions to turn and move the chassis using pros:Imu. If there is no function, say to reset the rotation, how can I make two turns in autonomous code say 45 degrees and another 90 degrees? Should I 'maintain' previous rotation value and manipulate it for the next?

You could try saving the current angle and add it to how many x degrees you want to turn in the function where you turn another x degrees.

Also, I recommend vexforum or the VTOW discord server for questions about coding advice. This github page is for discussion about bugs and features to be implemented. We thank you greatly for the idea of this feature :).

@AVMS1
Copy link
Author

AVMS1 commented Sep 22, 2020

Thank you!

@WillXuCodes WillXuCodes changed the title pros::IMU : How to reset rotation angle, yaw and heading without calibrating the IMU. There are no methods reset_rotation(), reset_heading() etc. pros::IMU : Add relative value functions such as set_rotation(), set_heading(), reset_rotation(), reset_heading() etc. Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A brand new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants