autonomous aiming????

Hi, this is my first year programming a robot, and I was wondering if it was possible to switch to the autonomous mode so we can aim automatically?

There’s nothing magical about autonomous mode. Any code you use in autonomous mode can work in regular mode, and vice versa (with the obvious exception that in autonomous mode you don’t get useful inputs from the OI)

so you can push a button and it will aim and fire? that’s something if i can get it to work. Thanks!!!

what you do is you write a method that will aim and fire for you then you call it from autonomous when you want or you call it when a button is pressed on the OI

Better yet, have it aim continuously. If you can get that to work, when you push a button it can fire without delay.

In C, it’s called a function. :wink:

Your stuck in C++ land my friend.

I plan to have an aiming function called from the main loop and autonomous mode. It shouldnt be overly difficult, just take the vector returned by the cam (confidence is the magnitude) and aim the cannon. That is, assuming the cannon has feedback.

There are two pins in the competition port that you can connect in order to switch the robot controller into autonomous mode. You can find the pinout in the programming manual probably. Sorry I can’t give you more information, but it is really quite a simple manner. We made a nice little dongle that plugs into the competition port with two switches: one for auton and one for disable.

Chris,

The information you refer to is here but I’m not sure that this answers the question…

Mike

Pclements,

Please realize that the competition port is not available during the competition. However…

You could have an aiming function which is called from both autonomous and normal modes. Is this more in line with what you are asking?

Mike

Chris,

The information you refer to is here but I’m not sure that this answers the question…

No, you’re wrong, I definitely answered the question, for I have amazing powers of observation.

Mr. Betts was just noting that the guy was not actually asking how to switch to autonomous, but how to get his shooting device to always automatically track the goal. :slight_smile:

yes it is, i was just thinking about that. how can you do that in the C program?

Ok, you both are right. we need to be able to aim the cannon and shoot the ball into the big giant hole, but we really don’t know how to program it to do that. and yes, I am stuck in C++ land.

No im stuck in C# and JAVA where i have always called them methods