|
| 1 | +#include "shared/robot_constants.h" |
| 2 | + |
| 3 | +#include "shared/constants.h" |
| 4 | + |
| 5 | +namespace robot_constants |
| 6 | +{ |
| 7 | + |
| 8 | +#if CHECK_VERSION(2026) |
| 9 | +RobotConstants createRobotConstants() |
| 10 | +{ |
| 11 | + return { |
| 12 | + .robot_radius_m = static_cast<float>(ROBOT_MAX_RADIUS_METERS), |
| 13 | + .front_wheel_angle_deg = 32.0f, |
| 14 | + .back_wheel_angle_deg = 44.0f, |
| 15 | + |
| 16 | + .fr_x_pos_meters = 0.03485f, |
| 17 | + .fr_y_pos_meters = -0.06632f, |
| 18 | + .fl_x_pos_meters = 0.03485f, |
| 19 | + .fl_y_pos_meters = 0.06632f, |
| 20 | + .bl_x_pos_meters = -0.04985f, |
| 21 | + .bl_y_pos_meters = 0.05592f, |
| 22 | + .br_x_pos_meters = -0.04985f, |
| 23 | + .br_y_pos_meters = -0.05592f, |
| 24 | + |
| 25 | + .front_of_robot_width_meters = 0.11f, |
| 26 | + .dribbler_width_meters = 0.07825f, |
| 27 | + |
| 28 | + // Dribbler speeds are negative as that is the direction that sucks the ball in |
| 29 | + .indefinite_dribbler_speed_rpm = -10000, |
| 30 | + .max_force_dribbler_speed_rpm = -12000, |
| 31 | + |
| 32 | + // Motor constant |
| 33 | + .motor_max_acceleration_m_per_s_2 = 4.5f, |
| 34 | + |
| 35 | + // Robot's linear movement constants |
| 36 | + .robot_max_speed_m_per_s = 3.0f, |
| 37 | + .robot_trajectory_max_speed_m_per_s = 2.5f, |
| 38 | + |
| 39 | + .robot_max_acceleration_m_per_s_2 = 4.5f, |
| 40 | + .robot_max_deceleration_m_per_s_2 = 3.0f, |
| 41 | + |
| 42 | + .robot_trajectory_max_acceleration_m_per_s_2 = 3.0f, |
| 43 | + .robot_trajectory_max_deceleration_m_per_s_2 = 2.0f, |
| 44 | + |
| 45 | + // Robot's angular movement constants |
| 46 | + .robot_max_ang_speed_rad_per_s = 10.0f, |
| 47 | + .robot_trajectory_max_ang_speed_rad_per_s = 7.0f, |
| 48 | + .robot_max_ang_acceleration_rad_per_s_2 = 30.0f, |
| 49 | + |
| 50 | + .wheel_radius_meters = 0.03f, |
| 51 | + |
| 52 | + .expected_lever_arm = 0.0749f, |
| 53 | + |
| 54 | + // Kalman filter variances for robot localizer |
| 55 | + .kalman_process_noise_variance_rad_per_s_4 = 1.0f, |
| 56 | + .kalman_vision_noise_variance_rad_2 = 0.01f * 0.01f, |
| 57 | + .kalman_motor_sensor_noise_variance_rad_per_s_2 = 0.5f}; |
| 58 | +} |
| 59 | +#elif CHECK_VERSION(2021) |
| 60 | +constexpr RobotConstants createRobotConstants() |
| 61 | +{ |
| 62 | + return { |
| 63 | + .robot_radius_m = static_cast<float>(ROBOT_MAX_RADIUS_METERS), |
| 64 | + .front_wheel_angle_deg = 32.06f, |
| 65 | + .back_wheel_angle_deg = 46.04f, |
| 66 | + |
| 67 | + .front_of_robot_width_meters = 0.11f, |
| 68 | + .dribbler_width_meters = 0.07825f, |
| 69 | + |
| 70 | + // Dribbler speeds are negative as that is the direction that sucks the ball in |
| 71 | + .indefinite_dribbler_speed_rpm = -10000, |
| 72 | + .max_force_dribbler_speed_rpm = -12000, |
| 73 | + |
| 74 | + // Motor constant |
| 75 | + .motor_max_acceleration_m_per_s_2 = 4.5f, |
| 76 | + |
| 77 | + // Robot's linear movement constants |
| 78 | + .robot_max_speed_m_per_s = 3.000f, |
| 79 | + .robot_trajectory_max_speed_m_per_s = 3.000f, |
| 80 | + .robot_max_acceleration_m_per_s_2 = 3.0f, |
| 81 | + .robot_max_deceleration_m_per_s_2 = 3.0f, |
| 82 | + .robot_trajectory_max_acceleration_m_per_s_2 = 3.0f, |
| 83 | + .robot_trajectory_max_deceleration_m_per_s_2 = 3.0f, |
| 84 | + |
| 85 | + // Robot's angular movement constants |
| 86 | + .robot_max_ang_speed_rad_per_s = 10.0f, |
| 87 | + .robot_trajectory_max_ang_speed_rad_per_s = 7.0f, |
| 88 | + .robot_max_ang_acceleration_rad_per_s_2 = 30.0f, |
| 89 | + |
| 90 | + .wheel_radius_meters = 0.03f, |
| 91 | + |
| 92 | + // Kalman filter variances for robot localizer |
| 93 | + .kalman_process_noise_variance_rad_per_s_4 = 0.5f, |
| 94 | + .kalman_vision_noise_variance_rad_2 = 0.01f * 0.01f, |
| 95 | + .kalman_motor_sensor_noise_variance_rad_per_s_2 = 0.5f * 0.5f}; |
| 96 | +} |
| 97 | +#endif |
| 98 | + |
| 99 | +} // namespace robot_constants |
0 commit comments