![]() |
roneos
Operating System for the r-one robot
|
Functions that control the two motors on the rone. More...
Go to the source code of this file.
Functions | |
void | motorInit (void) |
Initializes motor. More... | |
void | motorTimeoutStop (void) |
Turns off the motors at a low level. More... | |
void | motorCommandTimerUpdate (void) |
Updates the motor command timer. More... | |
void | motorBrake (uint32 motor) |
Brakes one motor with the specified duty cycle. More... | |
void | motorSetPWM (uint32 motor, int32 dutyCycle) |
Sets PWM duty cycle for the specified motor if remote control mode is off. More... | |
int32 | motorGetVelocity (uint32 motor) |
Gets the current velocity of the specified motor. More... | |
void | motorSetVelocity (uint32 motor, int32 velocity) |
Sets the velocity of the specified motor if remote control mode is off. More... | |
void | motorSetVelocity_rc (uint32 motor, int32 velocity) |
Sets the velocity of the specified motor. Should not be called by user. More... | |
void | motorSetTVRV (int32 tv, int32 rv) |
Sets the translation and radial velocity of the motors if remote control mode is off. More... | |
void | motorSetTVRV_rc (int32 tv, int32 rv) |
Sets the translation and radial velocity of the motors. Should not be called by the user. Call motorSetTVRV instead. More... | |
void | motorGetTVRV (int32 *tvPtr, int32 *rvPtr) |
Gets the translational and radial velocity of the motor. More... | |
boolean | waypointMoveDone (void) |
Returns whether current waypoint has been reached. More... | |
void | waypointMove (Pose *posePtr, int32 speed) |
MotorCommandMode set so that waypoint behavior can be set with absolute coordinates. Sets Goal point and speed accodrding to Parameters. More... | |
void | waypointMoveRelative (Pose *posePtr, int32 speed) |
MotorCommandMode set so that waypoint behavior can be set with relative coordinates. Sets Goal point and speed accodrding to Parameters. More... | |
void | waypointMoveTheta (Pose *posePtr, int32 speed) |
MotorCommandMode set so that waypoint behavior can be set with absolute coordinates for theta. Sets Goal point and speed accodrding to Parameters. More... | |
void | waypointMoveThetaRelative (Pose *posePtr, int32 speed) |
MotorCommandMode set so that waypoint behavior can be set with relative coordinates for theta. Sets Goal point and speed accodrding to Parameters. More... | |
void | motorVelocityUpdate (void) |
Updates the velocity data for both motors. Does this for both coordinates and theta. More... | |
Functions that control the two motors on the rone.
void motorBrake | ( | uint32 | motor) |
Brakes one motor with the specified duty cycle.
motor | (left or right) |
void motorCommandTimerUpdate | ( | void | ) |
Updates the motor command timer.
If no motor command has been received, timeout and enables the charger. This function should be called at 10 hz.
void motorGetTVRV | ( | int32 * | tvPtr, |
int32 * | rvPtr | ||
) |
Gets the translational and radial velocity of the motor.
tvPtr | pointer to the desired translational velocity |
rvPtr | pointer to the desired rotational velocity |
int32 motorGetVelocity | ( | uint32 | motor) |
Gets the current velocity of the specified motor.
motor | left or right motor |
void motorInit | ( | void | ) |
Initializes motor.
Enables PWM and initializes the motorVelocityData struct for both left and right motor. Also sets the command timer to 0
void motorSetPWM | ( | uint32 | motor, |
int32 | dutyCycle | ||
) |
Sets PWM duty cycle for the specified motor if remote control mode is off.
Sets PWM duty cycle for the specified motor for both reverse and forward signals.
motor | left or right motor |
dutyCycle | duty cycle of PWM |
void motorSetTVRV | ( | int32 | tv, |
int32 | rv | ||
) |
Sets the translation and radial velocity of the motors if remote control mode is off.
tv | the translational velocity |
rv | the rotational velocity |
void motorSetTVRV_rc | ( | int32 | tv, |
int32 | rv | ||
) |
Sets the translation and radial velocity of the motors. Should not be called by the user. Call motorSetTVRV instead.
tv | the translational velocity |
rv | the rotational velocity |
void motorSetVelocity | ( | uint32 | motor, |
int32 | velocity | ||
) |
Sets the velocity of the specified motor if remote control mode is off.
motor | left or right motor |
velocity | motor velocity to be set in mm/s |
void motorSetVelocity_rc | ( | uint32 | motor, |
int32 | velocity | ||
) |
Sets the velocity of the specified motor. Should not be called by user.
motor | left or right motor |
velocity | motor velocity to be set in mm/s |
void motorTimeoutStop | ( | void | ) |
Turns off the motors at a low level.
void motorVelocityUpdate | ( | void | ) |
Updates the velocity data for both motors. Does this for both coordinates and theta.
void waypointMove | ( | Pose * | posePtr, |
int32 | speed | ||
) |
MotorCommandMode set so that waypoint behavior can be set with absolute coordinates. Sets Goal point and speed accodrding to Parameters.
posePtr | - Pointer to postion of Goal |
speed |
boolean waypointMoveDone | ( | void | ) |
Returns whether current waypoint has been reached.
void waypointMoveRelative | ( | Pose * | posePtr, |
int32 | speed | ||
) |
MotorCommandMode set so that waypoint behavior can be set with relative coordinates. Sets Goal point and speed accodrding to Parameters.
posePtr | - Pointer to postion of Goal |
speed |
void waypointMoveTheta | ( | Pose * | posePtr, |
int32 | speed | ||
) |
MotorCommandMode set so that waypoint behavior can be set with absolute coordinates for theta. Sets Goal point and speed accodrding to Parameters.
posePtr | - Pointer to postion of Goal |
speed |
void waypointMoveThetaRelative | ( | Pose * | posePtr, |
int32 | speed | ||
) |
MotorCommandMode set so that waypoint behavior can be set with relative coordinates for theta. Sets Goal point and speed accodrding to Parameters.
posePtr | - Pointer to postion of Goal |
speed |