Skip to main content
Version: 3.2.1

Drive Constructors

Integrated Encoders​

This is the standard setup that uses built in motor encoders.

left_motor_ports input {1, -2...}. make ports negative if reversed
right_motor_ports input {-3, 4...}. make ports negative if reversed
imu_port port the IMU is plugged into
wheel_diameter diameter of your drive wheels
ticks motor cartridge RPM
ratio external gear ratio, wheel gear / motor gear

Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports, int imu_port, 
double wheel_diameter, double ticks, double ratio = 1.0);

ADI Encoders in Brain​

warning

This function is deprecated! You can learn how to add different tracking wheel configurations here.

note

This only support two parallel trackers that are equidistant from the center of the robot.

left_motor_ports input {1, -2...}. make ports negative if reversed
right_motor_ports input {-3, 4...}. make ports negative if reversed
imu_port port the IMU is plugged into
wheel_diameter diameter of your sensored wheel
ticks ticks per revolution of your encoder
ratio external gear ratio, wheel gear / sensor gear
left_tracker_ports input {1, 2}. make ports negative if reversed
right_tracker_ports input {3, 4}. make ports negative if reversed

Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports, int imu_port, 
double wheel_diameter, double ticks, double ratio, std::vector<int> left_tracker_ports,
std::vector<int> right_tracker_ports);

ADI Encoders in Expander​

warning

This function is deprecated! You can learn how to add different tracking wheel configurations here.

note

This only support two parallel trackers that are equidistant from the center of the robot.

left_motor_ports input {1, -2...}. make ports negative if reversed
right_motor_ports input {-3, 4...}. make ports negative if reversed
imu_port port the IMU is plugged into
wheel_diameter diameter of your sensored wheel
ticks ticks per revolution of your encoder
ratio external gear ratio, wheel gear / sensor gear
left_tracker_ports input {1, 2}. make ports negative if reversed
right_tracker_ports input {3, 4}. make ports negative if reversed
expander_smart_port port the expander is plugged into

Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports, int imu_port, 
double wheel_diameter, double ticks, double ratio, std::vector<int> left_tracker_ports,
std::vector<int> right_tracker_ports, int expander_smart_port);

Rotation Sensor​

warning

This function is deprecated! You can learn how to add different tracking wheel configurations here.

note

This only support two parallel trackers that are equidistant from the center of the robot.

left_motor_ports input {1, -2...}. make ports negative if reversed
right_motor_ports input {-3, 4...}. make ports negative if reversed
imu_port port the IMU is plugged into
wheel_diameter diameter of your sensored wheel
ratio external gear ratio, wheel gear / sensor gear
left_rotation_port make ports negative if reversed
right_rotation_port make ports negative if reversed

Drive(std::vector<int> left_motor_ports, std::vector<int> right_motor_ports, int imu_port, 
double wheel_diameter, double ratio, int left_rotation_port, int right_rotation_port);