StimDc / FTC_2022-2023

de ce merge?
BSD 3-Clause Clear License
3 stars 0 forks source link

Add slider and make it functional #4

Open RunaAM opened 1 year ago

RunaAM commented 1 year ago

TO DO:

RunaAM commented 1 year ago

UPDATE 17.01.23

Today we started constructing an arm for the robot to grasp cones and move them to those yellow pillars. We have installed a rotatory base (a wheel with a diameter of 15 cm and a rev core hex motor where the slider will be fixed ). To program this new motor we have created some new function named slider_base_rotate() which is similar to the rotate() function because it takes the same parameter: degrees , power and direction. After implementing a rudimentary implementation and testing the motor would not move. We thought the problem was a hardware kind and to prove that we implemented in the control part file so that everytime the button X and Y on the gamepad1 is pressed the wheel would spin left or right. When we started the program the wheel moved fine without a problem. We debugged the code for half and hour and found out that the motor would move to the right but not to the left, the cause of that was that the distance would be positive no matter what even though the code for changing direction was: if(dir == "right"){ distance = distance; }else if(dir == "left){ distance = -distance; } We changed distance to degrees and the code ran fine: if(dir == "right"){ degrees =degrees; }else if(dir == "left){ degrees = -degrees; }

After resolving the issue we have refactored the code:

RunaAM commented 1 year ago

Update 22.01.23

Today i worked from home on the StimDC class and made these following changes:

RunaAM commented 1 year ago

Update 23.01.23 -> 29.01.23

This week we have further optimised the StimDC class because the robot would sometimes wait seconds when stopping, reseting encoders, enabling encoders etc before 22.01.23 and started experimenting with Kotlin by cloning the StimDc class and renaming KStimDC for differentiating from each other