![]() |
how to run auto?
Hey, i wanna test my auto code, but i don't have that fency box.
is there any way of doing it? Thanks =] |
Re: how to run auto?
1) Get the fancy box, or make one yourself using the "Competition Port Pinout Guide" on IFIRobotics.com
2) Shove a paperclip or similar in the right pins on the competition port, based on the guide on IFIRobotics.com (NOT RECOMMENDED) 3) Set team number to ZERO on the RC. |
Re: how to run auto?
The best solution is to wire up a couple of switches to a 15-pin connector and plug it into the competition port. See the Competition Port Pinout Guide on the IFI Robotics web site.
You can also write your program to call the autonomous routine when a button is pressed on the Operator Console, but that's not very convenient. You would need to change the while (autonomous_mode) statement to also check that button, and you have to be very careful about assuming anything about the state of the OI input values. |
Re: how to run auto?
Quote:
|
Re: how to run auto?
Thanks a lot guys, i just shortened pins 8 and 5, and it worked.
I am currently working on an auto box though, as it is a much better solution.. |
Re: how to run auto?
Here's how I tested my autonomous code:
1. Create a subroutine 'Auto' that contains my entire autonomous code. 2. Put the routine 'Auto' at the start of my User Controlled section as well as inside the Autonomous section. 3. Power up the bot and watch it run the 'Auto' routine (while in the User Controlled section). 4. Tweak and re-deploy (repeat until you like your 'Auto' routine). 5. Comment out (or flat out remove) 'Auto' from your User Controlled section. Voila! |
Re: how to run auto?
Quote:
just be careful; if you short the wrong pins, then you might have to say goodbye to your OI |
Re: how to run auto?
yeah make sure you have the right pins laid out, we just got a box from Radio Shack, got a push button(also from Radio) so auto was activated when pushed and then stopped once released(nice expecially when robot goes crazy). Plus we also got a switch for the disable function(which has also come in handy when little kids might drive the robot). and then got a cable from someplace online that the mentor ordered that came witha pin layout.
Make sure that you match up the correct wires |
Re: how to run auto?
The IFI Operator Interface manual says that setting the Team Number to zero will cause the robot code to run in Autonomous Mode.
|
Re: how to run auto?
Quote:
Quote:
The shorting-pins-out is a lousy idea, it's easy to smoke the OI (I've seen this done.) If you are determined to do it, make sure you have a spare OI. The next best thing is a 15 pin male connector with the two pins soldered together, at least you can yank it off. The KOP joysticks have all 15 pins in their connector - I haven't taken one apart but if the right wires are in the cable you could rewire one of its buttons to be 'Autonomous'. In this case make sure all the other wires in the connector are disconnected. |
Re: how to run auto?
we just put it in our teleop code, and place a jumper that activates it. also, a regular joystick button has to be pressed and held to keep executing the code. so far the only problems is that i always edit the code in autonomous.c and forget to add the function to teleop.c for testing. that always leads to confusion when we can't do any tests :S
|
Re: how to run auto?
I always just modify the main loop so that it reads
Code:
if(autonomous || p4_sw_trig)Then I mark off the port 4 joystick port on the OI so that no-one tries to use it in the competition. This way, you can immediately stop execution of autonomous by releasing the button if it starts doing something dangerous to humans or itself, you don't have to remember to copy code around, you don't risk frying your OI, and you don't need a special piece of hardware. |
Re: how to run auto?
This year, our team lost the switch we used to trigger autonomous, so I just created a duplicate project in MPLab that forced autonomous. So I changed one line in the default code under ifi_aliases.h to:
Code:
#define autonomous_mode 1If it works, then copy-paste the autonomous code into the default project. |
Re: how to run auto?
We had a held button activate autonomous and learned one important thing.
If your code looks like Code:
autonomous_mode = p3_sw_aux1; |
Re: how to run auto?
Please dont use a paper clip to short out the pins. We still have a fried OI from when our first club president decided we didn't need a dongle. Shorting the wrong pins could leaving you with out a method to test your autonomous code period.
AndyMark sells a very nice dongle for a reasonable price. It can be found here http://www.andymark.biz/am-0016.html |
| All times are GMT -5. The time now is 18:47. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi