No announcement yet.

instructions for the op modes

  • Filter
  • Time
  • Show
Clear All
new posts

  • instructions for the op modes

    There is a list of op modes that came with the robot controller app. How do you know what each op mode is looking for as far as motors and servos. How do we know which ports to plug them into, what to name them, and which buttons on the Logitech controllers apply to each motor? If a rookie team like us wanted to use one of the provided op modes, we have to know what goes where and what name the program is looking for.

  • #2
    I believe page 67 of the FTCTrainingManual v0.92 is what explains this. To go in some detail each line that resembles:
    motorRight = hardwareMap.dcMotor.get("motor_2");
    should help you figure this out, motorRight means the right hand motor is named "motor_2" via the motor naming activity. I don't believe it matters of what port you are pluged into as long as the motor is named as such.

    The gamepads are named gamepad1 and gamepad2 and come from the super class. The checking if buttons are pressed uses statements like
    if (gamepad1.x) {
       // I am doing something when gamepad1's X button is pressed
    The joysticks are accessed via expressions like:
    float left = -gamepad1.left_stick_y
    Whichs build a new variable named "left" with the presicion of float, assigned to the value of gamepad1.left_stick_y * -1

    That is what I know by reading the code, feel free to correct me if the behavior is different.


    • #3
      Where do we find the code?


      • #4
        In Android Studio, the path to the OpModes is FtcRobotController > java > com.qualcomm.ftcrobotcontroller > OpModes. In Explorer (Windows browsing tool) it is ftc_app/FtcRobotController/src/main/java/com/qualcomm/ftcrobotcontroller/OpModes