Team-OKC-Robotics / FRC-2022-CPP

a c++ port of our FRC-2022 code as training in C++
Other
0 stars 2 forks source link

Port Climber code from Java to C++ #7

Open jkleiber opened 1 year ago

jkleiber commented 1 year ago

Summary The climber code from 2022 is written in Java. We use C++ now, so it needs to be transferred

Work Required

Verification

Deferred Work

danielbrownmsm commented 1 year ago

code from last year https://github.com/Team-OKC-Robotics/FRC-2022/blob/dev/src/main/java/frc/robot/subsystems/ClimberSubsystem.java (dev branch, master has the more complicated version that doesn't work)

jkleiber commented 1 year ago

This is going to be limited to Climber and ClimberIO. Network Tables, constants and button bindings are deferred work

danielbrownmsm commented 1 year ago

The climber code is kind of unique because it written so that the climbers could be hot-swappable (you could quickly remove one and put in another). The issue is that the two different motors had two different CAN IDs. The smart idea would be to just change the CAN ID, but no, we I made it where two separate motors were programmed inside the Climber subsystem, for the two different IDs, and the code checked to see if either were null and then just set the power. This is kind of jank, but it's what we had last season and it (kind of) worked.

danielbrownmsm commented 1 year ago

But we don't have to be like this for this repository. See following spec for phase 1 specification:

Hardware actuators:

sensors:

Functions

danielbrownmsm commented 1 year ago

If you want to get advanced, see phase 2 spec:

Hardware actuators:

sensors:

Functions

Periodic Periodically (in the Periodic function of the subsystem), the climber should:

danielbrownmsm commented 1 year ago

If you really want to get advanced (even beyond what I would/could do), see phase 3 spec: I recommend against this because a) we don't have this functionality, b) we don't have some of the hardware mentioned, c) I wouldn't be able to do this, and d) this is kind of a joke

Hardware actuators:

sensors:

Functions

Periodic Periodically (in the Periodic function of the subsystem), the climber should: