peripherals  1.4.2
RoadNarrows Robotics Hardware Peripherals Package
rnr::Mot Class Referenceabstract
Inheritance diagram for rnr::Mot:
rnr::MotDummy rnr::MotRoboteq rnr::MotRoboteqSmall

Classes

struct  IDFloatTupple
 
struct  IDIntTupple
 

Public Types

typedef std::vector< IDFloatTuppleVecSpeedTupples
 
typedef std::vector< IDIntTuppleVecSpeedRawTupples
 
typedef std::vector< int > VecMotID
 

Public Member Functions

 Mot (float maxSpeed, float minSpeed, float speedStepSize, float maxBrake, float minBrake, float brakeStepSize)
 
virtual int open (const std::string &devName, int baudRate)=0
 Function opens serial communication with motor controller device. More...
 
virtual int close ()=0
 Function closes serial communication with motor controller device. More...
 
virtual bool motIDIsValid (int motID)=0
 Function sends commands to the motor controller and receives responses from the motor controller. More...
 
virtual int setSpeed (int motID, float speed, units_t units=units_norm)=0
 Description. More...
 
virtual int setSpeed (VecSpeedTupples vecSpeedTupple, units_t units=units_norm)=0
 Function updates the speed of all motors simultaneously but individually. More...
 
virtual int stop (int motID)=0
 Function stops motor specified. More...
 
virtual int eStop ()=0
 Function simultaneously halts motor rotation for all motors by setting speeds to zero. More...
 
virtual int eStopRelease ()=0
 Function releases emergency stop condition and allows normal ops. More...
 
virtual int getCurrentLimits ()=0
 Function determines if a motor controller can monitor current. More...
 
virtual int setCurrentLimits (int motID, int current, units_t units=units_amp)=0
 Function sets minimum and maximum limits for current. More...
 
virtual int getCurrent (int motID, units_t units=units_amp)=0
 Function retrieves value for current load on a single motor. More...
 
virtual int getVoltageLimits ()=0
 Function retrieves value for current load on a single motor. More...
 
virtual int setVoltageLimits (int lowVoltage, int overVoltage)=0
 Function sets the minimum and maximum limits for applied voltage for all motors. More...
 
virtual int getVoltage ()=0
 Function retrieves value for voltage applied to a single motor. More...
 
virtual int setSpeedProfile (int motID, int accel, int decel=-1)=0
 Function retrieves value for voltage applied to a single motor. More...
 

Protected Attributes

float m_fMaxSpeed
 Function sets the acce1 leration rate for motors. More...
 
float m_fMinSpeed
 
float m_fSpeedStepSize
 
float m_fMaxBrake
 
float m_fMinBrake
 
float m_fBrakeStepSize
 

Detailed Description

Definition at line 63 of file Mot.h.

Member Function Documentation

virtual int rnr::Mot::close ( )
pure virtual

Function closes serial communication with motor controller device.

Uses SerDevClose to close serial connection. Returns: 0 on success, -1 on fail.

Implemented in rnr::MotRoboteq, and rnr::MotRoboteqSmall.

virtual int rnr::Mot::eStop ( )
pure virtual

Function simultaneously halts motor rotation for all motors by setting speeds to zero.

Needs to be passed:

Function simultaneously halts motor rotation for all motors and locks the motor controller. No further commands can be given until EStop Release function has been passed.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::eStopRelease ( )
pure virtual

Function releases emergency stop condition and allows normal ops.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::getCurrent ( int  motID,
units_t  units = units_amp 
)
pure virtual

Function retrieves value for current load on a single motor.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::getCurrentLimits ( )
pure virtual

Function determines if a motor controller can monitor current.

If feature is not defined by the user, the controller will not monitor current.

Function obtains current limit vaules from motor controller.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::getVoltage ( )
pure virtual

Function retrieves value for voltage applied to a single motor.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::getVoltageLimits ( )
pure virtual

Function retrieves value for current load on a single motor.

Function sets value for current supplied to a single motor.

Function sets value for current supplied to a single motor.

Function determines is a motor controller can monitor voltage.

If feature is not defined by the user, the controller will not monitor voltage.

Function retrieves voltage limits from motor controller.

