73 int16_t ticksPerIntervalTurn = (
robotRadius * 3.14 / 180.0) *
83 forwardSpeed = forwardDistance > 0 ? fabs(forwardSpeed) : -fabs(forwardSpeed);
102 turningSpeed = turnAngle > 0 ? fabs(turningSpeed) : -fabs(turningSpeed);
void idle(void)
Idles chassis. Motors will stop.
const uint16_t ctrlIntervalMS
const float cmPerEncoderTick
void turnFor(float turnAngle, float turningSpeed, bool block=false)
Commands the chassis to turn a set angle.
void updateEncoderDeltas()
void init(void)
Initializes the chassis. Must be called in setup().
void driveFor(float forwardDistance, float forwardSpeed, bool block=false)
Commands the robot to drive at a distance and speed.
bool checkMotionComplete(void)
Checks if the motion commanded by driveFor() or turnFor() is done.
void setTwist(float forwardSpeed, float turningSpeed)
Sets target motion for the chassis.
void setMotorEfforts(int leftEffort, int rightEffort)
Sets motor efforts. Max speed is 420.
void printEncoderCounts(void)
void setMotorPIDcoeffs(float kp, float ki)
Sets PID coefficients for the motors. Not independent.
void setWheelSpeeds(float leftSpeed, float rightSpeed)
Sets target wheel speeds in cm/sec.
void setMotorEffort(int16_t effort)
void setMotorEffort(int16_t effort)
void setTargetSpeed(float targetSpeed)
void calcEncoderDelta(void)
void setPIDCoeffients(float kp, float ki)
void moveFor(int16_t amount)