Hey, i wanna test my auto code, but i don’t have that fency box.
is there any way of doing it?
Thanks =]
- Get the fancy box, or make one yourself using the “Competition Port Pinout Guide” on IFIRobotics.com
- Shove a paperclip or similar in the right pins on the competition port, based on the guide on IFIRobotics.com (NOT RECOMMENDED)
- Set team number to ZERO on the RC.
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.
I think you meant a 15-pin connector there Alan.
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…
Here’s how I tested my autonomous code:
-
Create a subroutine ‘Auto’ that contains my entire autonomous code.
-
Put the routine ‘Auto’ at the start of my User Controlled section as well as inside the Autonomous section.
-
Power up the bot and watch it run the ‘Auto’ routine (while in the User Controlled section).
-
Tweak and re-deploy (repeat until you like your ‘Auto’ routine).
-
Comment out (or flat out remove) ‘Auto’ from your User Controlled section.
Voila!
just be careful; if you short the wrong pins, then you might have to say goodbye to your OI
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
The IFI Operator Interface manual says that setting the Team Number to zero will cause the robot code to run in Autonomous Mode.
This used to work, BUT 2006 and later, the PWMs won’t be driven: From the OI Reference Guide on the IFI website:
A team number of zero is reserved for Autonomous Mode on the Robot Controller. Starting with the 2006 Robot Controller, a team number of zero will put the Robot Controller in Autonomous Mode, but the PWM outputs will be disabled. For more information on Autonomous Mode, see the Programming Reference Guide.
Why? There’s no way to turn off the robot.
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.
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
I always just modify the main loop so that it reads
if(autonomous || p4_sw_trig)
{
... calls into autonomous...
}
Plug in the port 4 joystick, hold trigger, and then your robot starts doing its autonomous routine. Let go, and it returns to teleop mode.
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.
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:
#define autonomous_mode 1
Boy, I wish I knew about the “set team number to 0” trick for this year. Much faster than uploading a different set of code. 1554 is 11000010010 in base 2, so we only have to change 4 switches.
If it works, then copy-paste the autonomous code into the default project.
We had a held button activate autonomous and learned one important thing.
If your code looks like
autonomous_mode = p3_sw_aux1;
, you may want to consider removing that line before your first match.
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
Yep, I found one team doing that. They were real disappointed when their robot wouldn’t move at all during autonomous on the playing field, but would in the pit.
Or make it yourself, which saves you the hassle of having to wait for it to come in the mail. If you have a radio shack nearby, look for a switch, and a 15 pin soldering connector. Wire the 8th and 5th pins to the switch, put it on a box (we used a cardboard box, just to give you an example). We added a disable-robot switch as well, using the 6th pin. Don’t know if you’d want that.