8 #ifndef INCLUDE_WALLABY_MOTORS_H_
9 #define INCLUDE_WALLABY_MOTORS_H_
99 int mtp(
int motor,
int speed,
int goal_pos);
119 int mrp(
int motor,
int speed,
int delta_pos);
132 void set_pid_gains(
int motor,
short p,
short i,
short d,
short pd,
short id,
short dd);
146 void get_pid_gains(
int motor,
short * p,
short * i,
short * d,
short * pd,
short *
id,
short * dd);
int mrp(int motor, int speed, int delta_pos)
Set a goal position (in ticks) for the motor to move to, relative to the current position.
void get_pid_gains(int motor, short *p, short *i, short *d, short *pd, short *id, short *dd)
Set the motor PID gains, represented as fractions.
void off(int motor)
Turns the specified motor off.
int mav(int motor, int velocity)
Set a goal velocity in ticks per second.
int setpwm(int motor, int pwm)
Set the motor pwm (percent power) command.
int move_at_velocity(int motor, int velocity)
Set a goal velocity in ticks per second. The range is -1500 to 1500, though motor position accuracy ...
int get_motor_position_counter(int motor)
Gets the current motor position.
int get_motor_done(int motor)
Check if the motor has reached it's goal.
void bk(int motor)
Moves the given motor backward at full power.
void clear_motor_position_counter(int motor)
Clears the motor position counter.
int move_relative_position(int motor, int speed, int delta_pos)
Set a goal position (in ticks) for the motor to move to, relative to the current position.
int freeze(int motor)
Active braking to stop a motor.
void alloff()
Turns all motors off.
void block_motor_done(int motor)
Wait until the motor is at it's goal.
void fd(int motor)
Moves the given motor forward at full power.
void motor(int motor, int percent)
Moves a motor at a percent velocity.
void ao()
Turns all motors off.
int mtp(int motor, int speed, int goal_pos)
Set a goal position (in ticks) for the motor to move to.
void motor_power(int motor, int percent)
Moves a motor at a percent power.
int gmpc(int motor)
Gets the current motor position.
int move_to_position(int motor, int speed, int goal_pos)
Set a goal position (in ticks) for the motor to move to. There are approximately 1500 ticks per moto...
void cmpc(int motor)
Clears the motor position counter.
void set_pid_gains(int motor, short p, short i, short d, short pd, short id, short dd)
Set the motor PID gains, represented as fractions.
void bmd(int motor)
Wait until the motor is at it's goal.
int getpwm(int motor)
Get the current motor pwm command.