From 71b2e1de396015a2daf0b2e8f3cb7f30d995b5aa Mon Sep 17 00:00:00 2001 From: Will Xu <54247087+WillXuCodes@users.noreply.github.com> Date: Sun, 28 Feb 2021 17:17:52 -0500 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=94=96=20Release=203.4.0=20(#279)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * Put fchmod and fchmodat by chmod Co-authored-by: nathan-moore * ✨ 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 36074f0a937cff9aa86fb0622964fa939c224055. * 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 * 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 * 🔖 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 * ✨ 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 Co-authored-by: Octogonapus Co-authored-by: Kunwar Sahni Co-authored-by: nathan-moore Co-authored-by: Andrew Strauss --- STYLEGUIDE.md | 2 +- azure-pipelines.yml | 6 +- include/api.h | 8 +- include/common/cobs.h | 2 +- include/common/gid.h | 2 +- include/common/linkedlist.h | 2 +- include/common/set.h | 2 +- include/common/string.h | 2 +- include/kapi.h | 2 +- include/main.h | 2 +- include/pros/adi.h | 2 +- include/pros/adi.hpp | 2 +- include/pros/api_legacy.h | 2 +- include/pros/apix.h | 2 +- include/pros/distance.h | 2 +- include/pros/distance.hpp | 2 +- include/pros/ext_adi.h | 2 +- include/pros/imu.h | 237 ++++++++++++++++++++++++++- include/pros/imu.hpp | 223 ++++++++++++++++++++++++- include/pros/llemu.h | 2 +- include/pros/llemu.hpp | 2 +- include/pros/misc.h | 2 +- include/pros/misc.hpp | 2 +- include/pros/motors.h | 2 +- include/pros/motors.hpp | 2 +- include/pros/optical.h | 2 +- include/pros/optical.hpp | 2 +- include/pros/rotation.h | 6 +- include/pros/rotation.hpp | 2 +- include/pros/rtos.h | 9 +- include/pros/rtos.hpp | 9 +- include/pros/serial.h | 2 +- include/pros/serial.hpp | 2 +- include/pros/vision.h | 2 +- include/pros/vision.hpp | 2 +- include/system/dev/banners.h | 2 +- include/system/dev/dev.h | 2 +- include/system/dev/ser.h | 2 +- include/system/dev/usd.h | 2 +- include/system/dev/vfs.h | 2 +- include/system/optimizers.h | 2 +- include/vdml/registry.h | 2 +- include/vdml/vdml.h | 2 +- src/common/cobs.c | 2 +- src/common/gid.c | 2 +- src/common/linkedlist.c | 2 +- src/common/set.c | 2 +- src/common/string.c | 2 +- src/devices/battery.c | 2 +- src/devices/battery.cpp | 2 +- src/devices/controller.c | 2 +- src/devices/controller.cpp | 2 +- src/devices/registry.c | 2 +- src/devices/vdml.c | 2 +- src/devices/vdml_adi.c | 2 +- src/devices/vdml_adi.cpp | 2 +- src/devices/vdml_distance.c | 4 +- src/devices/vdml_distance.cpp | 2 +- src/devices/vdml_ext_adi.c | 2 +- src/devices/vdml_imu.c | 254 ++++++++++++++++++++++++++--- src/devices/vdml_imu.cpp | 56 ++++++- src/devices/vdml_motors.c | 2 +- src/devices/vdml_motors.cpp | 2 +- src/devices/vdml_optical.c | 4 +- src/devices/vdml_optical.cpp | 2 +- src/devices/vdml_rotation.c | 2 +- src/devices/vdml_rotation.cpp | 2 +- src/devices/vdml_serial.c | 2 +- src/devices/vdml_serial.cpp | 2 +- src/devices/vdml_usd.c | 2 +- src/devices/vdml_usd.cpp | 2 +- src/devices/vdml_vision.c | 2 +- src/devices/vdml_vision.cpp | 2 +- src/display/display.c | 2 +- src/display/error.c | 2 +- src/display/llemu.c | 2 +- src/display/llemu.cpp | 2 +- src/rtos/rtos.cpp | 2 +- src/rtos/tasks.c | 7 + src/system/cpp_support.cpp | 2 +- src/system/dev/dev_driver.c | 2 +- src/system/dev/file_system_stubs.c | 27 ++- src/system/dev/ser_daemon.c | 2 +- src/system/dev/ser_driver.c | 2 +- src/system/dev/usd_driver.c | 2 +- src/system/dev/vfs.c | 2 +- src/system/envlock.c | 2 +- src/system/mlock.c | 2 +- src/system/newlib_stubs.c | 2 +- src/system/rtos_hooks.c | 2 +- src/system/startup.c | 2 +- src/system/system_daemon.c | 2 +- src/system/unwind.c | 2 +- src/tests/adi.cpp | 2 +- src/tests/ext_adi.cpp | 2 +- src/tests/generic_serial.cpp | 2 +- src/tests/generic_serial_file.cpp | 2 +- src/tests/gyro.c | 2 +- src/tests/gyro.cpp | 2 +- src/tests/rtos_function_linking.c | 2 +- src/tests/simple_names.c | 2 +- src/tests/simple_names.cpp | 2 +- version | 2 +- 103 files changed, 886 insertions(+), 144 deletions(-) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 3afb8d31b..138552411 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -49,7 +49,7 @@ These should be placed at the very start of a file. * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 980b66417..661e11e31 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,10 +22,12 @@ jobs: inputs: addToPath: true versionSpec: '3.6' - - task: PipAuthenticate@0 + - task: PipAuthenticate@1 inputs: artifactFeeds: 'pros-cli' - - bash: pip install pros-cli-v5 + # use official PyPi registry first and fall back to internal feed as needed + onlyAddExtraIndex: true + - bash: pip install pros-cli displayName: Install CLI - bash: | make template diff --git a/include/api.h b/include/api.h index 70af8173d..822ac15f8 100644 --- a/include/api.h +++ b/include/api.h @@ -8,7 +8,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public @@ -40,9 +40,9 @@ #endif /* __cplusplus */ #define PROS_VERSION_MAJOR 3 -#define PROS_VERSION_MINOR 3 -#define PROS_VERSION_PATCH 1 -#define PROS_VERSION_STRING "3.3.1" +#define PROS_VERSION_MINOR 4 +#define PROS_VERSION_PATCH 0 +#define PROS_VERSION_STRING "3.4.0" #define PROS_ERR (INT32_MAX) #define PROS_ERR_F (INFINITY) diff --git a/include/common/cobs.h b/include/common/cobs.h index ca4340b61..7fddd80e1 100644 --- a/include/common/cobs.h +++ b/include/common/cobs.h @@ -5,7 +5,7 @@ * * See common/cobs.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/common/gid.h b/include/common/gid.h index b7adcb94c..58a98c433 100644 --- a/include/common/gid.h +++ b/include/common/gid.h @@ -5,7 +5,7 @@ * * See common/gid.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/common/linkedlist.h b/include/common/linkedlist.h index ad89ba3d4..d67c1a180 100644 --- a/include/common/linkedlist.h +++ b/include/common/linkedlist.h @@ -6,7 +6,7 @@ * This file defines a linked list implementation that operates on the FreeRTOS * heap, and is able to generically store function pointers and data * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/common/set.h b/include/common/set.h index b024ba2c4..7487c72ae 100644 --- a/include/common/set.h +++ b/include/common/set.h @@ -5,7 +5,7 @@ * * See common/set.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/common/string.h b/include/common/string.h index 85ec99a7a..d8128e525 100644 --- a/include/common/string.h +++ b/include/common/string.h @@ -5,7 +5,7 @@ * * See common/string.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/kapi.h b/include/kapi.h index fb9c91130..688cea44e 100644 --- a/include/kapi.h +++ b/include/kapi.h @@ -8,7 +8,7 @@ * creation of statically allocated FreeRTOS primitives like tasks, semaphores, * and queues. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/main.h b/include/main.h index 9f9a06f14..0ce65af50 100644 --- a/include/main.h +++ b/include/main.h @@ -4,7 +4,7 @@ * Contains common definitions and header files used throughout your PROS * project. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/adi.h b/include/pros/adi.h index b850fc0a9..e0d2ae7db 100644 --- a/include/pros/adi.h +++ b/include/pros/adi.h @@ -8,7 +8,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/adi.hpp b/include/pros/adi.hpp index 305480546..60e350bff 100644 --- a/include/pros/adi.hpp +++ b/include/pros/adi.hpp @@ -8,7 +8,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/api_legacy.h b/include/pros/api_legacy.h index 8768b5157..748072c74 100644 --- a/include/pros/api_legacy.h +++ b/include/pros/api_legacy.h @@ -10,7 +10,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/apix.h b/include/pros/apix.h index 71146ada8..e516d2591 100644 --- a/include/pros/apix.h +++ b/include/pros/apix.h @@ -12,7 +12,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/distance.h b/include/pros/distance.h index 115cf2adb..fae64a842 100644 --- a/include/pros/distance.h +++ b/include/pros/distance.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/distance.hpp b/include/pros/distance.hpp index b584966aa..0007035d0 100644 --- a/include/pros/distance.hpp +++ b/include/pros/distance.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * \copyright (c) 2017-2018, Purdue University ACM SIGBots. + * \copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/ext_adi.h b/include/pros/ext_adi.h index 391617f4d..11351fd00 100644 --- a/include/pros/ext_adi.h +++ b/include/pros/ext_adi.h @@ -8,7 +8,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/imu.h b/include/pros/imu.h index 0caf68430..ab3bc8d55 100644 --- a/include/pros/imu.h +++ b/include/pros/imu.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -127,7 +127,7 @@ double imu_get_rotation(uint8_t port); * Get the Inertial Sensor's heading relative to the initial direction of its * x-axis * - * This value is bounded by (-360,360). Clockwise rotations are represented with + * This value is bounded by [0,360). Clockwise rotations are represented with * positive degree values, while counterclockwise rotations are represented with * negative ones. * @@ -179,7 +179,7 @@ quaternion_s_t imu_get_quaternion(uint8_t port); euler_s_t imu_get_euler(uint8_t port); /** - * Get the Inertial Sensor's pitch angle + * Get the Inertial Sensor's pitch angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -195,7 +195,7 @@ euler_s_t imu_get_euler(uint8_t port); double imu_get_pitch(uint8_t port); /** - * Get the Inertial Sensor's roll angle + * Get the Inertial Sensor's roll angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -210,7 +210,7 @@ double imu_get_pitch(uint8_t port); double imu_get_roll(uint8_t port); /** - * Get the Inertial Sensor's yaw angle + * Get the Inertial Sensor's yaw angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -276,6 +276,233 @@ imu_status_e_t imu_get_status(uint8_t port); // void imu_set_mode(uint8_t port, uint32_t mode); // uint32_t imu_get_mode(uint8_t port); +//Value reset functions: +/** + * Resets the current reading of the Inertial Sensor's heading to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_heading(uint8_t port); + +/** + * Resets the current reading of the Inertial Sensor's rotation to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_rotation(uint8_t port); + +/** + * Resets the current reading of the Inertial Sensor's pitch to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_pitch(uint8_t port); + +/** + * Resets the current reading of the Inertial Sensor's roll to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_roll(uint8_t port); + +/** + * Resets the current reading of the Inertial Sensor's yaw to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_yaw(uint8_t port); + +/** + * Reset all 3 euler values of the Inertial Sensor to 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare_euler(uint8_t port); + +/** + * Resets all 5 values of the Inertial Sensor to 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_tare(uint8_t port); + +//Value set functions: +/** + * Sets the current reading of the Inertial Sensor's euler values to + * target euler values. Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target euler values for the euler values to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_euler(uint8_t port, euler_s_t target); + +/** + * Sets the current reading of the Inertial Sensor's rotation to target value + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the rotation value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_rotation(uint8_t port, double target); + +/** + * Sets the current reading of the Inertial Sensor's heading to target value + * Target will default to 360 if above 360 and default to 0 if below 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the heading value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_heading(uint8_t port, double target); + +/** + * Sets the current reading of the Inertial Sensor's pitch to target value + * Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the pitch value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_pitch(uint8_t port, double target); + +/** + * Sets the current reading of the Inertial Sensor's roll to target value + * Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the roll value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_roll(uint8_t port, double target); + +/** + * Sets the current reading of the Inertial Sensor's yaw to target value + * Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the yaw value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ +int32_t imu_set_yaw(uint8_t port, double target); + #ifdef __cplusplus } } diff --git a/include/pros/imu.hpp b/include/pros/imu.hpp index 07159f525..a19074416 100644 --- a/include/pros/imu.hpp +++ b/include/pros/imu.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -89,7 +89,7 @@ class Imu { * Get the Inertial Sensor's heading relative to the initial direction of its * x-axis * - * This value is bounded by (-360,360). Clockwise rotations are represented with + * This value is bounded by [0,360). Clockwise rotations are represented with * positive degree values, while counterclockwise rotations are represented with * negative ones. * @@ -138,7 +138,7 @@ class Imu { */ virtual pros::c::euler_s_t get_euler() const; /** - * Get the Inertial Sensor's pitch angle + * Get the Inertial Sensor's pitch angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -153,7 +153,7 @@ class Imu { */ virtual double get_pitch() const; /** - * Get the Inertial Sensor's roll angle + * Get the Inertial Sensor's roll angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -167,7 +167,7 @@ class Imu { */ virtual double get_roll() const; /** - * Get the Inertial Sensor's yaw angle + * Get the Inertial Sensor's yaw angle bounded by (-180,180) * * This function uses the following values of errno when an error state is * reached: @@ -196,7 +196,218 @@ class Imu { */ virtual pros::c::imu_gyro_s_t get_gyro_rate() const; /** - * Get the Inertial Sensor's raw acceleroneter values + * Resets the current reading of the Inertial Sensor's rotation to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_rotation() const; + /** + * Resets the current reading of the Inertial Sensor's heading to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_heading() const; + /** + * Resets the current reading of the Inertial Sensor's pitch to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_pitch() const; + /** + * Resets the current reading of the Inertial Sensor's yaw to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_yaw() const; + /** + * Resets the current reading of the Inertial Sensor's roll to zero + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_roll() const; + /** + * Resets all 5 values of the Inertial Sensor to 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare() const; + /** + * Reset all 3 euler values of the Inertial Sensor to 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t tare_euler() const; + /** + * Sets the current reading of the Inertial Sensor's heading to target value + * Target will default to 360 if above 360 and default to 0 if below 0. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the heading value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_heading(const double target) const; + /** + * Sets the current reading of the Inertial Sensor's rotation to target value + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the rotation value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_rotation(const double target) const; + /** + * Sets the current reading of the Inertial Sensor's yaw to target value + * Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for yaw value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_yaw(const double target) const; + /** + * Sets the current reading of the Inertial Sensor's pitch to target value + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target value for the pitch value to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_pitch(const double target) const; + /** + * Sets the current reading of the Inertial Sensor's roll to target value + * Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target euler values for the euler values to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_roll(const double target) const; + /** + * Sets the current reading of the Inertial Sensor's euler values to + * target euler values. Will default to +/- 180 if target exceeds +/- 180. + * + * This function uses the following values of errno when an error state is + * reached: + * ENXIO - The given value is not within the range of V5 ports (1-21). + * ENODEV - The port cannot be configured as an Inertial Sensor + * EAGAIN - The sensor is still calibrating + * + * \param port + * The V5 Inertial Sensor port number from 1-21 + * \param target + * Target euler values for the euler values to be set to + * \return 1 if the operation was successful or PROS_ERR if the operation + * failed, setting errno. + */ + virtual std::int32_t set_euler(const pros::c::euler_s_t target) const; + /** + * Get the Inertial Sensor's raw accelerometer values * * This function uses the following values of errno when an error state is * reached: diff --git a/include/pros/llemu.h b/include/pros/llemu.h index aef90d6f9..7b4d64d38 100644 --- a/include/pros/llemu.h +++ b/include/pros/llemu.h @@ -13,7 +13,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/llemu.hpp b/include/pros/llemu.hpp index a7eaa3729..aa96e9d69 100644 --- a/include/pros/llemu.hpp +++ b/include/pros/llemu.hpp @@ -13,7 +13,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/misc.h b/include/pros/misc.h index 7bdb00f58..b629ec041 100644 --- a/include/pros/misc.h +++ b/include/pros/misc.h @@ -10,7 +10,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reservered. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/misc.hpp b/include/pros/misc.hpp index 72a689af2..efc3ed57a 100644 --- a/include/pros/misc.hpp +++ b/include/pros/misc.hpp @@ -10,7 +10,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reservered. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/motors.h b/include/pros/motors.h index 35ef6e45a..428374f8a 100644 --- a/include/pros/motors.h +++ b/include/pros/motors.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/motors.hpp b/include/pros/motors.hpp index adcce8add..b4eeeb3ed 100644 --- a/include/pros/motors.hpp +++ b/include/pros/motors.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * \copyright (c) 2017-2018, Purdue University ACM SIGBots. + * \copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/optical.h b/include/pros/optical.h index 18bacff71..b2867aa30 100644 --- a/include/pros/optical.h +++ b/include/pros/optical.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/optical.hpp b/include/pros/optical.hpp index 4b3c39da4..381c52d2e 100644 --- a/include/pros/optical.hpp +++ b/include/pros/optical.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/rotation.h b/include/pros/rotation.h index 28c8e558e..435c6b399 100644 --- a/include/pros/rotation.h +++ b/include/pros/rotation.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -110,7 +110,7 @@ int32_t rotation_get_position(uint8_t port); int32_t rotation_get_velocity(uint8_t port); /** - * Get the Rotation Sensor's current position in centidegrees + * Get the Rotation Sensor's current angle in centidegrees (0-36000) * * This function uses the following values of errno when an error state is * reached: @@ -119,7 +119,7 @@ int32_t rotation_get_velocity(uint8_t port); * * \param port * The V5 Rotation Sensor port number from 1-21 - * \return The angle value or PROS_ERR_F if the operation failed, setting + * \return The angle value (0-36000) or PROS_ERR_F if the operation failed, setting * errno. */ int32_t rotation_get_angle(uint8_t port); diff --git a/include/pros/rotation.hpp b/include/pros/rotation.hpp index 58595f59c..256ed16f9 100644 --- a/include/pros/rotation.hpp +++ b/include/pros/rotation.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/rtos.h b/include/pros/rtos.h index 23cfc7c22..7b29526fc 100644 --- a/include/pros/rtos.h +++ b/include/pros/rtos.h @@ -10,7 +10,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public @@ -125,6 +125,13 @@ namespace c { */ uint32_t millis(void); +/** + * Gets the number of microseconds since PROS initialized, + * + * \return The number of microseconds since PROS initialized + */ +uint64_t micros(void); + /** * Creates a new task and add it to the list of tasks that are ready to run. * diff --git a/include/pros/rtos.hpp b/include/pros/rtos.hpp index c44f322ab..02dae6372 100644 --- a/include/pros/rtos.hpp +++ b/include/pros/rtos.hpp @@ -10,7 +10,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public @@ -367,6 +367,13 @@ class Mutex { */ using pros::c::millis; +/** + * Gets the number of microseconds since PROS initialized. + * + * \return The number of microseconds since PROS initialized + */ +using pros::c::micros; + /** * Delays a task for a given number of milliseconds. * diff --git a/include/pros/serial.h b/include/pros/serial.h index 81de139ff..625604545 100644 --- a/include/pros/serial.h +++ b/include/pros/serial.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/serial.hpp b/include/pros/serial.hpp index 07378e958..60e82c1cd 100644 --- a/include/pros/serial.hpp +++ b/include/pros/serial.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * \copyright (c) 2017-2018, Purdue University ACM SIGBots. + * \copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/pros/vision.h b/include/pros/vision.h index a21db2d19..f565255fd 100644 --- a/include/pros/vision.h +++ b/include/pros/vision.h @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/pros/vision.hpp b/include/pros/vision.hpp index edcc5a3cc..05a4bd2eb 100644 --- a/include/pros/vision.hpp +++ b/include/pros/vision.hpp @@ -9,7 +9,7 @@ * This file should not be modified by users, since it gets replaced whenever * a kernel upgrade occurs. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/dev/banners.h b/include/system/dev/banners.h index 407d9ac22..2376d4bbd 100644 --- a/include/system/dev/banners.h +++ b/include/system/dev/banners.h @@ -7,7 +7,7 @@ * * See system/dev/serial_daemon.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/dev/dev.h b/include/system/dev/dev.h index 313c3d964..e6ab57b7f 100644 --- a/include/system/dev/dev.h +++ b/include/system/dev/dev.h @@ -3,7 +3,7 @@ * * Generic Serial Device driver header * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/dev/ser.h b/include/system/dev/ser.h index b6495375e..521f1ec63 100644 --- a/include/system/dev/ser.h +++ b/include/system/dev/ser.h @@ -5,7 +5,7 @@ * * See system/dev/ser_driver.c and system/dev/ser_daemon.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/dev/usd.h b/include/system/dev/usd.h index f7b3ba83c..4a74e2ede 100644 --- a/include/system/dev/usd.h +++ b/include/system/dev/usd.h @@ -5,7 +5,7 @@ * * See system/dev/usd_driver.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/dev/vfs.h b/include/system/dev/vfs.h index 222201fd2..834eb820c 100644 --- a/include/system/dev/vfs.h +++ b/include/system/dev/vfs.h @@ -5,7 +5,7 @@ * * See system/dev/vfs.c for discussion * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/system/optimizers.h b/include/system/optimizers.h index 91bfde492..c49370db2 100644 --- a/include/system/optimizers.h +++ b/include/system/optimizers.h @@ -5,7 +5,7 @@ * * Probably shouldn't use anything from this header * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/include/vdml/registry.h b/include/vdml/registry.h index 3ad7dcc7b..9b34a0368 100644 --- a/include/vdml/registry.h +++ b/include/vdml/registry.h @@ -4,7 +4,7 @@ * This file contains the standard header info for the VDML (Vex Data Management * Layer) registry. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/include/vdml/vdml.h b/include/vdml/vdml.h index 99595ed81..8eae3d654 100644 --- a/include/vdml/vdml.h +++ b/include/vdml/vdml.h @@ -4,7 +4,7 @@ * This file contains all types and functions used throughout multiple VDML * (Vex Data Management Layer) files. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/common/cobs.c b/src/common/cobs.c index 86fe9d7cd..e775d687e 100644 --- a/src/common/cobs.c +++ b/src/common/cobs.c @@ -6,7 +6,7 @@ * Contains an implementation of Consistent Overhead Byte Stuffing, adapted from * https://github.com/jacquesf/COBS-Consistent-Overhead-Byte-Stuffing * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/common/gid.c b/src/common/gid.c index 38581ad64..53a64c0e0 100644 --- a/src/common/gid.c +++ b/src/common/gid.c @@ -6,7 +6,7 @@ * Contains an implementation to efficiently assign globally unique IDs * e.g. to assign entries in a global table * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/common/linkedlist.c b/src/common/linkedlist.c index fe719ad17..da7ee0a2a 100644 --- a/src/common/linkedlist.c +++ b/src/common/linkedlist.c @@ -6,7 +6,7 @@ * This file defines a linked list implementation that operates on the FreeRTOS * heap, and is able to generically store function pointers and data * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/common/set.c b/src/common/set.c index 28c85c11f..6b09afc4e 100644 --- a/src/common/set.c +++ b/src/common/set.c @@ -5,7 +5,7 @@ * It's used to check which streams are enabled in ser_driver for the moment, * but also has list_contains which may be useful in other contexts. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/common/string.c b/src/common/string.c index 4ddfa47cb..2d4d26248 100644 --- a/src/common/string.c +++ b/src/common/string.c @@ -4,7 +4,7 @@ * Contains extra string functions useful for PROS and kstrdup/kstrndup which * use the kernel heap instead of the user heap * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/battery.c b/src/devices/battery.c index 1dbafdcc0..1da781d8d 100644 --- a/src/devices/battery.c +++ b/src/devices/battery.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Battery. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/battery.cpp b/src/devices/battery.cpp index 805dc0a84..b830af31c 100644 --- a/src/devices/battery.cpp +++ b/src/devices/battery.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Battery. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/controller.c b/src/devices/controller.c index 48081d8d2..d844635b7 100644 --- a/src/devices/controller.c +++ b/src/devices/controller.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Controller. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/controller.cpp b/src/devices/controller.cpp index 06416f076..324609af1 100644 --- a/src/devices/controller.cpp +++ b/src/devices/controller.cpp @@ -4,7 +4,7 @@ * Contains functions for interacting with the V5 Controller, as well as the * competition control functions. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/registry.c b/src/devices/registry.c index 04a293490..f11808a82 100644 --- a/src/devices/registry.c +++ b/src/devices/registry.c @@ -5,7 +5,7 @@ * what devices are in use on the V5. Therefore, in order to use V5 devices with * PROS, they must be registered and deregistered using the registry. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml.c b/src/devices/vdml.c index bb310bbeb..431e24912 100644 --- a/src/devices/vdml.c +++ b/src/devices/vdml.c @@ -6,7 +6,7 @@ * VDML ensures thread saftey for operations on smart devices by maintaining * an array of RTOS Mutexes and implementing functions to take and give them. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_adi.c b/src/devices/vdml_adi.c index 3e623d81d..5176e61c8 100644 --- a/src/devices/vdml_adi.c +++ b/src/devices/vdml_adi.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 ADI. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_adi.cpp b/src/devices/vdml_adi.cpp index 339288804..83a192470 100644 --- a/src/devices/vdml_adi.cpp +++ b/src/devices/vdml_adi.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 ADI. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_distance.c b/src/devices/vdml_distance.c index 3b560541d..97eba0755 100644 --- a/src/devices/vdml_distance.c +++ b/src/devices/vdml_distance.c @@ -1,9 +1,9 @@ /** - * \file devices/vdml_imu.c + * \file devices/vdml_distance.c * * Contains functions for interacting with the VEX Inertial sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_distance.cpp b/src/devices/vdml_distance.cpp index bc2ae880b..afb0c34c4 100644 --- a/src/devices/vdml_distance.cpp +++ b/src/devices/vdml_distance.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 ADI. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_ext_adi.c b/src/devices/vdml_ext_adi.c index 7247d935c..de8db3799 100644 --- a/src/devices/vdml_ext_adi.c +++ b/src/devices/vdml_ext_adi.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 3-Wire Expander. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_imu.c b/src/devices/vdml_imu.c index 393838584..ee5ff4147 100644 --- a/src/devices/vdml_imu.c +++ b/src/devices/vdml_imu.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the VEX Inertial sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -16,12 +16,25 @@ #include "vdml/registry.h" #include "vdml/vdml.h" +#define IMU_EULER_LIMIT 180 +#define IMU_HEADING_MAX 360 + +#define DEGTORAD (M_PI / 180) + #define ERROR_IMU_STILL_CALIBRATING(port, device, err_return) \ if (vexDeviceImuStatusGet(device->device_info) & E_IMU_STATUS_CALIBRATING) { \ errno = EAGAIN; \ return_port(port - 1, err_return); \ } +typedef struct __attribute__ ((packed)) imu_reset_data { + double heading_offset; + double rotation_offset; + double pitch_offset; + double yaw_offset; + double roll_offset; +} imu_data_s_t; + int32_t imu_reset(uint8_t port) { claim_port_i(port - 1, E_DEVICE_IMU); ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); @@ -47,14 +60,16 @@ int32_t imu_set_data_rate(uint8_t port, uint32_t rate) { double imu_get_rotation(uint8_t port) { claim_port_f(port - 1, E_DEVICE_IMU); ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR_F); - double rtn = vexDeviceImuHeadingGet(device->device_info); + double rtn = vexDeviceImuHeadingGet(device->device_info) + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->rotation_offset; return_port(port - 1, rtn); } double imu_get_heading(uint8_t port) { claim_port_f(port - 1, E_DEVICE_IMU); ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR_F); - double rtn = vexDeviceImuDegreesGet(device->device_info); + double rtn = vexDeviceImuDegreesGet(device->device_info) + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->heading_offset; + if (rtn > IMU_HEADING_MAX) rtn -= IMU_HEADING_MAX; + if (rtn < 0) rtn += IMU_HEADING_MAX; return_port(port - 1, rtn); } @@ -63,21 +78,39 @@ double imu_get_heading(uint8_t port) { quaternion_s_t imu_get_quaternion(uint8_t port) { quaternion_s_t rtn = QUATERNION_ERR_INIT; - v5_smart_device_s_t* device; if (!claim_port_try(port - 1, E_DEVICE_IMU)) { return rtn; } - device = registry_get_device(port - 1); + v5_smart_device_s_t* device = registry_get_device(port - 1); ERROR_IMU_STILL_CALIBRATING(port, device, rtn); - // HACK: vexos represents quaternions as {a,b,c,d} and we want them in - // {x,y,z,w}. we don't know how exactly the quaternion data is filled, so best - // just to manually shuffle stuff into the right places here - V5_DeviceImuQuaternion qt; - vexDeviceImuQuaternionGet(device->device_info, &qt); - rtn.x = qt.b; - rtn.y = qt.c; - rtn.z = qt.d; - rtn.w = qt.a; + euler_s_t euler; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + // To calculate the quaternion values, we first get the euler values, add the offsets, + // and then do the calculations. + double roll = euler.roll + data->roll_offset; + double yaw = euler.yaw + data->yaw_offset; + double pitch = euler.pitch + data->pitch_offset; + + if (roll > IMU_EULER_LIMIT) roll -= 2 * IMU_EULER_LIMIT; + if (roll < -IMU_EULER_LIMIT) roll += 2 * IMU_EULER_LIMIT; + if (yaw > IMU_EULER_LIMIT) yaw -= 2 * IMU_EULER_LIMIT; + if (yaw < -IMU_EULER_LIMIT) yaw += 2 * IMU_EULER_LIMIT; + if (pitch > IMU_EULER_LIMIT) pitch -= 2 * IMU_EULER_LIMIT; + if (pitch < -IMU_EULER_LIMIT) pitch += 2 * IMU_EULER_LIMIT; + + double cy = cos(DEGTORAD * yaw * 0.5); + double sy = sin(DEGTORAD * yaw * 0.5); + double cp = cos(DEGTORAD * pitch * 0.5); + double sp = sin(DEGTORAD * pitch * 0.5); + double cr = cos(DEGTORAD * roll * 0.5); + double sr = sin(DEGTORAD * roll * 0.5); + + rtn.w = cr * cp * cy + sr * sp * sy; + rtn.x = sr * cp * cy - cr * sp * sy; + rtn.y = cr * sp * cy + sr * cp * sy; + rtn.z = cr * cp * sy - sr * sp * cy; + return_port(port - 1, rtn); } @@ -86,37 +119,75 @@ quaternion_s_t imu_get_quaternion(uint8_t port) { euler_s_t imu_get_euler(uint8_t port) { euler_s_t rtn = ATTITUDE_ERR_INIT; - v5_smart_device_s_t* device; if (!claim_port_try(port - 1, E_DEVICE_IMU)) { return rtn; } - device = registry_get_device(port - 1); + v5_smart_device_s_t* device = registry_get_device(port - 1); + imu_data_s_t* data = (imu_data_s_t*)device->pad; ERROR_IMU_STILL_CALIBRATING(port, device, rtn); vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&rtn); + rtn.pitch += data->pitch_offset; + rtn.yaw += data->yaw_offset; + rtn.roll += data->roll_offset; + if (rtn.roll > IMU_EULER_LIMIT) rtn.roll -= 2 * IMU_EULER_LIMIT; + if (rtn.roll < -IMU_EULER_LIMIT) rtn.roll += 2 * IMU_EULER_LIMIT; + if (rtn.yaw > IMU_EULER_LIMIT) rtn.yaw -= 2 * IMU_EULER_LIMIT; + if (rtn.yaw < -IMU_EULER_LIMIT) rtn.yaw += 2 * IMU_EULER_LIMIT; + if (rtn.pitch > IMU_EULER_LIMIT) rtn.pitch -= 2 * IMU_EULER_LIMIT; + if (rtn.pitch < -IMU_EULER_LIMIT) rtn.pitch += 2 * IMU_EULER_LIMIT; return_port(port - 1, rtn); } double imu_get_pitch(uint8_t port) { - return imu_get_euler(port).pitch; + double rtn = PROS_ERR_F; + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return rtn; + } + euler_s_t euler_values; + v5_smart_device_s_t* device = registry_get_device(port - 1); + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + rtn = euler_values.pitch + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->pitch_offset; + if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT; + if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT; + return_port(port - 1, rtn); } double imu_get_roll(uint8_t port) { - return imu_get_euler(port).roll; + double rtn = PROS_ERR_F; + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return rtn; + } + euler_s_t euler_values; + v5_smart_device_s_t* device = registry_get_device(port - 1); + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + rtn = euler_values.roll + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->roll_offset; + if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT; + if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT; + return_port(port - 1, rtn); } double imu_get_yaw(uint8_t port) { - return imu_get_euler(port).yaw; + double rtn = PROS_ERR_F; + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return rtn; + } + euler_s_t euler_values; + v5_smart_device_s_t* device = registry_get_device(port - 1); + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + rtn = euler_values.yaw + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->yaw_offset; + if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT; + if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT; + return_port(port - 1, rtn); } #define RAW_IMU_ERR_INIT {.x = PROS_ERR_F, .y = PROS_ERR_F, .z = PROS_ERR_F}; imu_gyro_s_t imu_get_gyro_rate(uint8_t port) { imu_gyro_s_t rtn = RAW_IMU_ERR_INIT; - v5_smart_device_s_t* device; if (!claim_port_try(port - 1, E_DEVICE_IMU)) { return rtn; } - device = registry_get_device(port - 1); + v5_smart_device_s_t* device = registry_get_device(port - 1); ERROR_IMU_STILL_CALIBRATING(port, device, rtn); // NOTE: `V5_DeviceImuRaw` has the same form as a quaternion, but this call // never fills the `w` field, so we make a dummy quaternion container and copy @@ -131,11 +202,10 @@ imu_gyro_s_t imu_get_gyro_rate(uint8_t port) { imu_accel_s_t imu_get_accel(uint8_t port) { imu_accel_s_t rtn = RAW_IMU_ERR_INIT; - v5_smart_device_s_t* device; if (!claim_port_try(port - 1, E_DEVICE_IMU)) { return rtn; } - device = registry_get_device(port - 1); + v5_smart_device_s_t* device = registry_get_device(port - 1); ERROR_IMU_STILL_CALIBRATING(port, device, rtn); // NOTE: this is the same as `imu_get_raw_gyro` quaternion_s_t dummy; @@ -148,11 +218,145 @@ imu_accel_s_t imu_get_accel(uint8_t port) { imu_status_e_t imu_get_status(uint8_t port) { imu_status_e_t rtn = E_IMU_STATUS_ERROR; - v5_smart_device_s_t* device; if (!claim_port_try(port - 1, E_DEVICE_IMU)) { return rtn; } - device = registry_get_device(port - 1); + v5_smart_device_s_t* device = registry_get_device(port - 1); rtn = vexDeviceImuStatusGet(device->device_info); return_port(port - 1, rtn); } + +//Reset Functions: +int32_t imu_tare(uint8_t port){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + data->rotation_offset = -vexDeviceImuHeadingGet(device->device_info); + data->heading_offset = -vexDeviceImuDegreesGet(device->device_info); + data->pitch_offset = -euler_values.pitch; + data->roll_offset = -euler_values.roll; + data->yaw_offset = -euler_values.yaw; + return_port(port - 1, 1); +} + +int32_t imu_tare_euler(uint8_t port){ + return imu_set_euler(port, (euler_s_t){0,0,0}); +} + +int32_t imu_tare_heading(uint8_t port){ + return imu_set_heading(port, 0); +} + +int32_t imu_tare_rotation(uint8_t port){ + return imu_set_rotation(port, 0); +} + +int32_t imu_tare_pitch(uint8_t port){ + return imu_set_pitch(port, 0); +} + +int32_t imu_tare_roll(uint8_t port){ + return imu_set_roll(port, 0); +} + +int32_t imu_tare_yaw(uint8_t port){ + return imu_set_yaw(port, 0); +} + +//Setter Functions: +int32_t imu_set_rotation(uint8_t port, double target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + data->rotation_offset = target - vexDeviceImuHeadingGet(device->device_info); + return_port(port - 1, 1); +} + +int32_t imu_set_heading(uint8_t port, double target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + if (target > IMU_HEADING_MAX) target = IMU_HEADING_MAX; + if (target < 0) target = 0; + data->heading_offset = target - vexDeviceImuDegreesGet(device->device_info); + return_port(port - 1, 1); +} + +int32_t imu_set_pitch(uint8_t port, double target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + if (target > IMU_EULER_LIMIT) target = IMU_EULER_LIMIT; + if (target < -IMU_EULER_LIMIT) target = -IMU_EULER_LIMIT; + data->pitch_offset = target - euler_values.pitch; + return_port(port - 1, 1); +} + +int32_t imu_set_roll(uint8_t port, double target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + if (target > IMU_EULER_LIMIT) target = IMU_EULER_LIMIT; + if (target < -IMU_EULER_LIMIT) target = -IMU_EULER_LIMIT; + data->roll_offset = target - euler_values.roll; + return_port(port - 1, 1); +} + +int32_t imu_set_yaw(uint8_t port, double target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + data->yaw_offset = target - euler_values.yaw; + if (target > IMU_EULER_LIMIT) target = IMU_EULER_LIMIT; + if (target < -IMU_EULER_LIMIT) target = -IMU_EULER_LIMIT; + return_port(port - 1, 1); +} + +int32_t imu_set_euler(uint8_t port, euler_s_t target){ + if (!claim_port_try(port - 1, E_DEVICE_IMU)) { + return PROS_ERR; + } + v5_smart_device_s_t* device = registry_get_device(port - 1); + euler_s_t euler_values; + vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values); + imu_data_s_t* data = (imu_data_s_t*)device->pad; + if (target.pitch > IMU_EULER_LIMIT) target.pitch = IMU_EULER_LIMIT; + if (target.pitch < -IMU_EULER_LIMIT) target.pitch = -IMU_EULER_LIMIT; + if (target.yaw > IMU_EULER_LIMIT) target.yaw = IMU_EULER_LIMIT; + if (target.yaw < -IMU_EULER_LIMIT) target.yaw = -IMU_EULER_LIMIT; + if (target.roll > IMU_EULER_LIMIT) target.roll = IMU_EULER_LIMIT; + if (target.roll < -IMU_EULER_LIMIT) target.roll = -IMU_EULER_LIMIT; + data->pitch_offset = target.pitch - euler_values.pitch; + data->roll_offset = target.roll - euler_values.roll; + data->yaw_offset = target.yaw - euler_values.yaw; + return_port(port - 1, 1); +} diff --git a/src/devices/vdml_imu.cpp b/src/devices/vdml_imu.cpp index ef02b40bb..ac7d1fc37 100644 --- a/src/devices/vdml_imu.cpp +++ b/src/devices/vdml_imu.cpp @@ -3,14 +3,13 @@ * * Contains functions for interacting with the VEX Inertial sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "pros/imu.h" #include "pros/imu.hpp" namespace pros { @@ -65,4 +64,57 @@ pros::c::imu_status_e_t Imu::get_status() const { bool Imu::is_calibrating() const { return get_status() & pros::c::E_IMU_STATUS_CALIBRATING; } + +std::int32_t Imu::tare_heading() const { + return pros::c::imu_tare_heading(_port); +} + +std::int32_t Imu::tare_rotation() const { + return pros::c::imu_tare_rotation(_port); +} + +std::int32_t Imu::tare_pitch() const { + return pros::c::imu_tare_pitch(_port); +} + +std::int32_t Imu::tare_yaw() const { + return pros::c::imu_tare_yaw(_port); +} + +std::int32_t Imu::tare_roll() const { + return pros::c::imu_tare_roll(_port); +} + +std::int32_t Imu::tare_euler() const { + return pros::c::imu_tare_euler(_port); +} + +std::int32_t Imu::set_heading(double target) const { + return pros::c::imu_set_heading(_port, target); +} + +std::int32_t Imu::set_rotation(double target) const { + return pros::c::imu_set_rotation(_port, target); +} + +std::int32_t Imu::set_pitch(double target) const { + return pros::c::imu_set_pitch(_port, target); +} + +std::int32_t Imu::set_yaw(double target) const { + return pros::c::imu_set_yaw(_port, target); +} + +std::int32_t Imu::set_roll(double target) const { + return pros::c::imu_set_roll(_port, target); +} + +std::int32_t Imu::set_euler(pros::c::euler_s_t target) const { + return pros::c::imu_set_euler(_port, target); +} + +std::int32_t Imu::tare() const { + return pros::c::imu_tare(_port); +} + } // namespace pros diff --git a/src/devices/vdml_motors.c b/src/devices/vdml_motors.c index 81ba54bef..7bfdb442d 100644 --- a/src/devices/vdml_motors.c +++ b/src/devices/vdml_motors.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Motors. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_motors.cpp b/src/devices/vdml_motors.cpp index 6d7b8dd3e..1f636c812 100644 --- a/src/devices/vdml_motors.cpp +++ b/src/devices/vdml_motors.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Motors. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_optical.c b/src/devices/vdml_optical.c index 5153fd315..75f2201fa 100644 --- a/src/devices/vdml_optical.c +++ b/src/devices/vdml_optical.c @@ -1,9 +1,9 @@ /** - * \file devices/vdml_imu.c + * \file devices/vdml_optical.c * * Contains functions for interacting with the VEX Inertial sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_optical.cpp b/src/devices/vdml_optical.cpp index b5c5ad9e3..4483fbb7f 100644 --- a/src/devices/vdml_optical.cpp +++ b/src/devices/vdml_optical.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the VEX Inertial sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_rotation.c b/src/devices/vdml_rotation.c index b76b3f440..5cd9ba33e 100644 --- a/src/devices/vdml_rotation.c +++ b/src/devices/vdml_rotation.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the VEX Rotation sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_rotation.cpp b/src/devices/vdml_rotation.cpp index dff0b3ba2..8649785df 100644 --- a/src/devices/vdml_rotation.cpp +++ b/src/devices/vdml_rotation.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the VEX Rotation sensor. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_serial.c b/src/devices/vdml_serial.c index 6f4dae2ae..cd378511f 100644 --- a/src/devices/vdml_serial.c +++ b/src/devices/vdml_serial.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with V5 Generic Serial devices. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_serial.cpp b/src/devices/vdml_serial.cpp index 8e94c9c2b..8e34bf07e 100644 --- a/src/devices/vdml_serial.cpp +++ b/src/devices/vdml_serial.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with V5 Generic Serial devices. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_usd.c b/src/devices/vdml_usd.c index 15e453234..b18d98e3a 100644 --- a/src/devices/vdml_usd.c +++ b/src/devices/vdml_usd.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the SD card. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/vdml_usd.cpp b/src/devices/vdml_usd.cpp index 7d1507b1c..9445f9e05 100644 --- a/src/devices/vdml_usd.cpp +++ b/src/devices/vdml_usd.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the SD card. * - * Copyright (c) 2017-2019, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/devices/vdml_vision.c b/src/devices/vdml_vision.c index 2663937c1..50493f413 100644 --- a/src/devices/vdml_vision.c +++ b/src/devices/vdml_vision.c @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Vision Sensor. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/devices/vdml_vision.cpp b/src/devices/vdml_vision.cpp index e82c9690c..b9a2af833 100644 --- a/src/devices/vdml_vision.cpp +++ b/src/devices/vdml_vision.cpp @@ -3,7 +3,7 @@ * * Contains functions for interacting with the V5 Vision Sensor. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/display/display.c b/src/display/display.c index b9a3025d3..26e72c92b 100644 --- a/src/display/display.c +++ b/src/display/display.c @@ -3,7 +3,7 @@ * * Main source code for interacting with the V5 Brain's LCD screen. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/display/error.c b/src/display/error.c index e846da882..ec5236cc3 100644 --- a/src/display/error.c +++ b/src/display/error.c @@ -4,7 +4,7 @@ * Error display handling. Prints an error message to the screen when the kernel * is put in an error state. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/display/llemu.c b/src/display/llemu.c index bb2067411..1ca15e72c 100644 --- a/src/display/llemu.c +++ b/src/display/llemu.c @@ -7,7 +7,7 @@ * VEX LCD, containing a set of functions that facilitate the use of a software- * emulated version of the classic VEX LCD module. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/display/llemu.cpp b/src/display/llemu.cpp index 04d38a251..39cc6e378 100644 --- a/src/display/llemu.cpp +++ b/src/display/llemu.cpp @@ -7,7 +7,7 @@ * VEX LCD, containing a set of functions that facilitate the use of a software- * emulated version of the classic VEX LCD module. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/rtos/rtos.cpp b/src/rtos/rtos.cpp index fe21e7d09..3bce6542f 100644 --- a/src/rtos/rtos.cpp +++ b/src/rtos/rtos.cpp @@ -6,7 +6,7 @@ * * See https://pros.cs.purdue.edu/v5/tutorials/multitasking.html to learn more. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/rtos/tasks.c b/src/rtos/tasks.c index ec828d542..cd1f51b28 100644 --- a/src/rtos/tasks.c +++ b/src/rtos/tasks.c @@ -29,6 +29,8 @@ #include #include +#include "v5_api.h" + /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining all the API functions to use the MPU wrappers. That should only be done when task.h is included from an application file. */ @@ -2060,6 +2062,11 @@ uint32_t xTicks; return xTicks * (configTICK_RATE_HZ / 1000); } + +uint64_t micros(void) +{ + return vexSystemHighResTimeGet(); +} /*-----------------------------------------------------------*/ uint32_t xTaskGetTickCountFromISR( void ) diff --git a/src/system/cpp_support.cpp b/src/system/cpp_support.cpp index b4e603b02..481d0b64a 100644 --- a/src/system/cpp_support.cpp +++ b/src/system/cpp_support.cpp @@ -3,7 +3,7 @@ * * C++ support hooks * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots + * Copyright (c) 2017-2021, Purdue University ACM SIGBots * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/dev/dev_driver.c b/src/system/dev/dev_driver.c index 7ea89983f..f2eaadee5 100644 --- a/src/system/dev/dev_driver.c +++ b/src/system/dev/dev_driver.c @@ -6,7 +6,7 @@ * Contains the driver for writing to any smart port with no regard to the * device on the other end. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/dev/file_system_stubs.c b/src/system/dev/file_system_stubs.c index 388441e0a..73717ae4a 100644 --- a/src/system/dev/file_system_stubs.c +++ b/src/system/dev/file_system_stubs.c @@ -6,7 +6,7 @@ * Contains temporary stubs for the file system to allow compilation under gcc 9.2 * This is temporary and should be removed as part of #184 * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public @@ -32,6 +32,16 @@ int chmod(const char* pathname, mode_t mode) { return -1; } +int fchmod(int fd, mode_t mode) { + errno = ENOSYS; + return -1; +} + +int fchmodat(int dirfd, const char* pathname, mode_t mode, int flags) { + errno = ENOSYS; + return -1; +} + long pathconf(const char* path, int name) { errno = ENOSYS; return -1; @@ -56,3 +66,18 @@ int _stat(const char* file, struct stat* st) { errno = ENOSYS; return -1; } + +int symlink(const char* file, const char* linkpath) { + errno = ENOSYS; + return -1; +} + +ssize_t readlink(const char* pathname, char* buf, size_t bufsiz) { + errno = ENOSYS; + return -1; +} + +int truncate(const char* path, off_t length) { + errno = ENOSYS; + return -1; +} diff --git a/src/system/dev/ser_daemon.c b/src/system/dev/ser_daemon.c index 6898b3a35..05c0b51af 100644 --- a/src/system/dev/ser_daemon.c +++ b/src/system/dev/ser_daemon.c @@ -7,7 +7,7 @@ * characters and responding to any kernel commands (like printing the banner or * enabling COBS) * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/dev/ser_driver.c b/src/system/dev/ser_driver.c index 9c7783c71..8cb1b9b3f 100644 --- a/src/system/dev/ser_driver.c +++ b/src/system/dev/ser_driver.c @@ -6,7 +6,7 @@ * Contains the driver for communicating over the serial line. The serial driver * is responsible for shipping out all data. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/dev/usd_driver.c b/src/system/dev/usd_driver.c index 22836cffd..b5aaa0952 100644 --- a/src/system/dev/usd_driver.c +++ b/src/system/dev/usd_driver.c @@ -3,7 +3,7 @@ * * Contains the driver for writing files to the microSD card. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/dev/vfs.c b/src/system/dev/vfs.c index 2acf4d908..c6d0d750b 100644 --- a/src/system/dev/vfs.c +++ b/src/system/dev/vfs.c @@ -13,7 +13,7 @@ * fileno. A file number maps to a driver and driver argument, which would be * whatever metadata the driver needs to open the file * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots + * Copyright (c) 2017-2021, Purdue University ACM SIGBots * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/envlock.c b/src/system/envlock.c index b7f84b6ed..839c50e6c 100644 --- a/src/system/envlock.c +++ b/src/system/envlock.c @@ -5,7 +5,7 @@ * * Contains implementations of environment-locking functions for newlib. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/mlock.c b/src/system/mlock.c index 80b16b360..954d77b2b 100644 --- a/src/system/mlock.c +++ b/src/system/mlock.c @@ -5,7 +5,7 @@ * * Contains implementations of memory-locking functions for newlib. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/newlib_stubs.c b/src/system/newlib_stubs.c index 29a41ba64..814877f44 100644 --- a/src/system/newlib_stubs.c +++ b/src/system/newlib_stubs.c @@ -6,7 +6,7 @@ * Contains the various methods needed to enable standard C library support * through the use of the Arm-distributed implementation of newlib. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/rtos_hooks.c b/src/system/rtos_hooks.c index 3f4751755..277e44d0d 100644 --- a/src/system/rtos_hooks.c +++ b/src/system/rtos_hooks.c @@ -6,7 +6,7 @@ * FreeRTOS requires some porting to each platform to handle certain tasks. This * file contains the various methods required to be implemented for FreeRTOS. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots + * Copyright (c) 2017-2021, Purdue University ACM SIGBots * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/startup.c b/src/system/startup.c index 0b65f4386..6dee6af75 100644 --- a/src/system/startup.c +++ b/src/system/startup.c @@ -5,7 +5,7 @@ * code. Our main() initializes data structures and starts the FreeRTOS * scheduler. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/system_daemon.c b/src/system/system_daemon.c index b8c8e5279..969158255 100644 --- a/src/system/system_daemon.c +++ b/src/system/system_daemon.c @@ -3,7 +3,7 @@ * * Competition control daemon responsible for invoking the user tasks. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots + * Copyright (c) 2017-2021, Purdue University ACM SIGBots * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/system/unwind.c b/src/system/unwind.c index 751efb3db..9ac6c180e 100644 --- a/src/system/unwind.c +++ b/src/system/unwind.c @@ -5,7 +5,7 @@ * be arbitrarily stopped, requiring us to call all the destructors of the task * to be killed. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots + * Copyright (c) 2017-2021, Purdue University ACM SIGBots * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/adi.cpp b/src/tests/adi.cpp index 62b6e6296..190df546e 100644 --- a/src/tests/adi.cpp +++ b/src/tests/adi.cpp @@ -6,7 +6,7 @@ * NOTE: There should also be a call to the constructor for the gyroscope object * in initialize() for calibration to occur before the opcontrol code. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/ext_adi.cpp b/src/tests/ext_adi.cpp index a69e6d99c..6d6ea0647 100644 --- a/src/tests/ext_adi.cpp +++ b/src/tests/ext_adi.cpp @@ -3,7 +3,7 @@ * * Test code for various External ADI things * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/generic_serial.cpp b/src/tests/generic_serial.cpp index 9922505a5..6be38beda 100644 --- a/src/tests/generic_serial.cpp +++ b/src/tests/generic_serial.cpp @@ -6,7 +6,7 @@ * NOTE: There should be a cable plugged into ports 1 and 2, connecting * them together * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/generic_serial_file.cpp b/src/tests/generic_serial_file.cpp index 75533d8f5..6562528e1 100644 --- a/src/tests/generic_serial_file.cpp +++ b/src/tests/generic_serial_file.cpp @@ -6,7 +6,7 @@ * NOTE: There should be a cable plugged into ports 1 and 2, connecting * them together * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/gyro.c b/src/tests/gyro.c index 7c66d2f92..599ce3c14 100644 --- a/src/tests/gyro.c +++ b/src/tests/gyro.c @@ -6,7 +6,7 @@ * NOTE: There should also be a call to the constructor for the gyroscope object * in initialize() for calibration to occur before the opcontrol code. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/gyro.cpp b/src/tests/gyro.cpp index 83acc7d57..d69c42ffc 100644 --- a/src/tests/gyro.cpp +++ b/src/tests/gyro.cpp @@ -6,7 +6,7 @@ * NOTE: There should also be a call to the constructor for the gyroscope object * in initialize() for calibration to occur before the opcontrol code. * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/rtos_function_linking.c b/src/tests/rtos_function_linking.c index 53acde2ac..900b22e1c 100644 --- a/src/tests/rtos_function_linking.c +++ b/src/tests/rtos_function_linking.c @@ -5,7 +5,7 @@ * * Do not actually run this test - just make sure it compiles * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/simple_names.c b/src/tests/simple_names.c index c405b0e39..0848cfced 100644 --- a/src/tests/simple_names.c +++ b/src/tests/simple_names.c @@ -5,7 +5,7 @@ * * Do not actually run this test - just make sure it compiles * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/src/tests/simple_names.cpp b/src/tests/simple_names.cpp index c45fc283e..04101089b 100644 --- a/src/tests/simple_names.cpp +++ b/src/tests/simple_names.cpp @@ -5,7 +5,7 @@ * * Do not actually run this test - just make sure it compiles * - * Copyright (c) 2017-2020, Purdue University ACM SIGBots. + * Copyright (c) 2017-2021, Purdue University ACM SIGBots. * All rights reserved. * * This Source Code Form is subject to the terms of the Mozilla Public diff --git a/version b/version index bea438e9a..18091983f 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.3.1 +3.4.0