Announcement

Collapse
No announcement yet.

Servo Program for Teleop Problems

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

  • Servo Program for Teleop Problems

    Hi! I have been working for a while now on our Teleop program (We're using MIT App inventor). We recently have added a servo to our robot, but I am having issues writing a program for it (I will attach some screenshots). I used the example program in the FTC guides but it's not working in our program.
    Thanks!

    Here's the link to our program-https://drive.google.com/file/d/0B8auxa-cKTTDVks4NkZmSGdFVjNfN25DYVVpUWZpX3VfNUFv/view?usp=sharing

  • #2
    Maddy, where is global deltaPos coming from?

    At first glance it seems like you are working too hard on this.

    If [FtcGamepad2] [Y]
    Then [set servo1 position to] [[1]]

    If [FtcGamepad2] [A]
    Then [set servo1 position to] [[0]]

    My team did something similar with a pair of servos connected to a bumper, where we wanted the bumper to be all the way up (to fit in the 18" box) , halfway up (to clear the tracks when climbing the ramps, but not blocking our arm on top of the robot) and all the way down (to push debris). Here is a screen shot of a portion of our teleop loop

    https://drive.google.com/file/d/0Bxz...ew?usp=sharing

    I'm assuming this is a loop mode?

    Good Luck!

    Justin

    Comment


    • #3
      Not that it helps you with programming servos, but when you want to set a motor's power or servo's position to one of the buttons or triggers, you don't have to clip the ranges. The buttons and triggers work in boolean, so they never exceed the values of 1 or -1. Just a helpful bit of info.
      FTC 8567 -Lead Programmer, 3-D Print Specialist, Lead CAD Designer

      Comment


      • #4
        Wait, I messed up. The buttons and triggers give values of 1 or 0. Not 1 or -1. Sorry for the mistake
        FTC 8567 -Lead Programmer, 3-D Print Specialist, Lead CAD Designer

        Comment


        • #5
          Buttons give a boolean value of true or false, not 1 or 0. Triggers return float a between 0.0 and 1.0.

          Comment


          • #6
            Originally posted by Psyche View Post
            Not that it helps you with programming servos, but when you want to set a motor's power or servo's position to one of the buttons or triggers, you don't have to clip the ranges. The buttons and triggers work in boolean, so they never exceed the values of 1 or -1. Just a helpful bit of info.
            Just an FYI, the triggers give values from 0 to 1 in AI. The FtcRobotController.RangeClip function also doesn't work. We've had issues where it fails to clip values above 1 (our gamepad.LeftStickY gives values up to 1.3 sometimes) and situations where it overclips, rejecting values below 0.55. We will bring this up with Tom Eng once we have it all documented. Anyway, any basic custom rangeclipping function should work fine.

            Comment

            Working...
            X