you can right click on vex.h, use goto definition and then work your way down, however, here it is for reference. I should add that it’s deliberately very similar to the RobotMesh class of the same name.
vex_drivetrain.h
/*----------------------------------------------------------------------------*/
/* */
/* Copyright (c) Innovation First 2017, All rights reserved. */
/* */
/* Module: vex_drivetrain.h */
/* Author: James Pearman */
/* Created: 7 April 2019 */
/* */
/* Revisions: */
/* V1.00 TBD - Initial release */
/* */
/*----------------------------------------------------------------------------*/
#ifndef VCS_DRIVETRAIN_CLASS_H
#define VCS_DRIVETRAIN_CLASS_H
#include "vex_motorgroup.h"
/*-----------------------------------------------------------------------------*/
/** @file vex_drivetrain.h
* @brief Drivetrain class header
*//*---------------------------------------------------------------------------*/
namespace vex {
class drivetrain {
private:
vex::motor_group lm;
vex::motor_group rm;
double _wheel_circumference;
double _wheel_track;
int32_t _timeout;
bool _waitForCompletionAll();
double _distanceToRevs( double distance, distanceUnits units );
double _angleToRevs( double angle, rotationUnits units );
public:
drivetrain( motor_group &l, motor_group &r, double wheelTravel=320, double trackWidth=380, distanceUnits unit=distanceUnits::mm );
drivetrain( vex::motor &l, vex::motor &r, double wheelTravel=320, double trackWidth=380, distanceUnits unit=distanceUnits::mm );
~drivetrain();
/**
* @brief Sets the velocity of the drive based on the parameters set in the command. This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value.
* @param velocity Sets the amount of velocity.
* @param units The measurement unit for the velocity value.
*/
void setVelocity( double velocity, velocityUnits units );
/**
* @brief Sets the timeout for the motor group. If the motor group does not reach its' commanded position prior to the completion of the timeout, the motors will stop.
* @param time Sets the amount of time.
* @param units The measurement unit for the time value.
*/
void setTimeout( int32_t time, timeUnits units );
/**
* @brief Sets the stopping mode of the motor group by passing a brake mode as a parameter.
* @param mode The stopping mode can be set to coast, brake, or hold.
*/
void setStopping( brakeType mode );
/**
* @brief Turns the motors on, and drive in the specified direction
* @param dir The direction to drive.
*/
void drive( directionType dir ) ;
/**
* @brief Turn on the motors and drive in the specified direction and a specified velocity.
* @param dir The direction to drive.
* @param velocity Sets the amount of velocity.
* @param units The measurement unit for the velocity value.
*/
void drive( directionType dir, double velocity, velocityUnits units );
/**
* @brief Turn on the motors and drive a distance at the default velocity.
* @return Returns a Boolean that signifies when the motor has reached the target rotation value.
* @param distance Sets the distance to drive.
* @param units The measurement unit for the distance value.
* @param waitForCompletion (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
*/
bool driveFor( directionType dir, double distance, distanceUnits units, bool waitForCompletion=true );
/**
* @brief Turn on the motors and drive a distance at a specified velocity.
* @return Returns a Boolean that signifies when the motor has reached the target rotation value.
* @param distance Sets the distance to drive.
* @param units The measurement unit for the distance value.
* @param velocity Sets the amount of velocity.
* @param units_v The measurement unit for the velocity value.
* @param waitForCompletion (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
*/
bool driveFor( directionType dir, double distance, distanceUnits units, double velocity, velocityUnits inits_v, bool waitForCompletion=true );
/**
* @brief Turn on the motors and drive a distance at the default velocity but does not wait for the motors to stop.
* @param distance Sets the distance to drive.
* @param units The measurement unit for the distance value.
*/
void startDriveFor( directionType dir, double distance, distanceUnits units) ;
/**
* @brief Turn on the motors and drive a distance at a specified velocity but does not wait for the motors to stop.
* @param distance Sets the distance to drive.
* @param units The measurement unit for the distance value.
* @param velocity Sets the amount of velocity.
* @param units_v The measurement unit for the velocity value.
*/
void startDriveFor( directionType dir, double distance, distanceUnits units, double velocity, velocityUnits units_v );
/**
* @brief Turns the motors on, and rotate in the specified direction
* @param dir The direction to rotate the robot.
*/
void turn( turnType dir);
/**
* @brief Turns the motors on, and rotate in the specified direction and a specified velocity.
* @param dir The direction to rotate the robot.
* @param velocity Sets the amount of velocity.
* @param units The measurement unit for the velocity value.
*/
void turn( turnType dir, double velocity, velocityUnits units );
/**
* @brief Turn on the motors and rotate an angle at the default velocity.
* @return Returns a Boolean that signifies when the motor has reached the target rotation value.
* @param angle Sets the angle to turn.
* @param units The measurement unit for the angle value.
* @param waitForCompletion (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
*/
bool turnFor( turnType dir, double angle, rotationUnits units, bool waitForCompletion=true );
/**
* @brief Turn on the motors and rotate an angle at a specified velocity.
* @return Returns a Boolean that signifies when the motor has reached the target rotation value.
* @param angle Sets the angle to turn.
* @param units The measurement unit for the angle value.
* @param velocity Sets the amount of velocity.
* @param units_v The measurement unit for the velocity value.
* @param waitForCompletion (Optional) If true, your program will wait until the motor reaches the target rotational value. If false, the program will continue after calling this function. By default, this parameter is true.
*/
bool turnFor( turnType dir, double angle, rotationUnits units, double velocity, velocityUnits units_v, bool waitForCompletion=true );
/**
* @brief Turn on the motors and rotate an angle at the default velocity but do not wait for the motors to stop.
* @param angle Sets the angle to turn.
* @param units The measurement unit for the angle value.
*/
void startTurnFor (turnType dir, double angle, rotationUnits units );
/**
* @brief Turn on the motors and rotate an angle at a specified velocity but do not wait for the motors to stop.
* @param angle Sets the angle to turn.
* @param units The measurement unit for the angle value.
* @param velocity Sets the amount of velocity.
* @param units_v The measurement unit for the velocity value.
*/
void startTurnFor (turnType dir, double angle, rotationUnits units , double velocity, velocityUnits units_v );
/**
* @brief Checks to see if any of the motors are rotating to a specific target.
* @return Returns a true Boolean if the motor is on and is rotating to a target. Returns a false Boolean if the motor is done rotating to a target.
*/
bool isSpinning( void );
/**
* @brief Checks to see if all the motor are done rotating to a specific target.
* @return Returns a false Boolean if the motor is on and is rotating to a target. Returns a true Boolean if the motor is done rotating to a target.
*/
bool isDone( void );
/**
* @brief Stops the drive using the default brake mode.
*/
void stop();
/**
* @brief Stops the drive using a specified brake mode.
* @param mode The brake mode can be set to coast, brake, or hold.
*/
void stop( brakeType mode );
void arcade( double drivePower, double turnPower, percentUnits units=percentUnits::pct );
protected:
// Helper functions that can used by sub classes
double distanceToMm( double distance, distanceUnits units );
double angleToDeg( double angle, rotationUnits units );
int32_t timeoutGet();
};
};
#endif // VCS_DRIVETRAIN_CLASS_H
and vex::motor_group has the same method names as vex::motor (where it makes sense, there are a few ommitted, some things will only return a value for the first motor in the group )