32 #include <selforg/controller_misc.h>
43 double _min2,
double _max2,
double power2,
44 double damp=0.2,
double integration=2,
double maxVel=10.0,
45 double jointLimit = 1.3,
bool minmaxCheck=
true);
52 virtual void set(
double pos1,
double pos2);
55 virtual double get1()
const {
66 virtual double get2()
const {
77 void get(
double& p1,
double& p2)
const {
95 virtual int get(
sensor* sensors,
int length)
const {
115 virtual int set(
const motor* values,
int length)
override {
117 set(values[0], values[1]);
124 virtual void setPower(
double power1,
double power2) {
230 double _min2,
double _max2,
double power2,
231 double damp=0.2,
double integration=2,
double maxVel=10.0,
240 virtual void set(
double pos1,
double pos2)
override ;
244 virtual double get1()
const override {
252 virtual double get2()
const override {
279 double _min2,
double _max2,
double power2,
285 if(joint) { assert(joint==this->joint); }
289 virtual void setPower(
double _power1,
double _power2)
override;
291 virtual void setPower1(
double _power1)
override;
293 virtual void setPower2(
double _power2)
override;
337 virtual void set(
double pos1,
double pos2)
override ;
virtual void setPower(double power1, double power2)
adjusts the power of the servo
Definition: twoaxisservo.h:124
virtual double getDamping2() override
returns the damping of the servo (axis 2)
Definition: twoaxisservo.h:305
double max1
Definition: twoaxisservo.h:210
virtual bool act(GlobalData &globaldata) override
performs the actions, This is usually called in doInternalStuff() from the robot
Definition: twoaxisservo.h:105
Data structure for accessing the ODE.
Definition: odehandle.h:44
virtual void set(double pos1, double pos2)
sets the set point of the servo.
Definition: twoaxisservo.cpp:48
double dummy
Definition: twoaxisservo.h:341
virtual double getDamping2()
returns the damping of the servo (axis 2)
Definition: twoaxisservo.h:154
double KI
Definition: pid.h:45
virtual std::list< sensor > getList() const
returns a list of sensor values (usually in the range [-1,1] ) This function should be overloaded...
Definition: twoaxisservo.h:94
Angular motor for TwoAxisJoints.
Definition: angularmotor.h:141
virtual TwoAxisJoint * getJoint()
Definition: twoaxisservo.h:158
virtual void setPower1(double _power1) override
returns the power of the servo
Definition: twoaxisservo.cpp:131
virtual double getPosition1() const =0
virtual double & offsetCanceling() override
offetCanceling does not exist for this type of servo
Definition: twoaxisservo.h:316
TwoAxisJoint * joint
Definition: twoaxisservo.h:204
general servo motor for 2 axis joints
Definition: twoaxisservo.h:38
virtual double getMaxVel()
adjusts maximal speed of servo
Definition: twoaxisservo.h:202
PID pid2
Definition: twoaxisservo.h:214
virtual void setDamping(double _damp)
sets the damping of the servo (both axis)
Definition: twoaxisservo.h:173
virtual double getDamping1() override
returns the damping of the servo (axis 1)
Definition: twoaxisservo.h:302
virtual ~TwoAxisServoVel()
Definition: twoaxisservo.cpp:124
virtual void setDamping1(double damp)
sets the damping of the servo (axis 1)
Definition: twoaxisservo.h:163
virtual void set(double pos1, double pos2) override
sets the set point of the servo.
Definition: twoaxisservo.cpp:141
virtual void init(Primitive *own, Joint *joint=0) override
initialises motor with body of robot
Definition: twoaxisservo.h:284
double sensor
Definition: types.h:29
virtual double get2() const override
returns the position of the servo (joint) of 2.
Definition: twoaxisservo.h:252
virtual double getPower1() override
returns the power of the servo
Definition: twoaxisservo.h:295
virtual ~TwoAxisServoCentered()
Definition: twoaxisservo.cpp:87
double power2
Definition: twoaxisservo.h:344
general servo motor for 2 axis joints with zero position centered
Definition: twoaxisservo.h:224
virtual double getDamping1()
returns the damping of the servo (axis 1)
Definition: twoaxisservo.h:149
Abstract class for sensors that can be plugged into a robot.
Definition: sensor.h:43
T abs(T v)
absolute function for all types
Definition: stl_adds.h:35
virtual bool sense(const GlobalData &globaldata) override
performs sense action
Definition: twoaxisservo.h:90
virtual double getMaxVel() override
adjusts maximal speed of servo
Definition: twoaxisservo.h:328
TwoAxisServo UniversalServo
Definition: twoaxisservo.h:219
virtual void setPower1(double power1)
returns the power of the servo
Definition: twoaxisservo.h:130
virtual double getPosition2() const =0
virtual double & offsetCanceling()
returns the damping of the servo
Definition: twoaxisservo.h:179
virtual double getPower2()
returns the power of the servo
Definition: twoaxisservo.h:144
virtual void setMaxVel(double maxVel) override
adjusts maximal speed of servo
Definition: twoaxisservo.h:322
virtual void setDamping1(double _damp) override
sets the damping of the servo (axis 1)
Definition: twoaxisservo.h:308
double jointLimit
Definition: twoaxisservo.h:216
double maxVel
Definition: twoaxisservo.h:215
Abstact base class for attachable motors.
Definition: motor.h:35
virtual void setPower2(double power2)
returns the power of the servo
Definition: twoaxisservo.h:135
virtual void setPower2(double _power2) override
returns the power of the servo
Definition: twoaxisservo.cpp:136
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
virtual double get1() const
returns the position of the servo (joint) of 1.
Definition: twoaxisservo.h:55
virtual double getPower2() override
returns the power of the servo
Definition: twoaxisservo.h:298
TwoAxisServoCentered(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)
min and max values are understood as travel bounds.
Definition: twoaxisservo.cpp:78
Data structure holding all essential global information.
Definition: globaldata.h:57
double clip(double r, double x)
clipping function for mapP
Definition: controller_misc.cpp:39
virtual int set(const motor *values, int length) override
sends the action commands to the motor.
Definition: twoaxisservo.h:115
double min1
Definition: twoaxisservo.h:209
double power1
Definition: twoaxisservo.h:343
double motor
Definition: types.h:30
virtual void set(double pos1, double pos2) override
sets the set point of the servo.
Definition: twoaxisservo.cpp:89
double KD
Definition: pid.h:46
virtual int getSensorNumber() const override
returns the number of sensors values produced by this sensor
Definition: twoaxisservo.h:91
virtual double getPower1()
returns the power of the servo
Definition: twoaxisservo.h:140
virtual void setMinMax1(double _min, double _max)
Definition: twoaxisservo.h:183
virtual void setMaxVel(double maxVel)
adjusts maximal speed of servo
Definition: twoaxisservo.h:198
virtual void setDamping2(double _damp) override
sets the damping of the servo (axis 1)
Definition: twoaxisservo.h:311
PID pid1
Definition: twoaxisservo.h:213
virtual void setParam(int parameter, double value)=0
sets the ODE joint parameter (see ODE manual)
virtual void setPower(double _power1, double _power2) override
adjusts the power of the servo
Definition: twoaxisservo.cpp:126
virtual double get2() const
returns the position of the servo (joint) of 2.
Definition: twoaxisservo.h:66
double KP
Definition: pid.h:44
virtual void init(Primitive *own, Joint *joint=0) override
initialises motor with body of robot
Definition: twoaxisservo.h:83
virtual int getMotorNumber() const override
return the dimensionality of this motor
Definition: twoaxisservo.h:103
virtual ~TwoAxisServo()
Definition: twoaxisservo.cpp:46
double max2
Definition: twoaxisservo.h:212
virtual double get1() const override
returns the position of the servo (joint) of 1.
Definition: twoaxisservo.h:244
AngularMotor2Axis motor
Definition: twoaxisservo.h:340
double min2
Definition: twoaxisservo.h:211
double damp
Definition: twoaxisservo.h:342
virtual void setDamping2(double damp)
sets the damping of the servo (axis 1)
Definition: twoaxisservo.h:168
general servo motor to achieve position control for 2 axis joints that internally controls the veloci...
Definition: twoaxisservo.h:266
std::list< sensor > getListOfArray() const
helper function for performance implementation of list<> get() based on array-get ...
Definition: sensor.h:99
virtual void setMinMax2(double _min, double _max)
Definition: twoaxisservo.h:190
TwoAxisServoVel(const OdeHandle &odeHandle, TwoAxisJoint *joint, double _min1, double _max1, double power1, double _min2, double _max2, double power2, double damp=0.05, double maxVel=10.0, double jointLimit=1.3)
min and max values are understood as travel bounds.
Definition: twoaxisservo.cpp:111
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.
Definition: twoaxisservo.cpp:30