Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Follow the goal example from Team 330

  1. #1
    Join Date
    Sep 2008
    Posts
    586

    Default Follow the goal example from Team 330

    Two color vision tracking code was released for both C++ and LabVIEW (links at http://usfirst.org/frccontrolsystem).

    We used the example code inside the Basic LabVIEW framework and created an autonomous program to follow the goal, maintaining a distance away from it. The only sensor used was the camera, and the robot uses a 2 motor tank style drivetrain.

    I'd recommend using the official example first, to make sure all the color tracking is correct (and it has more controls for adjusting other things). The attached code also includes the portion of code from the official example that we used.

    PID constants in the Autonomous Independent will probably need to be tweaked for your robot. Our robot was geared to about 7 feet per second, but we've only run at about 1/3 speed so far. We've only used proportional control so far. The robot will search for the target by turning slowly towards the direction it last saw a target.

    See the following video which shows the robot following the target around, and discriminating friendly targets from the opponents targets, and choosing the largest target if two opponents targets are visible. http://www.youtube.com/watch?v=15nqy7hKixA
    Attached Files Attached Files
    Team 330 beta tester

  2. #2
    Join Date
    Oct 2005
    Location
    Inverness, FL
    Posts
    71

    Default Re: Follow the goal example from Team 330

    Thank you for sharing this. Your team has done a great job!
    Mike Betts

    Alumnus, Team 177, Bobcat Robotics, 1995 - 2010

    As easy as 355/113...

  3. #3
    Join Date
    Jan 2009
    Posts
    3

    Default Re: Follow the goal example from Team 330

    Awesome! Thanks for sharing!
    I would be very grateful if you could answer what part in code controlling distance to stop from target?

  4. #4
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Follow the goal example from Team 330

    In autonomous independent, it uses how tall the target appears. You can change the Y setpoint control on the front panel to change the height in pixels that it goes to.

    One possible enhancement would be to figure out the formula to convert pixels to actual distance, and change everything to use distance.
    Team 330 beta tester

  5. #5
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Follow the goal example from Team 330

    We've now set it so when it gets within a range of the goal, it fires our catapult. Adding that code to the example posted above was easy.

    See http://www.youtube.com/watch?v=t0o-yFnE8m8
    Team 330 beta tester

  6. #6
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Follow the goal example from Team 330

    With a few modifications to the above example, we made it shoot our catapult when within a range of the goal.

    See http://www.youtube.com/watch?v=t0o-yFnE8m8
    Team 330 beta tester

  7. #7
    Join Date
    Jan 2009
    Location
    Stillwater
    Posts
    1

    Default Re: Follow the goal example from Team 330

    I have the tracking successfully converted into distance in feet, it is surprisingly accurate ill throw up a sample of the conversion I used to estimate distance based on % area that is outputted from the official first example.

    Ben

  8. #8
    Join Date
    Jan 2009
    Posts
    2

    Default Re: Follow the goal example from Team 330

    I tried the code on one of the three robots I work with. It spun around in circles until the colors where inside the camera's field of vision, after that it moved forward for about half a second and kept spinning. The camera servos did nothing.

    Is this the way it's supposed to act?

  9. #9
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Follow the goal example from Team 330

    The code does not use the servos. if you have the camera mounted in the provided gimbal, you should either mechanically constrain the gimbal so it doesn't flop around or drive the servos so it doesn't move.

    It does rotate the robot to search for the target. You can look at the displays on the front panel of robot main to see what the camera sees. My guess is that if you get to close, the target goes off the screen.
    Team 330 beta tester

  10. #10
    Join Date
    Jan 2009
    Posts
    2

    Default Re: Follow the goal example from Team 330

    Quote Originally Posted by jross View Post
    With a few modifications to the above example, we made it shoot our catapult when within a range of the goal.

    See http://www.youtube.com/watch?v=t0o-yFnE8m8
    hello team 330
    very nice job,
    may you please send us example of this code, we try to active a shooter ball while the camera sense the distance from the target.

    we are first year in competitionand we will be very glad to get some help

    thanks

    team 3073

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •