The
autonomous_mode variable is controlled by the part of the default code which communicates with the master CPU. It reflects the state of one of the pins on the competition port on the OI. Your software should never try to change its value. The FIRST field hardware will take care of it for you.
The usual way to enter autonomous mode for testing is to physically connect a switch to the appropriate pins on the competition port. See the
Competiton Port Pinout Guide documentation for details.