Sphererobot Class Reference

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

#include <sphererobot.h>

Inherits lpzrobots::OdeRobot.

Collaboration diagram for Sphererobot:
Collaboration graph
[legend]

List of all members.

Public Types

enum  objects {
  Base, Pendular, Pole1Bot, Pole2Bot,
  Pole3Bot, Pole1Top, Pole2Top, Pole3Top,
  Last
}
 

list of objects (should be populated by subclasses)

More...

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 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 PrimitivegetMainPrimitive () const
 the main object of the robot, which is used for position and speed tracking

Static Public Member Functions

static SphererobotConf getDefaultConf ()

Public Attributes

SliderServoservo [3]
Primitiveobject [Last]
SliderJointslider [3]
Jointjoint [6]

Protected Member Functions

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

Protected Attributes

SphererobotConf conf
bool created

Static Protected Attributes

static const int sensorno = 9

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. This class is based upon the class roboter by the same author.

Author:
Marcel Kretschmann
Version:
beta

Member Enumeration Documentation

enum objects

list of objects (should be populated by subclasses)

Enumerator:
Base 
Pendular 
Pole1Bot 
Pole2Bot 
Pole3Bot 
Pole1Top 
Pole2Top 
Pole3Top 
Last 

Reimplemented from OdeRobot.


Constructor & Destructor Documentation

Sphererobot ( const OdeHandle odeHandle,
const OsgHandle osgHandle,
const SphererobotConf conf,
const std::string &  name 
)
~Sphererobot (  )  [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
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.

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

Reimplemented from OdeRobot.

static SphererobotConf 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.

int getMotorNumber (  )  [virtual]

Returns the number of motors used by the snake.

Returns:
number of motors
number of motors
Author:
Marcel Kretschmann
Version:
final

Implements AbstractRobot.

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

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

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

Returns the number of sensors used by the robot.

Returns:
number of sensors
number of sensors
Author:
Marcel Kretschmann
Version:
final

Implements AbstractRobot.

int getSensors ( sensor sensors,
int  sensornumber 
) [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.

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

sets the pose of the vehicle

Parameters:
pose desired 4x4 pose matrix

Implements OdeRobot.

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.

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

Implements AbstractRobot.

void update (  )  [virtual]

update the subcomponents

Implements OdeRobot.


Member Data Documentation

SphererobotConf conf [protected]
bool created [protected]
Joint* joint[6]
Primitive* object[Last]
const int sensorno = 9 [static, protected]

The documentation for this class was generated from the following files:
Generated on Thu Jun 28 14:49:00 2012 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.6.3