Triggering Autonomous Without Controller?

Is it possible to trigger an autonomous program without a controller?

i was warned in a non-vex competition that i couldn’t sync the controller with the cortex to trigger autonomous. Is there another way to trigger the autonomous period? I’m allowed to use sensors and interact with the robot like in gateway and sack attack

Sure. For ROBOTC, just don’t use the competition template. I’m pretty sure you’d still have to set the Autonomous flag to true, though:

bIfiAutonomousMode = true;   // autonomous mode

I’m not using the competition template currently. Right now, i just use task main and run off of timer loops:

task main
do stuff

So with this format, i need to turn on both the controller and cortex in order for the autonomous to run(i think:confused:). Without both the controller and cortex on and connected, the robot wont run. However motors spin without vexnet when i compile code.

would i have to swap task main for something like task autonomous? Or do i need to create a while loop using that phrase or something? I only have maybe a days worth of self taught programming experience so i’m not that familiar with all the terminology…:o

Don’t change the task name–ROBOTC needs a “task main” to run. I don’t have my VEX stuff right now (it’s all in storage for a while), but if I recall correctly, all you need is to place that statement like so:

task main
  bIfiAutonomousMode = true; 

  //Do stuff 

Basically, the bIFIAutonomousMode variable tells the robot “when I’m set to true, don’t worry about what the VEXnet controller is doing, just run the code.”

Ah ok:) That’s clear. Ill test it out soon and let you know how it works

I think this is a read only variable.

Not sure I understand what you want to do. If the joystick is connected and you are using a competition template without field control then the usercontrol() task will be run. If you want to trigger an autonomous function from there just detect a switch (in a digital port on the robot for example) and run the autonomous code.

I need to be able to run an autonomous program with just the cortex. I need to be able to flip the power switch and the program will run the robot.

Currently, I flip the switch to the robot and controller on and the robot will run autonomous after the controllers connect.

Ok, so your code just goes in the “main” task. To run the code without the controller connected (no VEXnet etc) download as “USBonly” under the Robot->VEX cortex communication mode menu. Code should start when cortex is powered up.

Ahhh so that’s what that menu’s for. Thanks:)

Hmmm… I’m sure I had written to it a dozen times on my PIC. I’ve never used it with the Cortex, though. It may have changed to read only… :\

I checked, it is read only on the cortex. It’s set by information received from the master processor along with the joystick values and disabled status. I’ve never used the PIC controller, but the switch to the cortex pretty much changed everything as I understand it.

I don’t need to do this (purely intellectual question) but would it be possible to run the autonomous code instantaneously and initiate the VEXnet search later without touching the robot?

Not with the current master firmware.