More details on NL auton issues

Hello, Here are some more details on this issue:

Using the code below I can reproduce the issue on two different robots. Once again the symptoms of the issue are that the natural language commands of forward() and backward() do not always work in autonomous. Other motor commands do work, including commands for the drivetrain.

In testing with this program the issue was not consistent. Sometimes one or two of the forward()/backward() commands were executed, sometimes all three, and sometimes the motors sounded like they were engaging, but the robot did not move. I used the competition switch simulator in RobotC to launch the auton. I started with the robot Disabled, did a Clear All, pressed Start, and then pressed Autonomous. Changing the following variables seemed to affect the likelihood that the forward/backward commands would be executed:

Not plugging in the partner controller
Not starting the “drive” task inside usercontrol()
Using setMotor() commands vs setMotorSpeed() inside the drive task
Setting bStopTasksBetweenModes = false; inside pre_auton()
Removing the openLoop setting from the motor configurations

However, none of these changes completely resolved the issue. After retesting the robot would again fail on the 2nd or 3rd try. Perhaps this is some type of timing issue and these changes have an impact on timing.

The one change that did consistently work (seven consecutive successes = consistent) was not starting the program when the competition switch simulator was set to “Disabled”. I stumbled upon this by accident. After testing something, leave the competition switch in Autonomous mode, then download the program so that auton starts automatically when you press Start. The forward() and reverse() commands always worked when running the test this way.

Of course, that’s not a solution, because in a real competition match the robots always start out disabled. For now, the only solution that we have is to not use the forward and backward commands.

#pragma config(Motor,  port2,           rightDriveMotors, tmotorVex393_MC29, reversed, driveRight)
#pragma config(Motor,  port9,           leftDriveMotors, tmotorVex393_MC29, driveLeft)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

#pragma platform(VEX2)
#pragma competitionControl(Competition)
#include "Vex_Competition_Includes.c"
#include "NatLang_CORTEX.c"

/*task drive()
while (true)

void pre_auton()
	bStopTasksBetweenModes = true;

task autonomous()


task usercontrol()

Screen Shot 2018-01-23 at 10.23.36 AM.png