PROS - Global reverse motor

Is there something I’m missing in PROS for the equivalent of globally flipping a motor in ROBOTC?
Not that’s any problem just adding


-1 *

to everything. But would be a nice feature to have

Within PROS there is no global configuration for the cortex like what RobotC generates for you due to the fact that the PROS kernel is meant to be as lightweight and minimal as possible. Instead PROS has the flexibility to enable programmers to implement this logic in whichever way makes the most sense to them.

For the Purdue team in the past we abstracted the critical components of the robot such as the drivetrain, intake, ferry, and flywheels into their own functions to make it very easy to control. Within those functions we set the power values +/- for them so that they would behave as we expected. I have included below an example of what that would look like.

/*
 * motors.h
 *
 *  Motor port definitions for Newton
 *
 *  Created on: Nov 12, 2015
 *      Author: Javid
 */

#ifndef MOTORS_H_
#define MOTORS_H_

/********************************************************************************
 *                                                                              *
 *                          MOTOR DEFINITIONS                                   *
 *                                                                              *
*********************************************************************************/

/////////////////////////// DRIVE MOTORS ////////////////////////////////////////
#define MOTOR_LEFT_1	1
#define MOTOR_LEFT_2	2
#define MOTOR_RIGHT_1	9
#define MOTOR_RIGHT_2	10
#define MOTOR_STRAFE	5		// Strafe motors are tied together on a y cable

/////////////////////////// FLYWHEEL MOTORS /////////////////////////////////////
#define MOTOR_FLYWHEEL_LEFT_1	3
#define MOTOR_FLYWHEEL_LEFT_2	4
#define MOTOR_FLYWHEEL_RIGHT	8

/////////////////////////// INTAKE MOTORS ///////////////////////////////////////
#define MOTOR_INTAKE	6
#define MOTOR_FERRY	7


/********************************************************************************
 *                                                                              *
 *                          MOTOR BASIC FUNCTIONS                               *
 *                                                                              *
*********************************************************************************/
// Movement Helper Functions
void setDrive(int left, int right);
void setFlywheel(int left, int right);
void setStrafe(int power);
void setIntake(int power);
void setFerry(int power);

#endif /* MOTORS_H_ */
/*
 * motors.c
 *
 *  Basic motor controls for Newton
 *
 *  Created on: Nov 12, 2015
 *      Author: Javid
 */

#include "main.h"

// set power to drive motors
//	+ value makes robot drive forward
//	- value makes robot drive reverse
void setDrive(int left, int right) {
	motorSet(MOTOR_LEFT_1, -left);
	motorSet(MOTOR_LEFT_2, -left);
	motorSet(MOTOR_RIGHT_1, right);
	motorSet(MOTOR_RIGHT_2, -right);
}

// set power to strafe motors
//	+ value makes robot strafe right
//	- value makes robot strafe left
void setStrafe(int power) {
	motorSet(MOTOR_STRAFE, -power);
}

// set power to intake motor
//  + value makes intake eat
//  - value makes intake spit
void setIntake(int power) {
	motorSet(MOTOR_INTAKE, power);
}

// set power to the ferry motor
//  + value makes the ferry lift towards the flywheels
//  - value makes the ferry rotate towards the intake
void setFerry(int power) {
	motorSet(MOTOR_FERRY, power);
}

// set power to flywheels
void setFlywheel(int left, int right) {
	// Power to flywheels should be either 0 or positive, negative values will ratchet
	left = (left < 0) ? 0 : left;
	right = (right < 0) ? 0 : right;

	motorSet(MOTOR_FLYWHEEL_LEFT_1, left);
	motorSet(MOTOR_FLYWHEEL_LEFT_2, left);
	motorSet(MOTOR_FLYWHEEL_RIGHT, -right);
}

That’s what I’ve done too. It’s not a big deal. But I am very impressed with PROS so far and will keep using it.

When will the Atom plugin and CLI be ready for public release?