Announcement

Collapse
No announcement yet.

Tele-Op Glitching

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tele-Op Glitching

    Hi, our team's tele-op program occasionally stops working. It returns us to the tele-op screen on the robot brain, so neither the tele-op or the normal controls work until we bring it back to driver control mode. What could be causing this problem?

  • #2
    We also have the same problem. We are using RobotC.

    Comment


    • #3
      There are few possibilities. One is that your program just finishes. That is what a typical auton program does, but teleop structure mostly runs inside an infinite loop, so that shouldn't be it.
      Other is that you explicitly exit your program - perhaps a misplaced break or something.
      But most likely, in my opinion, is that your program crashes somehow. Division by zero?
      Maybe you can post your sources?

      Comment


      • #4
        This is the code our team is using:
        #pragma config(Sensor, port3, colorSensor, sensorNone)
        #pragma config(Sensor, port4, gyroSensor, sensorVexIQ_Gyro)
        #pragma config(Sensor, port8, lineTracker, sensorNone)
        #pragma config(Motor, motor1, leftMotor, tmotorVexIQ, openLoop, driveLeft, encoder)
        #pragma config(Motor, motor6, rightMotor, tmotorVexIQ, openLoop, reversed, driveRight, encoder)
        #pragma config(Motor, motor10, armMotor, tmotorVexIQ, PIDControl, encoder)
        #pragma config(Motor, motor11, clawMotor, tmotorVexIQ, PIDControl, encoder)
        //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// task main()
        {
        waitUntil (getJoystickValue(BtnFDown) == 1);
        resetTimer(T1);
        repeatUntil (getTimer(T1, seconds) >= 60) {
        if (getJoystickValue(BtnFDown) == 1) {
        turnRight(563, degrees, 50);
        } else {
        if (getJoystickValue(BtnFUp)==1){
        turnLeft(284, degrees, 50);
        } else {
        tankControl(ChD, ChA, 10);
        armControl(armMotor, BtnLUp, BtnLDown, 100);
        armControl(clawMotor, BtnEUp, BtnEDown, 100);
        } // end of else
        } // end of if
        } // end of repeatUntil
        } // end of main

        Comment


        • #5
          As nenik suggested, this program simply finishes. Looks like it's set to run for 60 seconds after FDown is pressed. After that time, the program ends.

          Is that what you want?

          Comment


          • #6
            Oh, yeah. I'm not the person who wrote the code, so I just copied it here. I'll ask the guy who wrote it about that. Thanks!

            Comment

            Working...
            X