Implemented in rnr::MotRoboteqSmall.

virtual bool rnr::Mot::motIDIsValid ( int  motID)
pure virtual

Function sends commands to the motor controller and receives responses from the motor controller.

Function uses SerDevWrite (libserial) to send commands over serial to the motor controllers, and uses recvResponse to receive echoed command responses as well as acknowledgements and query responses.

Returns:

Function is responsible for retrieving responses from motor controllers after a command has been sent.

Returns: nBytes (number of bytes sent in response) on success

Function checks for valid motor ID inputs.

Returns: 0 on success, -1 on fail.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::open ( const std::string &  devName,
int  baudRate 
)
pure virtual

Function opens serial communication with motor controller device.

Uses SerDevOpen to open serial connection with device (devName) Returns: File descriptor >=0 on success, -1 on fail.

Implemented in rnr::MotRoboteq, and rnr::MotRoboteqSmall.

virtual int rnr::Mot::setCurrentLimits ( int  motID,
int  current,
units_t  units = units_amp 
)
pure virtual

Function sets minimum and maximum limits for current.

alim

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::setSpeed ( int  motID,
float  speed,
units_t  units = units_norm 
)
pure virtual

Description.

Parameters
iddes
[out]minSpeeddes
Returns

Description

Parameters
iddes
[out]minSpeeddesmotSpeeds
Returns

motSpeeds

Function retrieves the speed of a specific motor.

Raw speed will be given.

Needs to be passed: Motor ID (1 or 2)

Returns: 0 on success, -1 upon failure.

Function updates the speed of a single motor.

Needs to be passed: A speed (-1 <= speed <= 1), and a motor id (0 = left, 1 = right) Returns: 0 on Success, -1 on incorrect speed, -2 on serial write fail.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::setSpeed ( VecSpeedTupples  vecSpeedTupple,
units_t  units = units_norm 
)
pure virtual

Function updates the speed of all motors simultaneously but individually.

Function uses a vector to consturct a string of commands which will then be sent to multiple motors.

Needs to be passed: motSpeeds vetor which includes a Motor ID (1 or 2) and a value between or equal to -1 and 1 for speed.

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::setSpeedProfile ( int  motID,
int  accel,
int  decel = -1 
)
pure virtual

Function retrieves value for voltage applied to a single motor.

Function sets voltage value for an indivifual motor.

Function sets voltage value for an individual motor.

Function determines if a motor controller can monitor torque.

If feature is not defined by the user, the controller will not monitor torque.

Function retrieves value for torque output for a single motor.

Function sets minimum and maximum limits for motor torque.

\ brief Function retrives tourque values from an individual motor.

\ brief Function retrives tourque values from an individual motor.

Function sets the torque value for an individual motor.

Higher torque values give the motor more turning strength.

Function sets the torque value for an individual motor.

Higher torque values give the motor more turning strength.

Function sets the acceleration rate for motors.

Values represent 'slope' of the velocity profile when motor speeds are changed. In the case of deceleration, this is analogous to the difference between coasting to a stop (high argument values) and stopping abruptly (low argument values).

Function sets the acceleration rate for motors.

Values represent 'slope' of the velocity profile when motor speeds are changed. In the case of deceleration, this is analogous to the difference between coasting to a stop (high argument values) and stopping abruptly (low argument values).

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::setVoltageLimits ( int  lowVoltage,
int  overVoltage 
)
pure virtual

Function sets the minimum and maximum limits for applied voltage for all motors.

Needs to be passed: Low Voltage limit (>=5) and a Over Voltage limit (>=29).

Implemented in rnr::MotRoboteqSmall.

virtual int rnr::Mot::stop ( int  motID)
pure virtual

Function stops motor specified.

Needs to be passed: Motor ID (1 or 2).

Implemented in rnr::MotRoboteqSmall.

Member Data Documentation

float rnr::Mot::m_fMaxSpeed
protected

Function sets the acce1 leration rate for motors.

Values represent 'slope' of the velocity profile when motor speeds are changed. In the case of deceleration, this is analogous to the difference between coasting to a stop (high argument values) and stopping abruptly (low argument values).

Definition at line 430 of file Mot.h.


The documentation for this class was generated from the following file: