Skip to content

Commit

Permalink
Upgraded kernel, ready for v3.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ssejrog committed Apr 1, 2024
1 parent a1e0474 commit 9d1999d
Show file tree
Hide file tree
Showing 26 changed files with 885 additions and 470 deletions.
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

0 comments on commit 9d1999d

Please sign in to comment.