Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0.1 #97

Merged
merged 36 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5616305
Fixed rotation sensor tick per rev (#47)
ssejrog Jan 22, 2022
239cc3c
middle step for #49 and #54
ssejrog Feb 18, 2022
7fb468e
Added piston groups (#54)
ssejrog Feb 28, 2022
0061395
Completed small issues (#56, #55, $54, #52, #48)
ssejrog Mar 3, 2022
ca7b38e
Finished with clean up on constants
HakopZ Apr 5, 2022
1bf01f2
Added set ratio function
HakopZ Apr 14, 2022
3c775f3
Added practice mode
HakopZ May 14, 2022
1c2b988
Updated PROS Kernel, okapi, fixed #53, general cleaning
ssejrog Aug 22, 2022
1d8f9f3
✨Okapi units (#49, #62)
ssejrog Aug 24, 2022
7d345ec
✨ Added `set_relative_turn_pid()` (#59)
Sep 1, 2022
2d7de7f
Fixed issue #67
HakopZ Oct 1, 2022
86773d4
✨Okapi units
ssejrog Oct 6, 2022
5a73a52
New function names #65
ssejrog Nov 17, 2023
343003b
Added okapi units to turns and time, tuned PID, cleaned code, complet…
ssejrog Nov 18, 2023
7de75fd
Fixed some names, added `get` functions #73
ssejrog Nov 23, 2023
f08fbb4
Added more gets, removed version # from print #73
ssejrog Nov 24, 2023
22e68ac
⬆️ Update Kernel/Okapi to 3.8.0 and 4.8.0 Respectively (#76)
WillXuCodes Dec 6, 2023
32ee530
Merge branch 'main' into development
WillXuCodes Dec 6, 2023
081f822
Added Ability for user to reverse Drive in opcontrol (#80)
Mactar1233 Jan 24, 2024
2dfe8d7
Removed old website, updated readme
ssejrog Jan 24, 2024
7aa1c9d
Completed #82, fixed formatting
ssejrog Jan 24, 2024
4c65528
Cleaned relative turns, added wide swings #59 #83
ssejrog Jan 25, 2024
83dcb5d
Added slew to turns and swings, fixed wide arc bug #59 #83 #84
ssejrog Jan 25, 2024
329bfd9
#49 #59 #65 #84
ssejrog Jan 25, 2024
29f8b19
namespaced all classes, removed piston group. #50 #54
ssejrog Jan 26, 2024
f0e45b3
Added PID Tuner #85
ssejrog Jan 26, 2024
4955f56
PID Tuner can modify increments #85 #86 #87
ssejrog Jan 27, 2024
ae66661
Cleaned example files
ssejrog Jan 27, 2024
ac7d3ba
Added example project to this repo and made v3 template
ssejrog Jan 28, 2024
a2f72db
Final update for 3.0.0 #65
ssejrog Jan 29, 2024
97469cc
Merge branch 'main' into development
ssejrog Jan 29, 2024
c5a9878
Squashed commit of the following:
ssejrog Feb 7, 2024
65efa0b
Fixed small bugs, refactoring #89, #90, #91, #92)
ssejrog Feb 7, 2024
a1e0474
Fixed typo in comment, updated readme
ssejrog Feb 16, 2024
9d1999d
Upgraded kernel, ready for v3.0.1 release
ssejrog Apr 1, 2024
569f2cf
Merge branch 'main' into development
ssejrog Apr 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions EZ-Template-Example-Project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Compiled Object files
*.o
*.obj

# Executables
*.bin
*.elf

# PROS
bin/
.vscode/
.cache/
compile_commands.json
temp.log
temp.errors
*.ini
.d/
Binary file not shown.
Binary file not shown.
Binary file modified EZ-Template-Example-Project/firmware/EZ-Template.a
Binary file not shown.
Binary file modified EZ-Template-Example-Project/firmware/libpros.a
Binary file not shown.
25 changes: 10 additions & 15 deletions EZ-Template-Example-Project/include/EZ-Template/drive/drive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ class Drive {
* \param toggle_heading
* toggle for heading correction
*/
void pid_drive_set(double target, int speed, bool slew_on, bool toggle_heading = true);
void pid_drive_set(double target, int speed, bool slew_on = false, bool toggle_heading = true);

/**
* Sets the robot to turn using PID.
Expand Down Expand Up @@ -782,7 +782,7 @@ class Drive {
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* 0 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
* -127 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
*/
void pid_swing_set(e_swing type, double target, int speed, int opposite_speed = 0, bool slew_on = false);

Expand All @@ -796,7 +796,7 @@ class Drive {
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* 0 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
* -127 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
*/
void pid_swing_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed = 0, bool slew_on = false);

Expand All @@ -810,7 +810,7 @@ class Drive {
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* 0 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
* -127 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
*/
void pid_swing_relative_set(e_swing type, okapi::QAngle p_target, int speed, int opposite_speed = 0, bool slew_on = false);

Expand All @@ -824,7 +824,7 @@ class Drive {
* \param speed
* 0 to 127, max speed during motion
* \param opposite_speed
* 0 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
* -127 to 127, max speed of the opposite side of the drive during the swing. This is used for arcs, and is defaulted to 0.
*/
void pid_swing_relative_set(e_swing type, double target, int speed, int opposite_speed = 0, bool slew_on = false);

Expand Down Expand Up @@ -1305,31 +1305,26 @@ class Drive {
bool slew_swing_using_angle = false;
bool pid_tuner_terminal_b = false;
bool pid_tuner_lcd_b = true;

struct const_and_name {
std::string name = "";
PID::Constants *consts;
};
std::vector<const_and_name> constants;
void pid_tuner_print();
void pid_tuner_value_modify(double p, double i, double d, double start);
void pid_tuner_value_modify(float p, float i, float d, float start);
void pid_tuner_value_increase();
void pid_tuner_value_decrease();
void pid_tuner_print_brain();
void pid_tuner_print_terminal();
void pid_tuner_brain_init();
int column = 0;
int row = 0;
int column_max = 0;
const int row_max = 3;
std::string name, kp, ki, kd, starti;
std::string arrow = " <--\n";
std::string newline = "\n";
bool last_controller_curve_state;
bool last_auton_selector_state;
bool last_controller_curve_state = false;
bool last_auton_selector_state = false;
bool pid_tuner_on = false;
std::string complete_pid_tuner_output;
double p_increment = 0.1, i_increment = 0.001, d_increment = 0.25, start_i_increment = 1.0;
std::string complete_pid_tuner_output = "";
float p_increment = 0.1, i_increment = 0.001, d_increment = 0.25, start_i_increment = 1.0;

/**
* Private wait until for drive
Expand Down
8 changes: 4 additions & 4 deletions EZ-Template-Example-Project/include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

#define PROS_VERSION_MAJOR 3
#define PROS_VERSION_MINOR 8
#define PROS_VERSION_PATCH 0
#define PROS_VERSION_STRING "3.8.0"
#define PROS_VERSION_PATCH 3
#define PROS_VERSION_STRING "3.8.3"

#include "pros/adi.h"
#include "pros/colors.h"
Expand All @@ -56,8 +56,8 @@
#include "pros/misc.h"
#include "pros/motors.h"
#include "pros/optical.h"
#include "pros/rtos.h"
#include "pros/rotation.h"
#include "pros/rtos.h"
#include "pros/screen.h"
#include "pros/vision.h"

Expand All @@ -66,6 +66,7 @@
#include "pros/distance.hpp"
#include "pros/gps.hpp"
#include "pros/imu.hpp"
#include "pros/link.hpp"
#include "pros/llemu.hpp"
#include "pros/misc.hpp"
#include "pros/motors.hpp"
Expand All @@ -74,7 +75,6 @@
#include "pros/rtos.hpp"
#include "pros/screen.hpp"
#include "pros/vision.hpp"
#include "pros/link.hpp"
#endif

#endif // _PROS_API_H_
85 changes: 85 additions & 0 deletions EZ-Template-Example-Project/include/pros/gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,91 @@ double gps_get_error(uint8_t port);
*/
gps_status_s_t gps_get_status(uint8_t port);

/**
* Gets the X position in meters of the robot relative to the starting position.
*
* 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 a GPS
* EAGAIN - The sensor is still calibrating
*
* \param port
* The V5 GPS port number from 1-21
*
* \return The X position in meters. If the operation failed,
* returns PROS_ERR_F and errno is set.
*/
double gps_get_x_position(uint8_t port);

/**
* Gets the Y position in meters of the robot relative to the starting position.
*
* 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 a GPS
* EAGAIN - The sensor is still calibrating
*
* \param port
* The V5 GPS port number from 1-21
*
* \return The Y position in meters. If the operation failed,
* returns PROS_ERR_F and errno is set.
*/
double gps_get_y_position(uint8_t port);

/**
* Gets the pitch of the GPS in degrees relative to the starting orientation.
*
* 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 a GPS
* EAGAIN - The sensor is still calibrating
*
* \param port
* The V5 GPS port number from 1-21
*
* \return The pitch in (-90,90] degree values. If the operation failed,
* returns PROS_ERR_F and errno is set.
*/
double gps_get_pitch(uint8_t port);

/**
* Gets the roll of the GPS in degrees relative to the starting orientation.
*
* 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 a GPS
* EAGAIN - The sensor is still calibrating
*
* \param port
* The V5 GPS port number from 1-21
*
* \return The roll in (-180,180] degree values. If the operation failed,
* returns PROS_ERR_F and errno is set.
*/
double gps_get_roll(uint8_t port);

/**
* Gets the yaw of the GPS in degrees relative to the starting orientation.
*
* 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 a GPS
* EAGAIN - The sensor is still calibrating
*
* \param port
* The V5 GPS port number from 1-21
*
* \return The yaw in (-180,180] degree values. If the operation failed,
* returns PROS_ERR_F and errno is set.
*/
double gps_get_yaw(uint8_t port);

/**
* Get the heading in [0,360) degree values.
*
Expand Down
Loading
Loading