This is a class, which models a snake like robot. More...
#include <defaultCaterpillar.h>
Inherits lpzrobots::OdeRobot.
Inherited by CaterPillar.
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 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 void | notifyOnChange (const paramkey &key) |
Is called when a parameter was changes via setParam(). | |
virtual Primitive * | getMainPrimitive () const |
the main object of the robot, which is used for position and speed tracking | |
Static Public Member Functions | |
static CaterPillarConf | getDefaultConf () |
Protected Member Functions | |
virtual void | create (const osg::Matrix &pose) |
creates vehicle at desired pose | |
virtual void | destroy () |
destroys vehicle and space | |
Protected Attributes | |
bool | created |
std::vector< AngularMotor * > | frictionmotors |
CaterPillarConf | conf |
This is a class, which models a snake like robot.
It consists of a number of equal elements, each linked by a joint
DefaultCaterPillar | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
const CaterPillarConf & | conf, | |||
const std::string & | name, | |||
const std::string & | revision | |||
) |
~DefaultCaterPillar | ( | ) | [virtual] |
void create | ( | const osg::Matrix & | pose | ) | [protected, virtual] |
creates vehicle at desired pose
creates vehicle at desired position
pose | 4x4 pose matrix |
void destroy | ( | ) | [protected, virtual] |
destroys vehicle and space
static CaterPillarConf getDefaultConf | ( | ) | [inline, static] |
virtual Primitive* getMainPrimitive | ( | ) | const [inline, virtual] |
the main object of the robot, which is used for position and speed tracking
Reimplemented from OdeRobot.
virtual int getMotorNumber | ( | ) | [pure virtual] |
int getSegmentsPosition | ( | std::vector< Position > & | poslist | ) | [virtual] |
returns a vector with the positions of all segments of the robot
poslist | vector of positions (of all robot segments) |
virtual int getSensorNumber | ( | ) | [pure virtual] |
virtual int getSensors | ( | sensor * | sensors, | |
int | sensornumber | |||
) | [pure virtual] |
Writes the sensor values to an array in the memory.
sensors | pointer to the array | |
sensornumber | length of the sensor array |
Implements AbstractRobot.
Implemented in CaterPillar.
void notifyOnChange | ( | const paramkey & | key | ) | [virtual] |
Is called when a parameter was changes via setParam().
Note that it is not called of parameters of childs are changed, then there notifyOnChange() method is called. The key and of the changed parameter (use getParam() to retrieve its actual value). Overload this function when special actions have to be taken on parameter changes.
Reimplemented from Configurable.
Reimplemented in CaterPillar.
void place | ( | const osg::Matrix & | pose | ) | [virtual] |
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.
motors | pointer to the array, motor values are scaled to [-1,1] | |
motornumber | length of the motor array |
Implements AbstractRobot.
Implemented in CaterPillar.
void update | ( | ) | [virtual] |
update all primitives and joints
Implements OdeRobot.
CaterPillarConf conf [protected] |
bool created [protected] |
std::vector<AngularMotor*> frictionmotors [protected] |