Autonomous Problem

We are programming autonomous into the competition template, but when we activate autonomous it does not work. How does autonomous actually start? Should it begin right when you turn on you’re cortex, or like a video game where you press any button to start.

// Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;

// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, …
}

/////////////////////////////////////////////////////////////////////////////////////////
//
// Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task autonomous()
{
//StartTask(autonomous);

// autonomous

wait10Msec(10);
motor [frontMotor]= -127;
motor [backMotor]= -127;
wait10Msec (20);

Is it a program problem, cortex problem that can’t be fixed, or maybe even a controller problem? Maybe a combination of both. If you have any idea’s they are greatly appreciated

Post the whole program, perhaps attach the source file, I want to know what you do after that last 200mS wait.

#pragma config(Motor, port2, leftMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port3, rightMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port4, frontMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port5, backMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port6, SonicMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port7, clawMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port8, Isaac2000, tmotorServoContinuousRotation, openLoop)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//

#pragma platform(VEX)

//Competition Control and Duration Settings
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(105)

#include “Vex_Competition_Includes.c” //Main competition background code…do not modify!

/////////////////////////////////////////////////////////////////////////////////////////
//
// Pre-Autonomous Functions
//
// You may want to perform some actions before the competition starts. Do them in the
// following function.
//
/////////////////////////////////////////////////////////////////////////////////////////
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
// Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
bStopTasksBetweenModes = true;

// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...

}

/////////////////////////////////////////////////////////////////////////////////////////
//
// Autonomous Task
//
// This task is used to control your robot during the autonomous phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task autonomous()
{
//StartTask(autonomous);

// autonomous

wait10Msec(10);
motor [frontMotor]= -127;
motor [backMotor]= -127;
wait10Msec (20);

}
/////////////////////////////////////////////////////////////////////////////////////////
//
// User Control Task
//
// This task is used to control your robot during the user control phase of a VEX Competition.
// You must modify the code to add your own robot specific commands here.
//
/////////////////////////////////////////////////////////////////////////////////////////

task usercontrol()
{

	while(1 == 1)
	{



// This is the main execution loop for the user control program. Each time through the loop
  // your program should update motor + servo values based on feedback from the joysticks.

  // .....................................................................................
  // Insert user code here. This is where you use the joystick values to update your motors, etc.
  // .....................................................................................

motor[leftMotor]  = (vexRT[Ch3] - vexRT[Ch1])/2;  // (y + x)/2
motor[rightMotor] = (vexRT[Ch3] + vexRT[Ch1])/2;  // (y - x)/2

motor[frontMotor]  = (vexRT[Ch4]);
motor[backMotor] = (vexRT[Ch4]);

 motor[SonicMotor]  = 125*vexRT[Btn6U] - 125*vexRT[Btn6D];
motor[Isaac2000]  = 127*vexRT[Btn6U] - 127*vexRT[Btn6D];

motor[clawMotor] = 127vexRT[Btn5D] - 127vexRT[Btn5U];

}

}

Ok, that will do.

So this is what happens when the autonomous part of your code runs (the task below).

task autonomous()
{
//StartTask(autonomous);

// autonomous

wait10Msec(10);
motor [frontMotor]= -127;
motor [backMotor]= -127;
wait10Msec (20);
}

You wait for 1/10 of a second.
You send a control value of -127 to two motors, the ones on ports 4 & 5, you have these set as the original 3-wire motors.
You wait for 1/5 of a second.
The task exits.

When the tasks exits the motors you started should remain running and would be stopped at the end of the autonomous period when under field control.

If you use the ROBOTC debugger can you see the motors start in the motors debug window?

If you are not using a competition switch then your user control task will run, is this what happens? Have you tried using the competition switch simulator in ROBOTC? This is a debug window that is activated from the robot/debugger windows menu.