Robot Simulator of the Robotics Group for Self-Organization of Control: TwoAxisServo Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# TwoAxisServo Class Reference

general servo motor for 2 axis joints More...

`#include <twoaxisservo.h>`

Inherited by TwoAxisServoCentered.

Inheritance diagram for TwoAxisServo:

[legend]
Collaboration diagram for TwoAxisServo:

[legend]
List of all members.

## Public Member Functions
| TwoAxisServo (TwoAxisJoint *joint, double _min1, double _max1, double power1, double _min2, double _max2, double power2, double damp=0.2, double integration=2, double maxVel=10.0, double jointLimit=1.3, bool minmaxCheck=true)
| min and max values are understood as travel bounds.
virtual | ~TwoAxisServo ()
virtual void | set (double pos1, double pos2)
| sets the set point of the servo.
virtual double | get1 ()
| returns the position of the servo (joint) of 1.
virtual double | get2 ()
| returns the position of the servo (joint) of 2.
void | get (double &p1, double &p2)
| returns the positions of the joint in ranges [-1, 1] (scaled by min, max)
virtual void | setPower (double power1, double power2)
| adjusts the power of the servo
virtual void | setPower1 (double power1)
| returns the power of the servo
virtual void | setPower2 (double power2)
| returns the power of the servo
virtual double | getPower1 ()
| returns the power of the servo
virtual double | getPower2 ()
| returns the power of the servo
virtual double & | damping1 ()
| returns the damping of the servo
virtual double & | damping2 ()
| returns the damping of the servo
virtual double & | offsetCanceling ()
| returns the damping of the servo
virtual void | setMinMax1 (double _min, double _max)
virtual void | setMinMax2 (double _min, double _max)
virtual void | setMaxVel (double maxVel)
| adjusts maximal speed of servo
virtual double | getMaxVel ()
| adjusts maximal speed of servo
## Protected Attributes
TwoAxisJoint * | joint
double | min1
double | max1
double | min2
double | max2
PID | pid1
PID | pid2
double | maxVel
double | jointLimit

## Detailed Description

general servo motor for 2 axis joints

## Constructor & Destructor Documentation

TwoAxisServo | ( | TwoAxisJoint * | joint,
|  | double | _min1,
|  | double | _max1,
|  | double | power1,
|  | double | _min2,
|  | double | _max2,
|  | double | power2,
|  | double | damp = `0.2`,
|  | double | integration = `2`,
|  | double | maxVel = `10.0`,
|  | double | jointLimit = `1.3`,
|  | bool | minmaxCheck = `true` |
| ) |  |  | `[inline]`

min and max values are understood as travel bounds.

Min should be less than 0.

virtual ~TwoAxisServo | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual double& damping1 | ( |  | ) | `[inline, virtual]`

returns the damping of the servo

virtual double& damping2 | ( |  | ) | `[inline, virtual]`

returns the damping of the servo

void get | ( | double & | p1,
|  | double & | p2 |
| ) |  |  | `[inline]`

returns the positions of the joint in ranges [-1, 1] (scaled by min, max)

virtual double get1 | ( |  | ) | `[inline, virtual]`

returns the position of the servo (joint) of 1.

axis in ranges [-1, 1] (scaled by min1, max1)

Reimplemented in TwoAxisServoCentered.

virtual double get2 | ( |  | ) | `[inline, virtual]`

returns the position of the servo (joint) of 2.

axis in ranges [-1, 1] (scaled by min2, max2)

Reimplemented in TwoAxisServoCentered.

virtual double getMaxVel | ( |  | ) | `[inline, virtual]`

adjusts maximal speed of servo

Reimplemented in TwoAxisServoVel.

virtual double getPower1 | ( |  | ) | `[inline, virtual]`

returns the power of the servo

Reimplemented in TwoAxisServoVel.

virtual double getPower2 | ( |  | ) | `[inline, virtual]`

returns the power of the servo

Reimplemented in TwoAxisServoVel.

virtual double& offsetCanceling | ( |  | ) | `[inline, virtual]`

returns the damping of the servo

Reimplemented in TwoAxisServoVel.

virtual void set | ( | double | pos1,
|  | double | pos2 |
| ) |  |  | `[inline, virtual]`

sets the set point of the servo.

Position must be between -1 and 1. It is scaled to fit into min, max

Reimplemented in TwoAxisServoCentered, and TwoAxisServoVel.

virtual void setMaxVel | ( | double | maxVel | ) | `[inline, virtual]`

adjusts maximal speed of servo

Reimplemented in TwoAxisServoVel.

virtual void setMinMax1 | ( | double | _min,
|  | double | _max |
| ) |  |  | `[inline, virtual]`

virtual void setMinMax2 | ( | double | _min,
|  | double | _max |
| ) |  |  | `[inline, virtual]`

virtual void setPower | ( | double | power1,
|  | double | power2 |
| ) |  |  | `[inline, virtual]`

adjusts the power of the servo

Reimplemented in TwoAxisServoVel.

virtual void setPower1 | ( | double | power1 | ) | `[inline, virtual]`

returns the power of the servo

Reimplemented in TwoAxisServoVel.

virtual void setPower2 | ( | double | power2 | ) | `[inline, virtual]`

returns the power of the servo

Reimplemented in TwoAxisServoVel.

## Member Data Documentation

TwoAxisJoint* joint`[protected]`

double jointLimit`[protected]`

double max1`[protected]`

double max2`[protected]`

double maxVel`[protected]`

double min1`[protected]`

double min2`[protected]`

PID pid1`[protected]`

PID pid2`[protected]`

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

- twoaxisservo.h