24 #ifndef CONSTANTMOTOR_H_
25 #define CONSTANTMOTOR_H_
45 motor->init(own, joint);
51 int len =
motor->getMotorNumber();
52 double* dat =
new double[len];
53 std::fill_n( dat, len,
value1);
60 virtual int set(
const motor* values,
int length) {
return 0;};
62 std::shared_ptr<Motor>
motor;
Wrapper for Motor to have a constant set value (resulting in getMotorNumber()=0)
Definition: constantmotor.h:37
ConstantMotor(std::shared_ptr< Motor > motor, double value1=0.0, double value2=0.0)
motor to wrap and constant values (for first and second motor value, all others = value1) ...
Definition: constantmotor.h:40
virtual bool act(GlobalData &globaldata)
performs the actions, This is usually called in doInternalStuff() from the robot
Definition: constantmotor.h:50
double value2
Definition: constantmotor.h:64
Abstact base class for attachable motors.
Definition: motor.h:35
virtual int getMotorNumber() const override
return the dimensionality of this motor
Definition: constantmotor.h:48
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
virtual void init(Primitive *own, Joint *joint=0) override
initialises motor with body of robot
Definition: constantmotor.h:44
Data structure holding all essential global information.
Definition: globaldata.h:57
double value1
Definition: constantmotor.h:63
double motor
Definition: types.h:30
virtual int set(const motor *values, int length)
sends the action commands to the motor.
Definition: constantmotor.h:60
std::shared_ptr< Motor > motor
Definition: constantmotor.h:60