Schlange Class Reference

This is a class, which models a snake like robot. More...

#include <schlange.h>

Inherits lpzrobots::OdeRobot.

Inherited by SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

Collaboration diagram for Schlange:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Schlange (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const SchlangeConf &conf, const std::string &name, const std::string &revision)
virtual ~Schlange ()
virtual void place (const osg::Matrix &pose)
 sets the pose of the vehicle
virtual void update ()
 update all primitives and joints
virtual void doInternalStuff (GlobalData &global)
 this function is called in each simulation timestep (always after control).
virtual void setMotors (const motor *motors, int motornumber)=0
 Reads the actual motor commands from an array, an sets all motors of the snake to this values.
virtual int getSensors (sensor *sensors, int sensornumber)=0
 Writes the sensor values to an array in the memory.
virtual int getSensorNumber ()=0
 returns number of sensors
virtual int getMotorNumber ()=0
 returns number of motors
virtual int getSegmentsPosition (std::vector< Position > &poslist)
 returns a vector with the positions of all segments of the robot
virtual paramlist getParamList () const
 The list of all parameters with there value as allocated lists.
virtual paramval getParam (const paramkey &key) const
 returns the value of the requested parameter or 0 (+ error message to stderr) if unknown.
virtual bool setParam (const paramkey &key, paramval val)
 sets the value of the given parameter or does nothing if unknown.
virtual PrimitivegetMainPrimitive () const
 the main object of the robot, which is used for position and speed tracking
virtual void setTexture (const std::string &filename)
 sets a texture to the body of the snake note: the head texture of the snake is set by this method too!
virtual void setHeadTexture (const std::string &filename)
 sets a texture to the head of the snake
virtual void setHeadColor (const Color &color)
 sets the color of the head element

Static Public Member Functions

static SchlangeConf getDefaultConf ()

Protected Member Functions

virtual void create (const osg::Matrix &pose)
 creates vehicle at desired pose
virtual PrimitivecreateSegment (int index)
 creates and initialised the segment with the given index
virtual void destroy ()
 destroys vehicle and space

Protected Attributes

bool created
std::vector< Primitive * > objects
std::vector< Joint * > joints
std::vector< AngularMotor * > frictionmotors
SchlangeConf conf

Detailed Description

This is a class, which models a snake like robot.

It consists of a number of equal elements, each linked by a joint


Constructor & Destructor Documentation

Schlange ( const OdeHandle odeHandle,
const OsgHandle osgHandle,
const SchlangeConf conf,
const std::string &  name,
const std::string &  revision 
)
~Schlange (  )  [virtual]

Member Function Documentation

void create ( const osg::Matrix pose  )  [protected, virtual]

creates vehicle at desired pose

creates vehicle at desired position

Parameters:
pose 4x4 pose matrix
Primitive * createSegment ( int  index  )  [protected, virtual]

creates and initialised the segment with the given index

void destroy (  )  [protected, virtual]

destroys vehicle and space

void doInternalStuff ( GlobalData globalData  )  [virtual]

this function is called in each simulation timestep (always after control).

It should perform robot-internal checks and actions like resetting certain sensors or implement velocity dependend friction and the like. The attached Motors should act here.

Parameters:
globalData structure that contains global data from the simulation environment

Reimplemented from OdeRobot.

static SchlangeConf getDefaultConf (  )  [inline, static]

Reimplemented in SchlangeVelocity.

virtual Primitive* getMainPrimitive (  )  const [inline, virtual]

the main object of the robot, which is used for position and speed tracking

Implements OdeRobot.

virtual int getMotorNumber (  )  [pure virtual]

returns number of motors

Implements AbstractRobot.

Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

Configurable::paramval getParam ( const paramkey key  )  const [virtual]

returns the value of the requested parameter or 0 (+ error message to stderr) if unknown.

Reimplemented from Configurable.

Configurable::paramlist getParamList (  )  const [virtual]

The list of all parameters with there value as allocated lists.

Returns:
length of the lists

Reimplemented from Configurable.

int getSegmentsPosition ( std::vector< Position > &  poslist  )  [virtual]

returns a vector with the positions of all segments of the robot

Parameters:
poslist vector of positions (of all robot segments)
Returns:
length of the list
virtual int getSensorNumber (  )  [pure virtual]

returns number of sensors

Implements AbstractRobot.

Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

virtual int getSensors ( sensor sensors,
int  sensornumber 
) [pure virtual]

Writes the sensor values to an array in the memory.

Parameters:
sensors pointer to the array
sensornumber length of the sensor array
Returns:
number of actually written sensors

Implements AbstractRobot.

Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

void place ( const osg::Matrix pose  )  [virtual]

sets the pose of the vehicle

Parameters:
pose desired 4x4 pose matrix

Implements OdeRobot.

void setHeadColor ( const Color color  )  [virtual]

sets the color of the head element

void setHeadTexture ( const std::string &  filename  )  [virtual]

sets a texture to the head of the snake

virtual void setMotors ( const motor motors,
int  motornumber 
) [pure virtual]

Reads the actual motor commands from an array, an sets all motors of the snake to this values.

It is an linear allocation.

Parameters:
motors pointer to the array, motor values are scaled to [-1,1]
motornumber length of the motor array

Implements AbstractRobot.

Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

bool setParam ( const paramkey key,
paramval  val 
) [virtual]

sets the value of the given parameter or does nothing if unknown.

Reimplemented from Configurable.

Reimplemented in SchlangeServo, and SchlangeServo2.

void setTexture ( const std::string &  filename  )  [virtual]

sets a texture to the body of the snake note: the head texture of the snake is set by this method too!

void update (  )  [virtual]

update all primitives and joints

Implements OdeRobot.


Member Data Documentation

SchlangeConf conf [protected]
bool created [protected]
std::vector<AngularMotor*> frictionmotors [protected]
std::vector<Joint*> joints [protected]
std::vector<Primitive*> objects [protected]

The documentation for this class was generated from the following files:
Generated on Fri Nov 4 10:59:41 2011 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3