blob: 41019934464f9c5619ee202a5939046ad70e909b [file] [log] [blame]
Austin Schuhbcce26a2018-03-26 23:41:24 -07001#include "frc971/control_loops/drivetrain/drivetrain_uc.q.h"
2#include <inttypes.h>
3
4namespace frc971 {
5namespace control_loops {
6
7GearLogging::GearLogging() { Zero(); }
8
9void GearLogging::Zero() {
10 controller_index = 0;
11 left_loop_high = false;
12 right_loop_high = false;
13 left_state = 0;
14 right_state = 0;
15}
16
17CIMLogging::CIMLogging() { Zero(); }
18
19void CIMLogging::Zero() {
20 left_in_gear = false;
21 right_in_gear = false;
22 left_motor_speed = 0.0f;
23 right_motor_speed = 0.0f;
24 left_velocity = 0.0f;
25 right_velocity = 0.0f;
26}
27
28void DrivetrainQueue_Goal::Zero() {
29 wheel = 0.0f;
30 wheel_velocity = 0.0f;
31 wheel_torque = 0.0f;
32 throttle = 0.0f;
33 throttle_velocity = 0.0f;
34 throttle_torque = 0.0f;
35 highgear = false;
36 quickturn = false;
37 control_loop_driving = false;
38 left_goal = 0.0f;
39 right_goal = 0.0f;
Austin Schuhbcce26a2018-03-26 23:41:24 -070040 max_ss_voltage = 0.0f;
41 //linear.max_velocity = 0.0f;
42 //linear.max_acceleration = 0.0f;
43 //angular.max_velocity = 0.0f;
44 //angular.max_acceleration = 0.0f;
45}
46
47DrivetrainQueue_Goal::DrivetrainQueue_Goal() { Zero(); }
48
49void DrivetrainQueue_Position::Zero() {
50 left_encoder = 0.0f;
51 right_encoder = 0.0f;
52 left_speed = 0.0f;
53 right_speed = 0.0f;
54 left_shifter_position = 0.0f;
55 right_shifter_position = 0.0f;
56 low_left_hall = 0.0f;
57 high_left_hall = 0.0f;
58 low_right_hall = 0.0f;
59 high_right_hall = 0.0f;
60}
61
62DrivetrainQueue_Position::DrivetrainQueue_Position() { Zero(); }
63
64void DrivetrainQueue_Output::Zero() {
65 left_voltage = 0.0f;
66 right_voltage = 0.0f;
67 left_high = false;
68 right_high = false;
69}
70
71DrivetrainQueue_Output::DrivetrainQueue_Output() { Zero(); }
72
73void DrivetrainQueue_Status::Zero() {
74 robot_speed = 0.0f;
75 estimated_left_position = 0.0f;
76 estimated_right_position = 0.0f;
77 estimated_left_velocity = 0.0f;
78 estimated_right_velocity = 0.0f;
79 uncapped_left_voltage = 0.0f;
80 uncapped_right_voltage = 0.0f;
Austin Schuhbcce26a2018-03-26 23:41:24 -070081 left_voltage_error = 0.0f;
82 right_voltage_error = 0.0f;
83 profiled_left_position_goal = 0.0f;
84 profiled_right_position_goal = 0.0f;
85 profiled_left_velocity_goal = 0.0f;
86 profiled_right_velocity_goal = 0.0f;
87 estimated_angular_velocity_error = 0.0f;
88 estimated_heading = 0.0f;
89 output_was_capped = false;
90 ground_angle = 0.0f;
91 gear_logging.controller_index = 0;
92 gear_logging.left_loop_high = false;
93 gear_logging.right_loop_high = false;
94 gear_logging.left_state = 0;
95 gear_logging.right_state = 0;
96 cim_logging.left_in_gear = false;
97 cim_logging.right_in_gear = false;
98 cim_logging.left_motor_speed = 0.0f;
99 cim_logging.right_motor_speed = 0.0f;
100 cim_logging.left_velocity = 0.0f;
101 cim_logging.right_velocity = 0.0f;
102}
103
104DrivetrainQueue_Status::DrivetrainQueue_Status() { Zero(); }
105
106} // namespace control_loops
107} // namespace frc971