Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 1 | #include <unistd.h> |
| 2 | |
| 3 | #include <array> |
| 4 | #include <chrono> |
Tyler Chatow | bf0609c | 2021-07-31 16:13:27 -0700 | [diff] [blame] | 5 | #include <cinttypes> |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 6 | #include <cmath> |
Tyler Chatow | bf0609c | 2021-07-31 16:13:27 -0700 | [diff] [blame] | 7 | #include <cstdio> |
| 8 | #include <cstring> |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 9 | #include <functional> |
Tyler Chatow | bf0609c | 2021-07-31 16:13:27 -0700 | [diff] [blame] | 10 | #include <memory> |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 11 | #include <mutex> |
| 12 | #include <thread> |
| 13 | |
| 14 | #include "ctre/phoenix/CANifier.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 15 | |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 16 | #include "frc971/wpilib/ahal/AnalogInput.h" |
| 17 | #include "frc971/wpilib/ahal/Counter.h" |
| 18 | #include "frc971/wpilib/ahal/DigitalGlitchFilter.h" |
| 19 | #include "frc971/wpilib/ahal/DriverStation.h" |
| 20 | #include "frc971/wpilib/ahal/Encoder.h" |
| 21 | #include "frc971/wpilib/ahal/TalonFX.h" |
| 22 | #include "frc971/wpilib/ahal/VictorSP.h" |
| 23 | #undef ERROR |
| 24 | |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 25 | #include "ctre/phoenix6/TalonFX.hpp" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 26 | |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 27 | #include "aos/commonmath.h" |
| 28 | #include "aos/events/event_loop.h" |
| 29 | #include "aos/events/shm_event_loop.h" |
| 30 | #include "aos/init.h" |
| 31 | #include "aos/logging/logging.h" |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 32 | #include "aos/realtime.h" |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 33 | #include "aos/time/time.h" |
| 34 | #include "aos/util/log_interval.h" |
| 35 | #include "aos/util/phased_loop.h" |
| 36 | #include "aos/util/wrapping_counter.h" |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 37 | #include "frc971/autonomous/auto_mode_generated.h" |
| 38 | #include "frc971/control_loops/drivetrain/drivetrain_position_generated.h" |
James Kuszmaul | 7077d34 | 2021-06-09 20:23:58 -0700 | [diff] [blame] | 39 | #include "frc971/input/robot_state_generated.h" |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 40 | #include "frc971/wpilib/ADIS16448.h" |
| 41 | #include "frc971/wpilib/buffered_pcm.h" |
| 42 | #include "frc971/wpilib/buffered_solenoid.h" |
| 43 | #include "frc971/wpilib/dma.h" |
| 44 | #include "frc971/wpilib/drivetrain_writer.h" |
| 45 | #include "frc971/wpilib/encoder_and_potentiometer.h" |
| 46 | #include "frc971/wpilib/joystick_sender.h" |
| 47 | #include "frc971/wpilib/logging_generated.h" |
| 48 | #include "frc971/wpilib/loop_output_handler.h" |
| 49 | #include "frc971/wpilib/pdp_fetcher.h" |
| 50 | #include "frc971/wpilib/sensor_reader.h" |
| 51 | #include "frc971/wpilib/wpilib_robot_base.h" |
| 52 | #include "y2021_bot3/constants.h" |
| 53 | #include "y2021_bot3/control_loops/superstructure/superstructure_output_generated.h" |
| 54 | #include "y2021_bot3/control_loops/superstructure/superstructure_position_generated.h" |
| 55 | |
| 56 | using ::aos::monotonic_clock; |
| 57 | using ::y2021_bot3::constants::Values; |
| 58 | namespace superstructure = ::y2021_bot3::control_loops::superstructure; |
| 59 | namespace chrono = ::std::chrono; |
Vinay Siva | e52a6b3 | 2021-07-10 15:19:26 -0700 | [diff] [blame] | 60 | using std::make_unique; |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 61 | |
| 62 | namespace y2021_bot3 { |
| 63 | namespace wpilib { |
| 64 | namespace { |
| 65 | |
| 66 | constexpr double kMaxBringupPower = 12.0; |
| 67 | |
| 68 | // TODO(Brian): Fix the interpretation of the result of GetRaw here and in the |
| 69 | // DMA stuff and then removing the * 2.0 in *_translate. |
| 70 | // The low bit is direction. |
| 71 | |
| 72 | // TODO(brian): Use ::std::max instead once we have C++14 so that can be |
| 73 | // constexpr. |
| 74 | template <typename T> |
| 75 | constexpr T max(T a, T b) { |
| 76 | return (a > b) ? a : b; |
| 77 | } |
| 78 | |
| 79 | template <typename T, typename... Rest> |
| 80 | constexpr T max(T a, T b, T c, Rest... rest) { |
| 81 | return max(max(a, b), c, rest...); |
| 82 | } |
| 83 | |
| 84 | double drivetrain_translate(int32_t in) { |
| 85 | return ((static_cast<double>(in) / |
| 86 | Values::kDrivetrainEncoderCountsPerRevolution()) * |
| 87 | (2.0 * M_PI)) * |
| 88 | Values::kDrivetrainEncoderRatio() * |
| 89 | control_loops::drivetrain::kWheelRadius; |
| 90 | } |
| 91 | |
| 92 | double drivetrain_velocity_translate(double in) { |
| 93 | return (((1.0 / in) / Values::kDrivetrainCyclesPerRevolution()) * |
| 94 | (2.0 * M_PI)) * |
| 95 | Values::kDrivetrainEncoderRatio() * |
| 96 | control_loops::drivetrain::kWheelRadius; |
| 97 | } |
| 98 | |
| 99 | constexpr double kMaxFastEncoderPulsesPerSecond = |
| 100 | Values::kMaxDrivetrainEncoderPulsesPerSecond(); |
| 101 | static_assert(kMaxFastEncoderPulsesPerSecond <= 1300000, |
| 102 | "fast encoders are too fast"); |
| 103 | constexpr double kMaxMediumEncoderPulsesPerSecond = |
| 104 | kMaxFastEncoderPulsesPerSecond; |
| 105 | |
| 106 | static_assert(kMaxMediumEncoderPulsesPerSecond <= 400000, |
| 107 | "medium encoders are too fast"); |
| 108 | |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 109 | void PrintConfigs(ctre::phoenix6::hardware::TalonFX *talon) { |
| 110 | ctre::phoenix6::configs::TalonFXConfiguration configuration; |
| 111 | ctre::phoenix::StatusCode status = |
| 112 | talon->GetConfigurator().Refresh(configuration); |
| 113 | if (!status.IsOK()) { |
| 114 | AOS_LOG(ERROR, "Failed to get falcon configuration: %s: %s", |
| 115 | status.GetName(), status.GetDescription()); |
| 116 | } |
| 117 | AOS_LOG(INFO, "configuration: %s", configuration.ToString().c_str()); |
| 118 | } |
| 119 | |
| 120 | void WriteConfigs(ctre::phoenix6::hardware::TalonFX *talon, |
| 121 | double stator_current_limit, double supply_current_limit) { |
| 122 | ctre::phoenix6::configs::CurrentLimitsConfigs current_limits; |
| 123 | current_limits.StatorCurrentLimit = stator_current_limit; |
| 124 | current_limits.StatorCurrentLimitEnable = true; |
| 125 | current_limits.SupplyCurrentLimit = supply_current_limit; |
| 126 | current_limits.SupplyCurrentLimitEnable = true; |
| 127 | |
| 128 | ctre::phoenix6::configs::TalonFXConfiguration configuration; |
| 129 | configuration.CurrentLimits = current_limits; |
| 130 | |
| 131 | ctre::phoenix::StatusCode status = |
| 132 | talon->GetConfigurator().Apply(configuration); |
| 133 | if (!status.IsOK()) { |
| 134 | AOS_LOG(ERROR, "Failed to set falcon configuration: %s: %s", |
| 135 | status.GetName(), status.GetDescription()); |
| 136 | } |
| 137 | |
| 138 | PrintConfigs(talon); |
| 139 | } |
| 140 | |
| 141 | void Disable(ctre::phoenix6::hardware::TalonFX *talon) { |
| 142 | ctre::phoenix6::controls::DutyCycleOut stop_command(0.0); |
| 143 | stop_command.UpdateFreqHz = 0_Hz; |
| 144 | stop_command.EnableFOC = true; |
| 145 | |
| 146 | talon->SetControl(stop_command); |
| 147 | } |
| 148 | |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 149 | } // namespace |
| 150 | |
| 151 | // Class to send position messages with sensor readings to our loops. |
| 152 | class SensorReader : public ::frc971::wpilib::SensorReader { |
| 153 | public: |
| 154 | SensorReader(::aos::ShmEventLoop *event_loop) |
| 155 | : ::frc971::wpilib::SensorReader(event_loop), |
| 156 | auto_mode_sender_( |
| 157 | event_loop->MakeSender<::frc971::autonomous::AutonomousMode>( |
| 158 | "/autonomous")), |
| 159 | superstructure_position_sender_( |
| 160 | event_loop->MakeSender<superstructure::Position>( |
| 161 | "/superstructure")), |
| 162 | drivetrain_position_sender_( |
| 163 | event_loop |
| 164 | ->MakeSender<::frc971::control_loops::drivetrain::Position>( |
| 165 | "/drivetrain")) { |
| 166 | // Set to filter out anything shorter than 1/4 of the minimum pulse width |
| 167 | // we should ever see. |
| 168 | UpdateFastEncoderFilterHz(kMaxFastEncoderPulsesPerSecond); |
| 169 | UpdateMediumEncoderFilterHz(kMaxMediumEncoderPulsesPerSecond); |
| 170 | } |
| 171 | |
| 172 | // Auto mode switches. |
| 173 | void set_autonomous_mode(int i, ::std::unique_ptr<frc::DigitalInput> sensor) { |
| 174 | autonomous_modes_.at(i) = ::std::move(sensor); |
| 175 | } |
| 176 | |
| 177 | void RunIteration() override { |
| 178 | { |
| 179 | auto builder = drivetrain_position_sender_.MakeBuilder(); |
| 180 | frc971::control_loops::drivetrain::Position::Builder drivetrain_builder = |
| 181 | builder.MakeBuilder<frc971::control_loops::drivetrain::Position>(); |
| 182 | drivetrain_builder.add_left_encoder( |
| 183 | drivetrain_translate(drivetrain_left_encoder_->GetRaw())); |
| 184 | drivetrain_builder.add_left_speed( |
| 185 | drivetrain_velocity_translate(drivetrain_left_encoder_->GetPeriod())); |
| 186 | |
| 187 | drivetrain_builder.add_right_encoder( |
| 188 | -drivetrain_translate(drivetrain_right_encoder_->GetRaw())); |
| 189 | drivetrain_builder.add_right_speed(-drivetrain_velocity_translate( |
| 190 | drivetrain_right_encoder_->GetPeriod())); |
| 191 | |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 192 | builder.CheckOk(builder.Send(drivetrain_builder.Finish())); |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | { |
| 196 | auto builder = superstructure_position_sender_.MakeBuilder(); |
| 197 | superstructure::Position::Builder position_builder = |
| 198 | builder.MakeBuilder<superstructure::Position>(); |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 199 | builder.CheckOk(builder.Send(position_builder.Finish())); |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | { |
| 203 | auto builder = auto_mode_sender_.MakeBuilder(); |
| 204 | |
| 205 | uint32_t mode = 0; |
| 206 | for (size_t i = 0; i < autonomous_modes_.size(); ++i) { |
| 207 | if (autonomous_modes_[i] && autonomous_modes_[i]->Get()) { |
| 208 | mode |= 1 << i; |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | auto auto_mode_builder = |
| 213 | builder.MakeBuilder<frc971::autonomous::AutonomousMode>(); |
| 214 | |
| 215 | auto_mode_builder.add_mode(mode); |
| 216 | |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 217 | builder.CheckOk(builder.Send(auto_mode_builder.Finish())); |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 218 | } |
| 219 | } |
| 220 | |
| 221 | private: |
| 222 | ::aos::Sender<::frc971::autonomous::AutonomousMode> auto_mode_sender_; |
| 223 | ::aos::Sender<superstructure::Position> superstructure_position_sender_; |
| 224 | ::aos::Sender<::frc971::control_loops::drivetrain::Position> |
| 225 | drivetrain_position_sender_; |
| 226 | |
| 227 | ::std::array<::std::unique_ptr<frc::DigitalInput>, 2> autonomous_modes_; |
| 228 | }; |
| 229 | |
| 230 | class SuperstructureWriter |
| 231 | : public ::frc971::wpilib::LoopOutputHandler<superstructure::Output> { |
| 232 | public: |
| 233 | SuperstructureWriter(::aos::EventLoop *event_loop) |
| 234 | : ::frc971::wpilib::LoopOutputHandler<superstructure::Output>( |
| 235 | event_loop, "/superstructure") {} |
| 236 | |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 237 | void set_intake_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 238 | ::std::unique_ptr<::ctre::phoenix6::hardware::TalonFX> t) { |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 239 | intake_falcon_ = ::std::move(t); |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 240 | ConfigureRollerFalcon(intake_falcon_.get()); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | void set_outtake_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 244 | ::std::unique_ptr<::ctre::phoenix6::hardware::TalonFX> t) { |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 245 | outtake_falcon_ = ::std::move(t); |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 246 | ConfigureRollerFalcon(outtake_falcon_.get()); |
| 247 | } |
| 248 | |
| 249 | void set_climber_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 250 | ::std::unique_ptr<::ctre::phoenix6::hardware::TalonFX> t) { |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 251 | climber_falcon_ = ::std::move(t); |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 252 | ctre::phoenix6::configs::CurrentLimitsConfigs current_limits; |
| 253 | current_limits.SupplyCurrentLimit = Values::kClimberSupplyCurrentLimit(); |
| 254 | current_limits.SupplyCurrentLimitEnable = true; |
| 255 | |
| 256 | ctre::phoenix6::configs::TalonFXConfiguration configuration; |
| 257 | configuration.CurrentLimits = current_limits; |
| 258 | |
| 259 | ctre::phoenix::StatusCode status = |
| 260 | climber_falcon_->GetConfigurator().Apply(configuration); |
| 261 | if (!status.IsOK()) { |
| 262 | AOS_LOG(ERROR, "Failed to set falcon configuration: %s: %s", |
| 263 | status.GetName(), status.GetDescription()); |
| 264 | } |
| 265 | |
| 266 | PrintConfigs(climber_falcon_.get()); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 267 | } |
| 268 | |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 269 | private: |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 270 | void ConfigureRollerFalcon(::ctre::phoenix6::hardware::TalonFX *falcon) { |
| 271 | WriteConfigs(falcon, Values::kRollerSupplyCurrentLimit(), |
| 272 | Values::kRollerStatorCurrentLimit()); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | void WriteToFalcon(const double voltage, |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 276 | ::ctre::phoenix6::hardware::TalonFX *falcon) { |
| 277 | ctre::phoenix6::controls::DutyCycleOut control( |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 278 | std::clamp(voltage, -kMaxBringupPower, kMaxBringupPower) / 12.0); |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 279 | control.UpdateFreqHz = 0_Hz; |
| 280 | control.EnableFOC = true; |
| 281 | |
| 282 | falcon->SetControl(control); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | void Write(const superstructure::Output &output) override { |
| 286 | WriteToFalcon(output.intake_volts(), intake_falcon_.get()); |
| 287 | WriteToFalcon(output.outtake_volts(), outtake_falcon_.get()); |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 288 | |
| 289 | WriteToFalcon(-output.climber_volts(), climber_falcon_.get()); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 290 | } |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 291 | |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 292 | void Stop() override { |
| 293 | AOS_LOG(WARNING, "Superstructure output too old.\n"); |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 294 | Disable(climber_falcon_.get()); |
| 295 | Disable(intake_falcon_.get()); |
| 296 | Disable(outtake_falcon_.get()); |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 297 | } |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 298 | |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 299 | ::std::unique_ptr<::ctre::phoenix6::hardware::TalonFX> intake_falcon_, |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 300 | outtake_falcon_; |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 301 | |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 302 | ::std::unique_ptr<::ctre::phoenix6::hardware::TalonFX> climber_falcon_; |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 303 | }; |
| 304 | |
| 305 | class WPILibRobot : public ::frc971::wpilib::WPILibRobotBase { |
| 306 | public: |
| 307 | ::std::unique_ptr<frc::Encoder> make_encoder(int index) { |
| 308 | return make_unique<frc::Encoder>(10 + index * 2, 11 + index * 2, false, |
| 309 | frc::Encoder::k4X); |
| 310 | } |
| 311 | |
| 312 | void Run() override { |
| 313 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame] | 314 | aos::configuration::ReadConfig("aos_config.json"); |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 315 | |
| 316 | // Thread 1. |
| 317 | ::aos::ShmEventLoop joystick_sender_event_loop(&config.message()); |
| 318 | ::frc971::wpilib::JoystickSender joystick_sender( |
| 319 | &joystick_sender_event_loop); |
| 320 | AddLoop(&joystick_sender_event_loop); |
| 321 | |
| 322 | // Thread 2. |
| 323 | ::aos::ShmEventLoop pdp_fetcher_event_loop(&config.message()); |
| 324 | ::frc971::wpilib::PDPFetcher pdp_fetcher(&pdp_fetcher_event_loop); |
| 325 | AddLoop(&pdp_fetcher_event_loop); |
| 326 | |
| 327 | // Thread 3. |
| 328 | ::aos::ShmEventLoop sensor_reader_event_loop(&config.message()); |
| 329 | SensorReader sensor_reader(&sensor_reader_event_loop); |
| 330 | sensor_reader.set_drivetrain_left_encoder(make_encoder(0)); |
| 331 | sensor_reader.set_drivetrain_right_encoder(make_encoder(1)); |
| 332 | |
| 333 | AddLoop(&sensor_reader_event_loop); |
| 334 | |
| 335 | // Thread 4. |
| 336 | ::aos::ShmEventLoop output_event_loop(&config.message()); |
| 337 | ::frc971::wpilib::DrivetrainWriter drivetrain_writer(&output_event_loop); |
| 338 | drivetrain_writer.set_left_controller0( |
| 339 | ::std::unique_ptr<::frc::VictorSP>(new ::frc::VictorSP(0)), true); |
| 340 | drivetrain_writer.set_right_controller0( |
| 341 | ::std::unique_ptr<::frc::VictorSP>(new ::frc::VictorSP(1)), false); |
| 342 | |
| 343 | SuperstructureWriter superstructure_writer(&output_event_loop); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 344 | superstructure_writer.set_intake_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 345 | make_unique<::ctre::phoenix6::hardware::TalonFX>(0)); |
Vinay Siva | 62e3d32 | 2021-08-14 17:37:51 -0700 | [diff] [blame] | 346 | superstructure_writer.set_outtake_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 347 | make_unique<::ctre::phoenix6::hardware::TalonFX>(1)); |
Vinay Siva | 7cea8a8 | 2021-09-25 15:06:28 -0700 | [diff] [blame] | 348 | superstructure_writer.set_climber_falcon( |
Maxwell Henderson | 1c0843c | 2023-12-22 16:20:59 -0800 | [diff] [blame] | 349 | make_unique<::ctre::phoenix6::hardware::TalonFX>(2)); |
Ravago Jones | 486de80 | 2021-05-19 20:47:55 -0700 | [diff] [blame] | 350 | |
| 351 | AddLoop(&output_event_loop); |
| 352 | |
| 353 | RunLoops(); |
| 354 | } |
| 355 | }; |
| 356 | |
| 357 | } // namespace wpilib |
| 358 | } // namespace y2021_bot3 |
| 359 | |
| 360 | AOS_ROBOT_CLASS(::y2021_bot3::wpilib::WPILibRobot); |