Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Servo Class Reference

A Servo Controller Class. More...

#include <servo.h>

Inheritance diagram for Servo:

SSC List of all members.

Public Member Functions

 Servo (int sscServoNumber, float startAngle, float minAngle, float sscValue_4_minAngle, float maxAngle, float sscValue_4_maxAngle)
 Short Description.
float setAngle (float degree)
 Short Description.
float getAngle (void)

Protected Attributes

float angle
float max_angle
float min_angle
float A
float B

Detailed Description

A Servo Controller Class.

Does a fine translation from an angle input to a SSC output value. It also makes aure any angle setting stays within a certain renge.

Usage: The class needs to know the minimum/maximum allowable angle inputs, and the servo values that coorespond to them.

Example: Say we have a servo that we want to be able to move between the angles of 90 and 180 degrees. First we figure out what SSC value will move the servo to 90 degrees. Assume for the example it is 200. Then minAngle = 90 and sscValue_4_minAngle = 200 Next we figure out what SSC value for the max angle, assume it is 100. Then maxAngle = 180 and sscValue_4_maxAngle = 100

Note: Even though the example uses degrees, radians could be used. The only real requirement is that the minAngle must be less than the maxAngle because the code will make sure that any angle setting that is made will not be smaller than the minAngle or larger than the maxAngle.Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 74 of file servo.h.


Constructor & Destructor Documentation

Servo::Servo int  sscServoNumber,
float  startAngle,
float  minAngle,
float  sscValue_4_minAngle,
float  maxAngle,
float  sscValue_4_maxAngle
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 15 of file servo.cpp.

References A, B, max_angle, min_angle, and setAngle().


Member Function Documentation

float Servo::getAngle void   )  [inline]
 

Definition at line 84 of file servo.h.

References angle.

Referenced by fhwInterface::getAngle(), and hwInterface::getAngle().

float Servo::setAngle float  degree  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 42 of file servo.cpp.

References A, angle, B, max_angle, min_angle, and SSC::setValue().

Referenced by main(), Servo(), fhwInterface::setAngle(), and hwInterface::setAngle().


Member Data Documentation

float Servo::A [protected]
 

Definition at line 77 of file servo.h.

Referenced by Servo(), and setAngle().

float Servo::angle [protected]
 

Definition at line 76 of file servo.h.

Referenced by getAngle(), and setAngle().

float Servo::B [protected]
 

Definition at line 77 of file servo.h.

Referenced by Servo(), and setAngle().

float Servo::max_angle [protected]
 

Definition at line 76 of file servo.h.

Referenced by Servo(), and setAngle().

float Servo::min_angle [protected]
 

Definition at line 76 of file servo.h.

Referenced by Servo(), and setAngle().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 14:26:02 2006 for Raptor by  doxygen 1.4.4