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
Motor Class Referenceabstract

Abstact base class for attachable motors. More...

#include <motor.h>

Inheritance diagram for Motor:
Collaboration diagram for Motor:

Public Member Functions

 Motor ()
 
virtual ~Motor ()
 
virtual void init (Primitive *own, Joint *joint=0)=0
 initialises motor with body of robot More...
 
virtual int getMotorNumber () const =0
 return the dimensionality of this motor More...
 
virtual std::list
< SensorMotorInfo
getMotorInfos () const
 returns a list of motor names ( More...
 
virtual bool act (GlobalData &globaldata)=0
 performs the actions, This is usually called in doInternalStuff() from the robot More...
 
virtual int set (const motor *values, int length)=0
 sends the action commands to the motor. 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...
 

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...
 
- Protected Attributes inherited from SensorMotorInfoAble
NamingFunction func
 
SensorMotorInfo baseinfo
 

Detailed Description

Abstact base class for attachable motors.

Constructor & Destructor Documentation

Motor ( )
inline
virtual ~Motor ( )
inlinevirtual

Member Function Documentation

virtual bool act ( GlobalData globaldata)
pure virtual

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

Implemented in TwoAxisServo, OneAxisServo, AngularMotor, Speaker, ConstantMotor, and DummyMotor.

virtual std::list<SensorMotorInfo> getMotorInfos ( ) const
inlinevirtual

returns a list of motor names (

See Also
SensorMotorNaming how to change the names)
virtual int getMotorNumber ( ) const
pure virtual

return the dimensionality of this motor

Implemented in TwoAxisServo, OneAxisServo, AngularMotor, ConstantMotor, Speaker, and DummyMotor.

virtual void init ( Primitive own,
Joint joint = 0 
)
pure virtual
virtual int set ( const motor values,
int  length 
)
pure virtual

sends the action commands to the motor.

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

Implemented in TwoAxisServo, OneAxisServo, AngularMotor, Speaker, ConstantMotor, and DummyMotor.


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