the-gearheads / 2023Robot

is the code for 1189's freddie
Other
1 stars 0 forks source link

Wrist Mechanism #5

Open alrazzi opened 1 year ago

alrazzi commented 1 year ago

We need to write code to actuate the wrist mechanism on our 2023 robot. There are some options in going about this: 1) Encapsulating the wrist into its own subsystem (right click on the subsystems folder and create a subsystem, and write basic code for position control of the wrist. Possibly include an enum for 3 possible positions?) 2) Include the wrist as part of the existing Arm subsystem. 3) Unorthodox but...create a 'supersubsystem'. Essentially, you do 1) on this list and then create a subsystem that holds both the arm and wrist subsystems. You can then make it a state machine, and based on the state of the supersubsystem, you set the state of the arm and the wrist. If you don't know how to implement this, you can ignore this option lol.

Additional Notes: The wrist will be actuated by 1 spark max. We will use an absolute encoder (similar to the arm subsystem) We want position control for the wrist 3 Positions: Point the grabber towards the floor, point the grabber forwards, point the grabber upwards.

If you have any questions, ask here or on slack!

alrazzi commented 1 year ago

Update: After some deliberation on the optimal strategy to control the wrist, we decided that it should be dependent on the position of the arm. wrist

The driver can control the position of the arm (grey box) with their controller. However, they do not have direct control over the wrist (blue box). The code should read the current position of the arm and decide whether it falls in range (1), (2), or (3) (labelled in orange and separated by green dotted lines). If in range (1)--when the arm is ready to pick up from the feeder station or set a game element on one of the nodes--the wrist should be parallel to the ground. If in range (3)--when the arm is inside the robot--the wrist should point upwards. If in range (2), the wrist should change angle linearly with the arm, starting with being paralllel to the ground on the border with range (1) and approximately 60 degrees downwards by the time it reaches the border with range (3).

We can start with implementing ranges (1) and (3), and think about (2) afterwards.

(This will be our current setup. Later on, if we want to add override buttons to change the wrist position, we can do that then).