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

From wikidb
Jump to: navigation, search
 
(6 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.
  
= Move the Robot in a Square Demo Code =
+
== References ==
  
* [https://github.com/edcepp/DeLaSalle/blob/main/DriveInASquareEpp.java DriveInASquareEpp.java]
+
The third diagram in the following reference will be a great help for setting the motor to cheive forward, sidewise, backward and turn movements.  
  
= Refined Demo Code =
+
* [https://gm0.org/en/latest/docs/software/tutorials/mecanum-drive.html gm zero Programming Tutorial - Mecanum Drivetrain]
 
+
'''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 ==
 
== Check Points ==
  
# Compute how many Ticks per millimeter the robot move forward.
+
Start with the DriveMecanumEpp.jave program you modified in the [[FTC Set Up the Mecanum Training Platform 20231025]] lab.
## 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 ==
+
=== Check Point 1 ===
  
* [https://gm0.org/en/latest/docs/software/tutorials/mecanum-drive.html gm zero Programming Tutorial - Mecanum Drivetrain]
+
* Modify the DriveMecanumEpp.jave program to move in a square by calling the GoForward and GoSideways methods each two times.
  
= Using the Android Debugging Bridge to Locate Bugs =
+
=== Check Point 2 ===
  
'''TBD''': Move to its own section - add instruction and ...
+
* And a method that turns the robot name TurnBy.
 
+
* [[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'''
+
=== Check Point 3 ===
  
== Additional References ==
+
* Use the new TurnBy and GoForward methods to drive the robot in a Square
  
To be screened.
+
=== Check Point 4 ===
  
* [https://developer.android.com/studio/command-line/adb Google Reference]
+
* Compare using the two methods for driving in a square.
* [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 11:37, 8 November 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.

References

The third diagram in the following reference will be a great help for setting the motor to cheive forward, sidewise, backward and turn movements.

Check Points

Start with the DriveMecanumEpp.jave program you modified in the FTC Set Up the Mecanum Training Platform 20231025 lab.

Check Point 1

  • Modify the DriveMecanumEpp.jave program to move in a square by calling the GoForward and GoSideways methods each two times.

Check Point 2

  • And a method that turns the robot name TurnBy.

Check Point 3

  • Use the new TurnBy and GoForward methods to drive the robot in a Square

Check Point 4

  • Compare using the two methods for driving in a square.