Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstantMotor Class Reference

Wrapper for Motor to have a constant set value (resulting in getMotorNumber()=0) More...

#include <constantmotor.h>

Inheritance diagram for ConstantMotor:
Collaboration diagram for ConstantMotor:

Public Member Functions

 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) More...
 
virtual void init (Primitive *own, Joint *joint=0) override
 initialises motor with body of robot More...
 
virtual int getMotorNumber () const override
 return the dimensionality of this motor More...
 
virtual bool act (GlobalData &globaldata)
 performs the actions, This is usually called in doInternalStuff() from the robot More...
 
virtual int set (const motor *values, int length)
 sends the action commands to the motor. More...
 
- Public Member Functions inherited from Motor
 Motor ()
 
virtual ~Motor ()
 
virtual std::list
< SensorMotorInfo
getMotorInfos () const
 returns a list of motor names ( More...
 
- Public Member Functions inherited from SensorMotorInfoAble
 SensorMotorInfoAble ()
 
void setBaseName (const std::string &basename)
 
void setBaseInfo (const SensorMotorInfo &baseinfo)
 
SensorMotorInfo getBaseInfo ()
 
void setNamingFunc (const NamingFunction &func)
 
NamingFunction getNamingFunc () const
 
void setNames (const std::vector< std::string > &names)
 set names explicitly (basename is anyway suffixed) More...
 
std::string getName (int index) const
 returns the name of a single item. Typically called from within Sensor and Motor class. More...
 
std::list< SensorMotorInfogetInfos (int number) const
 get all infos. More...
 

Protected Attributes

std::shared_ptr< Motormotor
 
double value1
 
double value2
 
- Protected Attributes inherited from SensorMotorInfoAble
NamingFunction func
 
SensorMotorInfo baseinfo
 

Additional Inherited Members

- Public Types inherited from SensorMotorInfoAble
typedef std::function
< std::string(int)> 
NamingFunction
 function that returns the name given the index More...
 
- Static Public Member Functions inherited from SensorMotorInfoAble
static std::string defaultNameing (int index)
 the default implementation is for index==0: basename, otherwise basename + (index+1) More...
 

Detailed Description

Wrapper for Motor to have a constant set value (resulting in getMotorNumber()=0)

Constructor & Destructor Documentation

ConstantMotor ( std::shared_ptr< Motor motor,
double  value1 = 0.0,
double  value2 = 0.0 
)
inline

motor to wrap and constant values (for first and second motor value, all others = value1)

Member Function Documentation

virtual bool act ( GlobalData globaldata)
inlinevirtual

performs the actions, This is usually called in doInternalStuff() from the robot

Implements Motor.

virtual int getMotorNumber ( ) const
inlineoverridevirtual

return the dimensionality of this motor

Implements Motor.

virtual void init ( Primitive own,
Joint joint = 0 
)
inlineoverridevirtual

initialises motor with body of robot

Implements Motor.

virtual int set ( const motor values,
int  length 
)
inlinevirtual

sends the action commands to the motor.

It returns the number of used values. (should be equal to getMotorNumber)

Implements Motor.

Member Data Documentation

std::shared_ptr<Motor> motor
protected
double value1
protected
double value2
protected

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