DefaultCaterPillar Class Reference

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

#include <defaultCaterpillar.h>

Inherits OdeRobot.

Inherited by CaterPillar.

Inheritance diagram for DefaultCaterPillar:

Inheritance graph
[legend]
Collaboration diagram for DefaultCaterPillar:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DefaultCaterPillar (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const CaterPillarConf &conf, const std::string &name, const std::string &revision)
virtual ~DefaultCaterPillar ()
virtual void place (const osg::Matrix &pose)
 sets the pose of the vehicle
virtual void update ()
 update all primitives and joints
virtual bool collisionCallback (void *data, dGeomID o1, dGeomID o2)
 This is the collision handling function for snake robots.
virtual void doInternalStuff (const GlobalData &global)
 this function is called in each timestep.
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

Static Public Member Functions

CaterPillarConf getDefaultConf ()
void mycallback (void *data, dGeomID o1, dGeomID o2)

Protected Member Functions

virtual void create (const osg::Matrix &pose)
 creates vehicle at desired position
virtual void destroy ()
 destroys vehicle and space

Protected Attributes

bool created
std::vector< Primitive * > objects
std::vector< Joint * > joints
std::vector< AngularMotor * > frictionmotors
CaterPillarConf 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

DefaultCaterPillar const OdeHandle odeHandle,
const OsgHandle osgHandle,
const CaterPillarConf conf,
const std::string &  name,
const std::string &  revision
 

~DefaultCaterPillar  )  [virtual]
 


Member Function Documentation

bool collisionCallback void *  data,
dGeomID  o1,
dGeomID  o2
[virtual]
 

This is the collision handling function for snake robots.

This overwrides the function collisionCallback of the class robot.

Parameters:
data 
o1 first geometrical object, which has taken part in the collision
o2 second geometrical object, which has taken part in the collision
Returns:
true if the collision was threated by the robot, false if not

Implements OdeRobot.

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

creates vehicle at desired position

Parameters:
pose 4x4 pose matrix

Reimplemented in CaterPillar.

void destroy  )  [protected, virtual]
 

destroys vehicle and space

Reimplemented in CaterPillar.

void doInternalStuff const GlobalData global  )  [virtual]
 

this function is called in each timestep.

It should perform robot-internal checks, like space-internal collision detection, sensor resets/update etc.

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

Implements OdeRobot.

CaterPillarConf getDefaultConf  )  [inline, static]
 

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 CaterPillar.

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.

Parameters:
keylist,vallist will be allocated with malloc (free it after use!)
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 CaterPillar.

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 CaterPillar.

void mycallback void *  data,
dGeomID  o1,
dGeomID  o2
[static]
 

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

sets the pose of the vehicle

Parameters:
pose desired 4x4 pose matrix

Implements OdeRobot.

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 CaterPillar.

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 CaterPillar.

void update  )  [virtual]
 

update all primitives and joints

Implements OdeRobot.


Member Data Documentation

CaterPillarConf 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 Tue Jan 16 02:14:53 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8