-
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 Support for the Rotation Sensor #258
Conversation
device type in C file.
with C file not returning proper value. TODO: Revert Version Value
…gbots/pros into feature/rotation-sensor
taken out, changed reset_position in cpp to reflect the reset position in C.
…gbots/pros into feature/rotation-sensor
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.
there are a couple comments here that apply to the whole file, so check the file carefully when considering them
include/pros/rotation.h
Outdated
* Resets Rotation Sensor | ||
* | ||
* Resets rotation sensor by multiplying the rotation reading by |
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.
re: sensor naming consistency
include/pros/rotation.h
Outdated
#endif | ||
|
||
/** | ||
* Resets Rotation Sensor |
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.
also use the imperative mood here ("reset" as opposed to "resets")
include/pros/rotation.h
Outdated
int32_t rotation_set_position(uint8_t port, uint32_t position); | ||
|
||
/** | ||
* Resets the rotation sensor position to 0. |
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.
imperative mood. also, if you're putting a period at the end of the first line, make sure it's at least consistent within the file, and ideally we have been consistent elsewhere in the project too
include/pros/rotation.h
Outdated
* Get the Rotation sensor's current position. Specifically, in | ||
* terms of hundreths of degrees. |
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.
* Get the Rotation sensor's current position. Specifically, in | |
* terms of hundreths of degrees. | |
* Get the Rotation sensor's current position in centidegrees |
re: capitalization of the sensor? be consistent
**also i am not very strongly attached to using "centidegrees" so you can use "hundredths of a degree" there instead if you want
include/pros/rotation.h
Outdated
* Get the Rotation sensor's current velocity in hundreths of | ||
* degrees per second. |
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.
could go with centidegrees here to make it more concise, but if you don't, make sure to correct "hundreth" -> "hundredth"
include/pros/rotation.h
Outdated
|
||
/** | ||
* Get the Rotation sensor's current position in terms of an angle | ||
* measured in hundreths of degrees. |
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.
ditto here
Co-authored-by: Alex Brooke <[email protected]>
Bump on review please |
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
commit 5044d67 Author: WillXuCodes <[email protected]> Date: Tue Oct 27 20:13:52 2020 -0400 Capitalize Rotation Sensor commit e7480be Author: WillXuCodes <[email protected]> Date: Tue Oct 27 19:15:28 2020 -0400 Fix documentation for rotation_reset. commit 8785778 Author: WillXuCodes <[email protected]> Date: Wed Oct 21 13:21:23 2020 -0400 Fixed documentation, removed periods, and used imperative tone. commit 066142e Author: Will Xu <[email protected]> Date: Wed Oct 21 02:12:12 2020 -0400 Update include/pros/rotation.h Co-authored-by: Alex Brooke <[email protected]> commit 3447094 Merge: 626a9be a696e72 Author: Will Xu <[email protected]> Date: Tue Oct 20 09:29:21 2020 -0400 Merge branch 'feature/rotation-sensor' of https://github.com/purduesigbots/pros into feature/rotation-sensor commit 626a9be Author: Will Xu <[email protected]> Date: Tue Oct 20 09:27:35 2020 -0400 Added same reset documentation to C header commit 45445e6 Author: Will Xu <[email protected]> Date: Tue Oct 20 09:27:03 2020 -0400 Added new documentation on reset function commit a696e72 Author: Will Xu <[email protected]> Date: Tue Oct 20 09:24:44 2020 -0400 Update version commit 674cacf Author: Will Xu <[email protected]> Date: Tue Oct 20 09:21:42 2020 -0400 Properly reverted version commit c5ce3de Author: Will Xu <[email protected]> Date: Tue Oct 20 09:19:07 2020 -0400 Revert version commit 4308a4d Author: Will Xu <[email protected]> Date: Tue Oct 20 09:18:06 2020 -0400 Revert accidental change in CPP file commit 312394d Author: Will Xu <[email protected]> Date: Tue Oct 20 08:49:16 2020 -0400 Header documentation changes commit f93163f Author: WillXuCodes <[email protected]> Date: Sun Oct 18 23:36:26 2020 -0400 Added reverse functionality to C api. commit ab7d66f Author: WillXuCodes <[email protected]> Date: Sun Oct 18 22:25:31 2020 -0400 Saved file properly commit 4b1b91d Author: WillXuCodes <[email protected]> Date: Sun Oct 18 22:19:09 2020 -0400 Fixed compilation error by reverting old change that wasn't cleanly taken out, changed reset_position in cpp to reflect the reset position in C. commit 20c6651 Author: WillXuCodes <[email protected]> Date: Sun Oct 18 21:50:14 2020 -0400 Added reset position functions to the rotation-sensor commit 20a5598 Author: Will Xu <[email protected]> Date: Fri Oct 16 17:15:50 2020 -0400 Update rotation.h commit e8a9cb3 Author: Will Xu <[email protected]> Date: Fri Oct 16 17:15:15 2020 -0400 Rotation.hpp documentation fixes commit 8b5bdd7 Author: Will Xu <[email protected]> Date: Fri Oct 16 17:10:40 2020 -0400 Rotation header documentation fixes commit ead6ce7 Author: WillXuCodes <Will Xu> Date: Wed Oct 14 01:09:33 2020 -0400 Fixed reverse(void) not working (earlier testing did not test it properly). commit eecf482 Author: Will Xu <[email protected]> Date: Mon Oct 12 02:17:14 2020 -0400 Deleted extraneous newline commit b08b97d Author: Will Xu <[email protected]> Date: Mon Oct 12 02:16:17 2020 -0400 Fixed documentation commit c7c8d06 Author: Kunwar Sahni <[email protected]> Date: Sun Oct 11 14:48:55 2020 -0400 Change to virtual commit df2f72e Author: Will Xu <[email protected]> Date: Sat Oct 10 03:28:59 2020 -0400 Update version commit 7771dde Author: Will Xu <[email protected]> Date: Sat Oct 10 03:28:39 2020 -0400 Update version commit f8ea547 Author: Will Xu <[email protected]> Date: Sat Oct 10 03:28:13 2020 -0400 Update version commit bd51044 Author: Will Xu <[email protected]> Date: Sat Oct 10 03:25:59 2020 -0400 Revert version commit 2b37525 Author: Will Xu <[email protected]> Date: Sat Oct 10 03:24:43 2020 -0400 Finished documentation commit e1272be Author: mooreBrendan <[email protected]> Date: Fri Oct 9 18:41:50 2020 -0400 change get reversed to int32_t so that the error can be returned commit 0eb8a4f Merge: 2918761 877680c Author: mooreBrendan <[email protected]> Date: Fri Oct 9 18:33:44 2020 -0400 Merge branch 'feature/rotation-sensor' of https://github.com/purduesigbots/pros into feature/rotation-sensor commit 2918761 Author: mooreBrendan <[email protected]> Date: Fri Oct 9 18:32:33 2020 -0400 corrected return values in documentation commit 877680c Author: WillXuCodes <Will Xu> Date: Tue Oct 6 23:14:26 2020 -0400 Revert PROS_VERSION_PATCH commit 78760ee Author: Will Xu <[email protected]> Date: Tue Oct 6 17:30:15 2020 -0400 Revert Version commit 853f9bc Author: Will Xu <[email protected]> Date: Tue Oct 6 16:31:02 2020 -0400 Documentation updates commit 7097a45 Author: Will Xu <[email protected]> Date: Tue Oct 6 16:24:12 2020 -0400 Revert accidentally changed header for imu C file. commit 42ce52a Author: Will Xu <[email protected]> Date: Tue Oct 6 16:22:30 2020 -0400 Properly Reverted main.cpp commit 0be2e4a Author: Will Xu <[email protected]> Date: Tue Oct 6 16:17:37 2020 -0400 Reverted main.cpp, added rotation hpp file to api header, fixed issues with C file not returning proper value. TODO: Revert Version Value commit 64614ff Author: Will Xu <[email protected]> Date: Sun Oct 4 02:06:24 2020 -0400 Added untracked files: commit fcb8d9c Author: Will Xu <[email protected]> Date: Sun Oct 4 02:05:40 2020 -0400 Finished cpp and hpp files, tested but didn't work. Also fixed wrong device type in C file. commit 717a838 Author: Will Xu <[email protected]> Date: Sat Oct 3 21:05:58 2020 -0400 Finished up C file. commit 39fd11e Author: WillXuCodes <Will Xu> Date: Wed Sep 30 20:38:18 2020 -0400 Started slightly with the rotation C file. commit 4db4b1b Author: WillXuCodes <Will Xu> Date: Tue Sep 29 18:44:01 2020 -0400 Added untracked file commit cf00b7f Author: WillXuCodes <Will Xu> Date: Tue Sep 29 18:43:45 2020 -0400 Finished header file for rotation sensor
commit f8364d0 Merge: a19c090 74c385f Author: Alex Brooke <[email protected]> Date: Tue Oct 27 22:26:05 2020 -0400 Merge branch 'develop' into feature/optical-sensor commit a19c090 Merge: 0da4047 5b0269c Author: Kunwar Sahni <[email protected]> Date: Tue Oct 27 21:06:46 2020 -0400 Merge remote-tracking branch 'purduesigbots/feature/optical-sensor' into feature/optical-sensor commit 0da4047 Author: Kunwar Sahni <[email protected]> Date: Tue Oct 27 21:06:40 2020 -0400 Remove comment commit 5b0269c Author: Kunwar Sahni <[email protected]> Date: Tue Oct 27 21:05:15 2020 -0400 Update include/pros/optical.h Co-authored-by: Alex Brooke <[email protected]> commit 1461d03 Author: Kunwar Sahni <[email protected]> Date: Tue Oct 27 21:01:30 2020 -0400 Editing comments commit 74c385f Author: Will Xu <[email protected]> Date: Tue Oct 27 20:18:57 2020 -0400 ✨ Add Support for the Rotation Sensor (#258) * Finished header file for rotation sensor * Added untracked file * Started slightly with the rotation C file. * Finished up C file. * Finished cpp and hpp files, tested but didn't work. Also fixed wrong device type in C file. * Added untracked files: * Reverted main.cpp, added rotation hpp file to api header, fixed issues with C file not returning proper value. TODO: Revert Version Value * Properly Reverted main.cpp * Revert accidentally changed header for imu C file. * Documentation updates * Revert Version * Revert PROS_VERSION_PATCH * corrected return values in documentation * change get reversed to int32_t so that the error can be returned * Finished documentation * Revert version * Update version * Update version * Update version * Change to virtual * Fixed documentation * Deleted extraneous newline * Fixed reverse(void) not working (earlier testing did not test it properly). * Rotation header documentation fixes * Rotation.hpp documentation fixes * Update rotation.h * Added reset position functions to the rotation-sensor * Fixed compilation error by reverting old change that wasn't cleanly taken out, changed reset_position in cpp to reflect the reset position in C. * Saved file properly * Added reverse functionality to C api. * Header documentation changes * Revert accidental change in CPP file * Revert version * Properly reverted version * Update version * Added new documentation on reset function * Added same reset documentation to C header * Update include/pros/rotation.h Co-authored-by: Alex Brooke <[email protected]> * Fixed documentation, removed periods, and used imperative tone. * Fix documentation for rotation_reset. * Capitalize Rotation Sensor Co-authored-by: WillXuCodes <Will Xu> Co-authored-by: mooreBrendan <[email protected]> Co-authored-by: Kunwar Sahni <[email protected]> Co-authored-by: Alex Brooke <[email protected]> commit 355b567 Author: Will Xu <[email protected]> Date: Tue Oct 27 20:17:16 2020 -0400 Update include/pros/optical.hpp Co-authored-by: Alex Brooke <[email protected]> commit 330e3fe Author: Will Xu <[email protected]> Date: Tue Oct 27 20:17:05 2020 -0400 Update include/pros/optical.hpp Co-authored-by: Alex Brooke <[email protected]> commit 55efaf4 Author: Will Xu <[email protected]> Date: Tue Oct 27 20:16:43 2020 -0400 Update include/pros/optical.hpp Co-authored-by: Alex Brooke <[email protected]> commit 76758af Author: Will Xu <[email protected]> Date: Tue Oct 27 20:16:24 2020 -0400 Update include/pros/optical.hpp Co-authored-by: Alex Brooke <[email protected]> commit 95f5e81 Author: Will Xu <[email protected]> Date: Tue Oct 27 20:16:14 2020 -0400 Update include/pros/optical.h Co-authored-by: Alex Brooke <[email protected]> commit c2425dc Author: Will Xu <[email protected]> Date: Tue Oct 27 20:15:44 2020 -0400 Update include/pros/optical.h Co-authored-by: Alex Brooke <[email protected]> commit fa281b4 Author: Will Xu <[email protected]> Date: Tue Oct 27 20:14:35 2020 -0400 Update include/pros/optical.h Co-authored-by: Alex Brooke <[email protected]> commit 493f5d1 Author: Will Xu <[email protected]> Date: Tue Oct 27 20:14:25 2020 -0400 Update include/pros/optical.h Co-authored-by: Alex Brooke <[email protected]> commit a35f6a4 Author: mooreBrendan <[email protected]> Date: Thu Oct 22 00:16:44 2020 -0400 fixed return value documentation commit b8d64fb Merge: 8ecc51e 5a66cee Author: Kunwar Sahni <[email protected]> Date: Tue Oct 20 08:48:42 2020 -0400 Merge pull request #257 from purduesigbots/feature/distance-sensor ✨ Add Support for the Distance Sensor commit 5a66cee Author: Kunwar Sahni <[email protected]> Date: Sun Oct 11 14:47:42 2020 -0400 Change to virtual commit 1c57877 Author: Kunwar Sahni <[email protected]> Date: Sun Oct 11 14:44:24 2020 -0400 Change to virtual commit 113abf9 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 17:22:03 2020 -0400 Fix version commit 7e44d38 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 17:17:12 2020 -0400 Change err init commit b1c5131 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 17:03:25 2020 -0400 Change enum back commit 0e277a0 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 16:59:10 2020 -0400 Lowercase enum commit 4b287c3 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 16:56:54 2020 -0400 Formatting commit ac9b3f0 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 9 16:22:12 2020 -0400 Fix gesture disable commit fed36f6 Author: Will Xu <[email protected]> Date: Fri Oct 9 11:26:03 2020 -0400 Revert main.cpp commit f0a8e09 Author: Will Xu <[email protected]> Date: Fri Oct 9 11:24:01 2020 -0400 Revert Version commit a60ce46 Author: Will Xu <[email protected]> Date: Fri Oct 9 00:59:15 2020 -0400 Fixed up last of optical sensor errors by changing a function to the device sdk function. commit d75c687 Author: Will Xu <[email protected]> Date: Thu Oct 8 03:49:08 2020 -0400 Added new error system for optical sensor, cleaned up mutex related warnings by using claim_port instead of claim_port_i. (NOTE: I am aware this code may not compile, but I have no clue what I changed to make it stop compiling since a previous warning has now turned into an error for some reason :/) commit 803bf93 Author: mooreBrendan <[email protected]> Date: Tue Oct 6 16:46:16 2020 -0400 changed get_size to int32_t in c++ commit af6768b Author: Kunwar Sahni <[email protected]> Date: Tue Oct 6 11:11:47 2020 -0400 Remove new line commit c46b794 Author: Kunwar Sahni <[email protected]> Date: Tue Oct 6 11:04:37 2020 -0400 Apply suggestions from code review Co-authored-by: Alex Brooke <[email protected]> commit d39dd99 Author: mooreBrendan <[email protected]> Date: Tue Oct 6 00:19:47 2020 -0400 fixed int32_t library inclusion, and added std:: commit 7e94cfd Author: Kunwar Sahni <[email protected]> Date: Sat Oct 3 17:59:53 2020 -0400 Add confidence documentation commit ee2e87f Author: Kunwar Sahni <[email protected]> Date: Sat Oct 3 14:00:17 2020 -0400 Change to device sdk function commit db589a9 Merge: 6c91e5d ad938e5 Author: WillXuCodes <Will Xu> Date: Sat Oct 3 01:19:19 2020 -0400 Merge branch 'feature/distance-sensor' of https://github.com/purduesigbots/pros into feature/distance-sensor commit 6c91e5d Author: WillXuCodes <Will Xu> Date: Sat Oct 3 01:14:10 2020 -0400 Fixed bad macro and extraneous newline commit ad938e5 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:52:04 2020 -0400 Fix Formatting issues commit bb2c816 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:45:30 2020 -0400 Apply suggestions from code review Co-authored-by: Alex Brooke <[email protected]> commit 3bc747e Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:44:54 2020 -0400 Update include/pros/distance.h Co-authored-by: Alex Brooke <[email protected]> commit 6684e6e Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:44:33 2020 -0400 Update include/pros/distance.h Co-authored-by: Alex Brooke <[email protected]> commit 7872b50 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:44:22 2020 -0400 Update include/pros/distance.h Co-authored-by: Alex Brooke <[email protected]> commit 19d032a Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 19:44:12 2020 -0400 Update include/pros/distance.h Co-authored-by: Alex Brooke <[email protected]> commit 050ec15 Author: Kunwar Sahni <[email protected]> Date: Fri Oct 2 18:12:33 2020 -0400 Change to Device over index commit 7ad19a2 Author: WillXuCodes <Will Xu> Date: Tue Sep 29 18:16:35 2020 -0400 Saved file commit cfd8e38 Author: WillXuCodes <Will Xu> Date: Tue Sep 29 18:15:11 2020 -0400 Removed unnecessary using namespace pros::c from cpp file. commit 7e73e49 Author: WillXuCodes <Will Xu> Date: Tue Sep 29 18:04:46 2020 -0400 Added std:: to cpp files, and return types in the cpp files themselves. commit 72b8016 Author: WillXuCodes <Will Xu> Date: Tue Sep 29 17:56:02 2020 -0400 Added missing semi colon commit 5fa435c Author: WillXuCodes <Will Xu> Date: Tue Sep 29 17:50:08 2020 -0400 Fixed error handling function commit e2f474f Author: WillXuCodes <Will Xu> Date: Tue Sep 29 17:35:00 2020 -0400 Added optical sensor header files to api.h commit b15afaf Author: WillXuCodes <Will Xu> Date: Tue Sep 29 17:28:48 2020 -0400 Added distance header files to api header. commit bdef884 Author: WillXuCodes <Will Xu> Date: Fri Sep 25 23:08:04 2020 -0400 Deleted unnecesary old comment regarding adding error handling commit 27f3b98 Author: mooreBrendan <[email protected]> Date: Fri Sep 25 19:29:55 2020 -0400 removed optical_ from c++ files commit f4d8f53 Author: mooreBrendan <[email protected]> Date: Fri Sep 25 19:24:40 2020 -0400 added the cpp file for the distance sensor and reverted main commit 0868c74 Author: mooreBrendan <[email protected]> Date: Fri Sep 25 19:06:45 2020 -0400 Added cpp file for optical sensor commit 7f66e9f Author: mooreBrendan <[email protected]> Date: Fri Sep 25 18:48:29 2020 -0400 added optical hpp file commit dda2bbf Author: WillXuCodes <Will Xu> Date: Fri Sep 25 18:29:42 2020 -0400 Added bad port or device error handling (Needs review) commit 3e1b6cd Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 18:13:52 2020 -0400 Add gesture_raw and enum commit fd2a4e2 Merge: 0a3d5f9 bfc5a35 Author: WillXuCodes <Will Xu> Date: Fri Sep 25 18:11:31 2020 -0400 Merge branch 'feature/distance-sensor' of https://github.com/purduesigbots/pros into feature/distance-sensor commit 0a3d5f9 Author: WillXuCodes <Will Xu> Date: Fri Sep 25 18:00:00 2020 -0400 Added distance sensor to device type enum, also started C file for distance sensor. commit bfc5a35 Author: mooreBrendan <[email protected]> Date: Fri Sep 25 17:58:49 2020 -0400 fixed the #ifndef in hpp file commit a07f393 Author: mooreBrendan <[email protected]> Date: Fri Sep 25 17:55:20 2020 -0400 added distance.hpp commit 3f1fbc6 Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 16:18:02 2020 -0400 Fix void functions commit b9bbeb9 Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 16:03:23 2020 -0400 Fix vdml_optical.c commit 630b9bd Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 16:01:44 2020 -0400 Add vdml_optical.c commit 27ff3c1 Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 14:59:35 2020 -0400 Fix Comments and set_pwm commit 198f161 Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 14:54:05 2020 -0400 Add Optical Header commit 2ee04ea Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 11:40:51 2020 -0400 Add get confidence commit 0913f1a Author: Kunwar Sahni <[email protected]> Date: Fri Sep 25 11:29:03 2020 -0400 Add Distance Header
Summary:
Setup the C/Cpp API for the Rotation Sensor.
Motivation:
With the rotation sensor being released in the near feature, it wouldn't hurt to have support for it before it comes out for our users to use as soon as they get their hands on it.
Test Plan: