Difference between revisions of "FTC Make Coding Easier with Methods 20230112"

From wikidb
Jump to: navigation, search
(Check Points)
(Refined Demo Code)
 
(14 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
* Makes code more reliable by allowing us to use the same code over and over.
 
* Makes code more reliable by allowing us to use the same code over and over.
  
= More the Robot in a Square Demo Code =
+
= Move the Robot in a Square Demo Code =
  
 
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveInASquareEpp.java DriveInASquareEpp.java]
 
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveInASquareEpp.java DriveInASquareEpp.java]
  
= Check Points =
+
== Check Points ==
  
 
# Copy the Drive In A Square program to your robot and test it.
 
# Copy the Drive In A Square program to your robot and test it.
# Investigate a simplified outline of the move in a square program. See [[FTC Drive In a Square Outline 20230112]].
+
# Investigate a simplified outline of the move in a square program to help you understand how to write methods. See [[FTC Drive In a Square Outline 20230112]].
 
# Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches.
 
# Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches.
 
# Modify the program to work with 4 motors so you can support the Mecanum drivetrain.
 
# Modify the program to work with 4 motors so you can support the Mecanum drivetrain.
 +
 +
= Refined Demo Code =
 +
 +
'''TBD''': Complete code refinements and integrate into this lab.
 +
 +
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveMecanumEpp.java DriveMecanumEpp.java]
 +
 +
Simplified PowerUpMotors to us Ticks for distance and velocity. Add GoForward and GoSideways helper methods
 +
 +
== Check Points ==
 +
 +
# Compute how many Ticks per millimeter the robot move forward.
 +
## Sidesize
 +
## Why are they different
 +
# Find a web reference computer these values based on Mecadum wheels size and motor configuration
 +
# Do the computations and compare with your test results
 +
# Measure how well the moveForward method drove the robot straight
 +
## How does speed and distance impact
 +
 +
== References ==
 +
 +
* [https://gm0.org/en/latest/docs/software/tutorials/mecanum-drive.html gm zero Programming Tutorial - Mecanum Drivetrain]
 +
 +
= Using the Android Debugging Bridge to Locate Bugs =
 +
 +
'''TBD''': Move to its own section - add instruction and ...
 +
 +
* [[FTC adb Android Debugging Bridge 202008]]: My notes
 +
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveInASquareEppLog.java DriveInASquareEppLog.java]: The Drive in a Square program with debugging capabilities added.
 +
* [[FTC Starting up the Debugger Summary 20230308]]
 +
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveInASquareEppLog.txt DriveInASquareEppLog.txt]: Example subset of log file
 +
 +
== Check Points ==
 +
 +
'''TBD'''
 +
 +
== Additional References ==
 +
 +
To be screened.
 +
 +
* [https://developer.android.com/studio/command-line/adb Google Reference]
 +
* [https://www.firstinspires.org/sites/default/files/uploads/resource_library/ftc/control-system-troubleshooting-guide.pdf FIRST Troubleshooting  reference - See chapter 15, page 72]
 +
* [https://gist.github.com/Pulimet/5013acf2cd5b28e55036c82c91bd56d8 Adb Commands]

Latest revision as of 13:28, 24 March 2023

Why Use Abstraction

  • Makes the program easier to think about
  • Makes is easier to test programs - we can test small part individually
  • Makes the code easier to user over and over saving time. We can more easily takes code from one program and use it somewhere else.
  • Makes code more reliable by allowing us to use the same code over and over.

Move the Robot in a Square Demo Code

Check Points

  1. Copy the Drive In A Square program to your robot and test it.
  2. Investigate a simplified outline of the move in a square program to help you understand how to write methods. See FTC Drive In a Square Outline 20230112.
  3. Modify the program to move forward 18 inches, turn left 90 degrees, and move backward 12 inches.
  4. Modify the program to work with 4 motors so you can support the Mecanum drivetrain.

Refined Demo Code

TBD: Complete code refinements and integrate into this lab.

Simplified PowerUpMotors to us Ticks for distance and velocity. Add GoForward and GoSideways helper methods

Check Points

  1. Compute how many Ticks per millimeter the robot move forward.
    1. Sidesize
    2. Why are they different
  2. Find a web reference computer these values based on Mecadum wheels size and motor configuration
  3. Do the computations and compare with your test results
  4. Measure how well the moveForward method drove the robot straight
    1. How does speed and distance impact

References

Using the Android Debugging Bridge to Locate Bugs

TBD: Move to its own section - add instruction and ...

Check Points

TBD

Additional References

To be screened.