-
Notifications
You must be signed in to change notification settings - Fork 78
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
✨ Add Zeroing and Position Setting Functions for the IMU #260
Conversation
values respectively for the cpp api only.
setter functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of other thoughts :
This is moving away from the long held tradition of having the cpp object being a view over a singleton kernel side. I don't disagree with this, but you'll have to make sure the docs are clear on this.
A complicated topic here is thread safety. Pretty much everything is in pros, and these really should follow. While practically they aren't not thread safe, they're in the realm of technically not and should be wrapped in the mutex. It'll be a bit of work, since imu_get_* takes (what I think is) a non-recursive mutex.
I'm very aware of this, and I made the decision to make this feature cpp only as making the zeroing feature available in the C api would create breaking changes (since I'd have to create some sort of typedef for a new IMU object. (Unless you have other ideas for this). |
Going to get on making these thread safe and fixing other requested changes. |
Yes, when this feature was initially discussed we acknowledged and expected that it would be provided in the C++ API only. As will says, it would be nontrivial to add to the C API and doing so would frankly offer little benefit for the majority of our users |
I don't mean to throw the direction of this PR totally off course, but it should be feasible to implement this in the C API first. There is a 128 byte padding adding to the device struct for each of the 21 smart devices that can be used for holding internal state. The motors use this for saving their PID constants and the ADI uses this for storing a variety of state about the connected sensors. The state that is being added to the C++ class for this functionality could be stored instead in the registry padding. This solution is not nearly as easy or clean as storing state in the C++ class but would have the benefits of sticking to the singleton convention that Nathan mentioned and maintaining feature parity with the C API. It sounds as though the vast majority of competitors have switched to using C++ though, so I'm not sure how important maintaining the C-first API design is anymore. Wanted to clarify that it is possible though. |
reset function to calibrate, and started work on thread safe reset functions.
I don't think it's right to introduce a concept such as "raw values". From an outside perspective, there's the angle the imu reports, and that's it. The offset that we keep is an implementation detail. Beside, get_header and such were originally implemented to be a simpler get_euler. |
…to involve offsets. (TO BE TESTED, no V5 on hand).
there's also compilation errors you're going to need to resolve here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor style things but other than those this looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]>
* Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: Will Xu <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]>
* Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * 🔖 Release 3.4.0 (#279) (#283) * Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: Will Xu <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> * ⬆️ upgrade VEXos to 1.0.13 (#289) * Add rotation data rate function (#290) * ✨ Allow user code to query registry status (#282) * Move registry_get_bound_type and registry_get_plugged_type to apix.h * Fix docs for registry functions to reflect their zero-indexed port number * 🚸 add pros::IMU alias (#293) * Create alias for Imu in IMU.h and IMU.hpp * Revert version changes * Fix version number and add typdef to pros namespace * Revert typdef location to inside class * Move alias statement, remove c implementation Move the alias statement in imu.hpp outside of IMU class. Remove c implementation of alias. Resolves #288 * Add newline in version * Fix indent of alias * 🔥 Deprecate PID setting functions (#294) * Keep functionality along with deprecation tags * Add message to deprecation warning * Deprecate other functions related to pid setting * ✨Added Delay to IMU Reset (#286) * added delay to IMU reset * variable delay * change comments * ✨Add Simplified Screen API Option (#299) ✨Add Simplified Screen API Option (#299) Co-authored-by: Ayush Shukla <[email protected]> * 🔖 Release 3.5.0 Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: AyushShukla3 <[email protected]> Co-authored-by: Eric Dong <[email protected]>
* 🔖 Release 3.4.0 (#279) * Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> * 🔖 Release 3.5.0: Quality Post Event Update (#300) * Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * 🔖 Release 3.4.0 (#279) (#283) * Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: Will Xu <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> * ⬆️ upgrade VEXos to 1.0.13 (#289) * Add rotation data rate function (#290) * ✨ Allow user code to query registry status (#282) * Move registry_get_bound_type and registry_get_plugged_type to apix.h * Fix docs for registry functions to reflect their zero-indexed port number * 🚸 add pros::IMU alias (#293) * Create alias for Imu in IMU.h and IMU.hpp * Revert version changes * Fix version number and add typdef to pros namespace * Revert typdef location to inside class * Move alias statement, remove c implementation Move the alias statement in imu.hpp outside of IMU class. Remove c implementation of alias. Resolves #288 * Add newline in version * Fix indent of alias * 🔥 Deprecate PID setting functions (#294) * Keep functionality along with deprecation tags * Add message to deprecation warning * Deprecate other functions related to pid setting * ✨Added Delay to IMU Reset (#286) * added delay to IMU reset * variable delay * change comments * ✨Add Simplified Screen API Option (#299) ✨Add Simplified Screen API Option (#299) Co-authored-by: Ayush Shukla <[email protected]> * 🔖 Release 3.5.0 Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: AyushShukla3 <[email protected]> Co-authored-by: Eric Dong <[email protected]> * Changed IMU port claim to rotation port claim Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: AyushShukla3 <[email protected]> Co-authored-by: Eric Dong <[email protected]>
* Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]>
* Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * 🔖 Release 3.4.0 (#279) (#283) * Clarify rotation_get_angle API (#264) * Fixed all instances of the liscense being outdated in file headers. (#272) * 👽 Add missing filesystem syscalls (#275) * Add missing file system stubs * Update src/system/dev/file_system_stubs.c Co-authored-by: nathan-moore <[email protected]> * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore <[email protected]> * ✨ Add Zeroing and Position Setting Functions for the IMU (#260) * Started on getter, setter, and zeroing features for IMU offset and read values respectively for the cpp api only. * Added comments to header files for all new functions and finished up setter functions. * Fixed documentation and removed extraneous ::IMU * version fix * Version Fix (anotha one) * Update version * Update version * Update version * Changed IMU offsets to initializer list * Reordered initializer list * Fixed a few file headers, changed CPP back to previous state, renamed reset function to calibrate, and started work on thread safe reset functions. * Added working C functions for resetting rotation and header. * C api for yaw, pitch, and roll reset working. * Added a new imu_reset function that resets all values from the IMU. * Added resets for CPP api (not tested yet) * Fixed build issue * Properly fixed the issue now. * Added setter functions for value readings, reworked reset functions accordingly. * Added missing semicolon, finished testing C API. * Added CPP api for setting values. * Added documentation for reset and set value functions. * Added imubl (IMU Backend Layer) for non-threadsafe functions, and also added documentation for those functions. Made get_euler thread safe again with a new seperate function for non-threadsafe use. * Added untracked file (IMUBL) * Fixed up all other debugging * Changed imubl location to VDML to hide it from users. * Changed imubl header description * Reverted version and drive code. * Added newlines back to the end of files * Updated Header Liscense Years * Revert "Updated Header Liscense Years" This reverts commit 36074f0. * Packed the enum for imu reset data, fixed formatting and newline at end of imu.hpp. * Revert accidental change to get_accel docs. * Removed imubl and fixed packed attribute * Changed mentions of reset back to tare, and changed calibrate back to tare. * Revert drive code * Revert version * Revert version properly * Update include/pros/imu.hpp Co-authored-by: nathan-moore <[email protected]> * Combined the declarations and definitions for device pointers. * Fixed offset for get euler, and also changed the quaternion function to involve offsets. (TO BE TESTED, no V5 on hand). * Finished testing and fixing quaternion, revert version and drive code. * Fixed indentation * Added euler setting and taring functions. * Added limits to the setting functions. * Added proper limiting (still needs work though) * Added proper value wrapping for when a value + offset exceeds a measurable range. * Revert version and drive code, added and tested C++ API for euler. * Added documentation about setter behaviors. * Added newline at end of vdml_imu.c * Stylization changes. * Fixed inconsistent sentence Co-authored-by: nathan-moore <[email protected]> * 🔖 Bumped version to 3.4.0 * 🚸Change pros-cli-v5 to pros-cli (#277) * Changed pros-v5-cli to pros-cli Co-authored-by: Alex Brooke <[email protected]> * ✨ Add microsecond timing (#281) * Add micros as a wrapper to vexSystemHighResTimeGet * Add micros using to rtos.hpp * Fix comment formatting * Add necessary include for VEXos function Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: Will Xu <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> * ⬆️ upgrade VEXos to 1.0.13 (#289) * Add rotation data rate function (#290) * ✨ Allow user code to query registry status (#282) * Move registry_get_bound_type and registry_get_plugged_type to apix.h * Fix docs for registry functions to reflect their zero-indexed port number * 🚸 add pros::IMU alias (#293) * Create alias for Imu in IMU.h and IMU.hpp * Revert version changes * Fix version number and add typdef to pros namespace * Revert typdef location to inside class * Move alias statement, remove c implementation Move the alias statement in imu.hpp outside of IMU class. Remove c implementation of alias. Resolves #288 * Add newline in version * Fix indent of alias * 🔥 Deprecate PID setting functions (#294) * Keep functionality along with deprecation tags * Add message to deprecation warning * Deprecate other functions related to pid setting * ✨Added Delay to IMU Reset (#286) * added delay to IMU reset * variable delay * change comments * ✨Add Simplified Screen API Option (#299) ✨Add Simplified Screen API Option (#299) Co-authored-by: Ayush Shukla <[email protected]> * 🔖 Release 3.5.0 Co-authored-by: Alex Brooke <[email protected]> Co-authored-by: Octogonapus <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: nathan-moore <[email protected]> Co-authored-by: Andrew Strauss <[email protected]> Co-authored-by: AyushShukla3 <[email protected]> Co-authored-by: Eric Dong <[email protected]>
Summary:
Added zeroing and current value setting for readings for the IMU.
Motivation:
Requested via issue, might as well add this feature as it would be beneficial for writing autons.
References:
closes #252
Test Plan: