Robot Autonomous Not Move Robot

First, I apologise for the very long winded response…

So lets break down the needs of your robot in autonomous. From what I understand, you need to (1.) read your encoders, (2.) update your position from odometry, (3.) update the motor speed according to the goal position on the field. This motion could be “blind” or just a move for time or distnace, or based on the odometry information.

Remember that a robot can only execute one command at a time. When a function is called like autonomous(), it will run commands one-by-one from top to bottom unless something else redirects the program flow. The while() statment will force the program to loop through the commands inside of its brackets as long as the the condition inside of it is true or nonzero. In your function, this is the only code that will run.

 void autonomous(void) {
   //Reset Encoders
   RightDriveEncoder.resetRotation();
   LeftDriveEncoder.resetRotation();
   BackDriveEncoder.resetRotation();

   LeftDrive.setVelocity(15, percent);
   RightDrive.setVelocity(15, percent);
   LeftIntake.setVelocity(100, percent);
   RightIntake.setVelocity(100, percent);
   TopSnail.setVelocity(100, percent);
   BottomSnail.setVelocity(100, percent);

    while(true){
     RightCurrentValue = RightDriveEncoder.value();

     if(RightPreviousValue == 0){
          RightPreviousValue = RightCurrentValue;
     }
     else{
     RightChange = RightCurrentValue - RightPreviousValue;
     RightPreviousValue = RightCurrentValue;  
     }
     wait(100, msec);
    }

Because the while statement is always true, the other loops will not be able to run. Your code is essentially copying and pasting these lines forever.

As a general rule, you only want one while loop running at a time. I will describe an exception to this rule later. Your robot must do all needed tasks(odometry, motors,etc.) within this while loop. Here is a super high-level overview of what the code might look like.

void odometryUpdate()
{
  // update the odometry/encoder info(no while loop)
}
void driveTo(/*Inputs, speed, location, etc)*/
{
  while(/* not at target*/)
  {
    // update the odometry information
    odometryUpdate();
    // do things to get you to location
  }
}

void autonomous(void)
{
   driveTo(/*where am I going*/);
...
}

Notice I only placed one while loop in the driveTo function. driveTo updated the odometry at every step as well as running the motors. In order to run multiple while loops, you need to use something called tasks, which allow for multiple functions to run at the same time. This is advanced coding which I don’t recommend you use for the moment. I have added a link to some discussion about this coding stategy below.