#include <sphererobot.h>
Inherits OdeRobot.
Inheritance diagram for Sphererobot:
Public Types | |
Base | |
Pendular | |
Pole1Bot | |
Pole2Bot | |
Pole3Bot | |
Pole1Top | |
Pole2Top | |
Pole3Top | |
Last | |
enum | objects { Base, Pendular, Pole1Bot, Pole2Bot, Pole3Bot, Pole1Top, Pole2Top, Pole3Top, Last } |
Public Member Functions | |
Sphererobot (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const SphererobotConf &conf, const std::string &name) | |
virtual | ~Sphererobot () |
virtual void | update () |
update the subcomponents | |
virtual void | place (const osg::Matrix &pose) |
sets the pose of the vehicle | |
virtual bool | collisionCallback (void *data, dGeomID o1, dGeomID o2) |
This is the collision handling function for snake robots. | |
virtual void | doInternalStuff (GlobalData &globalData) |
this function is called in each timestep. | |
virtual int | getSensors (sensor *sensors, int sensornumber) |
Writes the sensor values to an array in the memory. | |
virtual void | setMotors (const motor *motors, int motornumber) |
Reads the actual motor commands from an array, an sets all motors of the snake to this values. | |
virtual int | getMotorNumber () |
Returns the number of motors used by the snake. | |
virtual int | getSensorNumber () |
Returns the number of sensors used by the robot. | |
virtual int | getSegmentsPosition (std::vector< Position > &poslist) |
returns a vector with the positions of all segments of the robot | |
virtual Primitive * | getMainPrimitive () const |
the main object of the robot, which is used for position and speed tracking | |
Static Public Member Functions | |
static SphererobotConf | getDefaultConf () |
Public Attributes | |
SliderServo * | servo [3] |
Primitive * | object [Last] |
SliderJoint * | slider [3] |
Joint * | joint [6] |
Protected Member Functions | |
virtual void | create (const osg::Matrix &pose) |
creates vehicle at desired position | |
virtual void | destroy () |
destroys vehicle and space | |
Protected Attributes | |
SphererobotConf | conf |
bool | created |
Static Protected Attributes | |
static const int | sensorno = 9 |
It consists of a number of equal elements, each linked by a joint. This class is based upon the class roboter by the same author.
enum objects |
Sphererobot | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
const SphererobotConf & | conf, | |||
const std::string & | name | |||
) |
~Sphererobot | ( | ) | [virtual] |
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.
data | ||
o1 | first geometrical object, which has taken part in the collision | |
o2 | second geometrical object, which has taken part in the collision |
Reimplemented from OdeRobot.
void create | ( | const osg::Matrix & | pose | ) | [protected, virtual] |
creates vehicle at desired position
pose | 4x4 pose matrix |
void destroy | ( | ) | [protected, virtual] |
destroys vehicle and space
void doInternalStuff | ( | GlobalData & | globalData | ) | [virtual] |
this function is called in each timestep.
It should perform robot-internal checks, like space-internal collision detection, sensor resets/update etc.
globalData | structure that contains global data from the simulation environment |
Implements OdeRobot.
static SphererobotConf getDefaultConf | ( | ) | [inline, static] |
virtual Primitive* getMainPrimitive | ( | ) | const [inline, virtual] |
int getMotorNumber | ( | ) | [virtual] |
int getSegmentsPosition | ( | std::vector< Position > & | poslist | ) | [virtual] |
returns a vector with the positions of all segments of the robot
vector | of positions (of all robot segments) |
int getSensorNumber | ( | ) | [virtual] |
Returns the number of sensors used by the robot.
Implements AbstractRobot.
int getSensors | ( | sensor * | sensors, | |
int | sensornumber | |||
) | [virtual] |
Writes the sensor values to an array in the memory.
sensors | pointer to the array | |
sensornumber | length of the sensor array |
Implements AbstractRobot.
void place | ( | const osg::Matrix & | pose | ) | [virtual] |
void setMotors | ( | const motor * | motors, | |
int | motornumber | |||
) | [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.
void update | ( | ) | [virtual] |
SphererobotConf conf [protected] |
bool created [protected] |
const int sensorno = 9 [static, protected] |
SliderServo* servo[3] |
SliderJoint* slider[3] |