My mistake, still only available for Windows and Mac for now. (That’s what I get for being lazy and copy / pasting the same template from the other threads)
I’m curious about the details of the DriveTrain class provided by Vex with regards to the Gyro/Inertial sensor. Would @jpearman (or other Vex staff) be able to describe how the DriveTrain class makes use of the Gyro/Inertial sensors?
A drivetrain that is created with a gyro or inertial sensor will use the sensor when the drivetrain is asked to make turns. The specific class member functions that use these sensors are turnFor, turnToHeading and turnToRotation.
Drivetrain.turnToHeading( 90 , degrees );
will turn the robot to a heading of 90 degrees (heading is like a compass heading now, 0 to 359.99 degrees). The robot will always take the shortest route to achieve the new heading.
Drivetrain.turnFor( 90, degrees );
will turn the robot 90 degrees starting at the current heading, that is, relative to the current starting position.
Drivetrain.turnToRotation( 500, degrees );
will turn the robot to an absolute rotation of 500 degrees, the robot may turn through more than 360 degrees to achieve this.
nope, we only use it for turns.
The drivetrain is just supposed to help you get started, especially in text, For advanced control you need to write your own code.
Im not sure how much this will help but here is the code I wrote for our X-drive, Mecanum should be able to function using the same code.
P.S.
FL = Front Left
BR = Back Right
etc;
int DriveTrainCallback()
{
while(true)
{
FLI = Controller1.Axis3.position(vex::percentUnits::pct) +
(1 * Controller1.Axis4.position(vex::percentUnits::pct)) +
Controller1.Axis1.position(vex::percentUnits::pct) - Goff;
BLI = Controller1.Axis3.position(vex::percentUnits::pct) -
(1 * Controller1.Axis4.position(vex::percentUnits::pct)) +
Controller1.Axis1.position(vex::percentUnits::pct) - Goff;
FRI = (-1 * Controller1.Axis3.position(vex::percentUnits::pct)) +
(1 * Controller1.Axis4.position(vex::percentUnits::pct)) +
Controller1.Axis1.position(vex::percentUnits::pct) - Goff;
BRI = (-1 * Controller1.Axis3.position(vex::percentUnits::pct)) -
(1 * Controller1.Axis4.position(vex::percentUnits::pct)) +
Controller1.Axis1.position(vex::percentUnits::pct) - Goff;