Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   how to run auto? (http://www.chiefdelphi.com/forums/showthread.php?t=65968)

Tottanka 18-03-2008 07:07

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 =]

Racer26 18-03-2008 08:25

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.

Alan Anderson 18-03-2008 10:50

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.

Racer26 18-03-2008 11:52

Re: how to run auto?
 
Quote:

Originally Posted by Alan Anderson (Post 720211)
The best solution is to wire up a couple of switches to a 25-pin connector...

I think you meant a 15-pin connector there Alan.

Tottanka 18-03-2008 16:35

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..

aerophd2001 22-03-2008 01:18

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!

Eugene Fang 22-03-2008 01:20

Re: how to run auto?
 
Quote:

Originally Posted by Tottanka (Post 720444)
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..


just be careful; if you short the wrong pins, then you might have to say goodbye to your OI

Cow Bell Solo 22-03-2008 02:09

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

mluckham 23-03-2008 12:48

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.

garyk 23-03-2008 13:28

Re: how to run auto?
 
Quote:

Originally Posted by mluckham (Post 723097)
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:
Quote:

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.

tseres 23-03-2008 14:07

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

Bongle 23-03-2008 15:32

Re: how to run auto?
 
I always just modify the main loop so that it reads

Code:

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.

lingomaniac88 31-03-2008 21:09

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 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.

Chaos in a Can 01-04-2008 00:42

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;
, you may want to consider removing that line before your first match.

Matt H. 01-04-2008 01:28

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

Mark McLeod 01-04-2008 09:33

Re: how to run auto?
 
Quote:

Originally Posted by Chaos in a Can (Post 728265)
We had a held button activate autonomous and learned one important thing.
If your code looks like
Code:

autonomous_mode = p3_sw_aux1;
, you may want to consider removing that line before your first match.

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.

Un Luchador 01-04-2008 09:54

Re: how to run auto?
 
Quote:

Originally Posted by Matt H. (Post 728286)
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

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.


All times are GMT -5. The time now is 04:33.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi