roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
motor.h File Reference

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...
 

Detailed Description

Functions that control the two motors on the rone.

Since
Mar 23, 2011
Author
James McLurkin

Function Documentation

void motorBrake ( uint32  motor)

Brakes one motor with the specified duty cycle.

Parameters
motor(left or right)
Returns
void
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.

Returns
void
void motorGetTVRV ( int32 *  tvPtr,
int32 *  rvPtr 
)

Gets the translational and radial velocity of the motor.

Parameters
tvPtrpointer to the desired translational velocity
rvPtrpointer to the desired rotational velocity
Returns
void
int32 motorGetVelocity ( uint32  motor)

Gets the current velocity of the specified motor.

Parameters
motorleft or right motor
Returns
the current velocity; 0 if the input parameter is not recognized
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

Returns
void
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.

Parameters
motorleft or right motor
dutyCycleduty cycle of PWM
Returns
void
void motorSetTVRV ( int32  tv,
int32  rv 
)

Sets the translation and radial velocity of the motors if remote control mode is off.

Parameters
tvthe translational velocity
rvthe rotational velocity
Returns
void
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.

Parameters
tvthe translational velocity
rvthe rotational velocity
Returns
void
void motorSetVelocity ( uint32  motor,
int32  velocity 
)

Sets the velocity of the specified motor if remote control mode is off.

Parameters
motorleft or right motor
velocitymotor velocity to be set in mm/s
Returns
void
void motorSetVelocity_rc ( uint32  motor,
int32  velocity 
)

Sets the velocity of the specified motor. Should not be called by user.

Parameters
motorleft or right motor
velocitymotor velocity to be set in mm/s
Returns
void
void motorTimeoutStop ( void  )

Turns off the motors at a low level.

Returns
void
void motorVelocityUpdate ( void  )

Updates the velocity data for both motors. Does this for both coordinates and theta.

Returns
void
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.

Parameters
posePtr- Pointer to postion of Goal
speed
Returns
void
boolean waypointMoveDone ( void  )

Returns whether current waypoint has been reached.

Returns
waypointDone boolean that keeps track of whether the current waypoint has been reached or not
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.

Parameters
posePtr- Pointer to postion of Goal
speed
Returns
void
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.

Parameters
posePtr- Pointer to postion of Goal
speed
Returns
void
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.

Parameters
posePtr- Pointer to postion of Goal
speed
Returns
void