Announcement

Collapse
No announcement yet.

Autonomous Program Help

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

  • Autonomous Program Help

    I was wondering if anyone had a center field autonomous program (preferably with an IR Seeker) so that I can study it and will have a better understanding of how the IR seeker works and how a robot acts upon different IR readings. Last year my team tried doing this, but was not able to get it working correctly.

    I would be very grateful if someone could provide a sample code of their center field autonomous program of the 2014-2015 season so it will help my team for this upcoming season.

    Thanks.

    From,
    chunkybears

  • #2
    If you have LabVIEW still going, you can try reading our FTC teams automounous which uses the IR Sensor. I do apoligize in advance for how the code reads, and a lack of comments.
    https://github.com/dmssargent/FTC_so.../autonomous.vi

    Comment


    • #3
      Originally posted by chunkybears View Post
      .. (preferably with an IR Seeker) so that I can study it and will have a better understanding of how the IR seeker works and how a robot acts upon different IR readings...
      Have you looked at the two IR Seeker OpMode examples provided in the Android SDK? They are pretty straight forward.

      Comment


      • #4
        Originally posted by dlevy View Post
        Have you looked at the two IR Seeker OpMode examples provided in the Android SDK? They are pretty straight forward.
        Honestly, the current IR Seeker OpMode example is pretty dismal.
        It assumes that you have a front looking seeker which gives you a 60 Deg center beam, and ignores the more accurate 5 Deg beams.
        It also doesn't make use of the beam intensities. It's a crude bang/bang tracker.

        This might be good for getting within 10" of a beacon, but it would not get you close enough actually score into any sort of goal.

        The key to using a seeker is to rotate it 30 Deg off-center and then you can use one of the narrow (5 Deg) "even number" beams to keep pointing at the beacon.

        To get even higher precision, once you have the beacon in one of the narrow beams, you can use the relative strength of the two adjacent sensor elements to decide if you are on the left of right side of beam center.
        This lest you wiggle towards the beacon and get within a fraction of an inch of center (once you get up close).

        Some good references are found here:

        http://www.usfirst.org/sites/default...icsR2-rev2.pdf

        http://www.usfirst.org/sites/default..._IR_Seeker.pdf

        http://www.usfirst.org/sites/default...nsor_Guide.pdf


        I've linked to a subvi that we've used in a previous year to center a rotating turret onto the beacon.
        We used this to place rings on the tic-tac-toe goal in 2013
        The seeker was mounted to the end of the scoring arm, and oriented so beam '6' was facing directly ahead.

        The code is basically determining a power level to send to the motor which rotates the turret.
        For any beam above or below 6, the code pulls a power level from an array of powers that just get bigger (in the correct direction) the further away you are.
        Once beam 6 is reached, the power level is calculated by taking the difference between the signal strengths of the two adjacent IR sensors. (See first doc linked above)
        When the two levels are very close, it is assumed that you are dead centered, so the VI sends out a boolean TRUE.

        http://gearsinc.org/images/FTC2818-Center-On-Beacon.vi

        This subVI is just called repeatedly as the robot approaches the goal.

        Note... Although this code is controlling the turret, rather than the drive train, we were able to slave the steering system to the turret position to have the robot follow the arm.

        Here is a clip showing it working.

        https://www.youtube.com/watch?v=OOtfu9y1Ogg

        Comment

        Working...
        X