A spherical robot with 3 internal masses, which can slide on their orthogonal axes. More...
#include <sphererobot3masses.h>
Inherits lpzrobots::OdeRobot.
Inherited by Barrel2Masses, and Barrel2Masses2nd.
Public Types | |
enum | parts { Base, Pendular1, Pendular2, Pendular3, Last } |
enum for the objects of the robot More... | |
Public Member Functions | |
Sphererobot3Masses (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const Sphererobot3MassesConf &conf, const std::string &name, double transparency=0.5) | |
constructor | |
virtual | ~Sphererobot3Masses () |
virtual void | update () |
update the OSG notes here | |
virtual void | place (const osg::Matrix &pose) |
sets the pose of the vehicle | |
virtual void | doInternalStuff (GlobalData &globalData) |
this function is called in each simulation timestep (always after control). | |
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) |
sets actual motorcommands | |
virtual int | getMotorNumber () |
returns number of motors | |
virtual int | getSensorNumber () |
returns number of sensors | |
virtual void | notifyOnChange (const paramkey &key) |
Is called when a parameter was changes via setParam(). | |
Static Public Member Functions | |
static Sphererobot3MassesConf | getDefaultConf () |
default configuration | |
Protected Member Functions | |
Sphererobot3Masses (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const Sphererobot3MassesConf &conf, const std::string &name, const std::string &revision, double transparency) | |
constructor for children | |
void | init () |
initialises some internal variables | |
virtual void | create (const osg::Matrix &pose) |
creates vehicle at desired position and orientation | |
virtual void | destroy () |
destroys vehicle and space | |
Protected Attributes | |
unsigned int | numberaxis |
SliderServo * | servo [servono] |
OSGPrimitive * | axis [servono] |
Sphererobot3MassesConf | conf |
RaySensorBank | irSensorBank |
a collection of ir sensors | |
double | transparency |
bool | created |
Static Protected Attributes | |
static const int | servono = 3 |
A spherical robot with 3 internal masses, which can slide on their orthogonal axes.
This robot was inspired by Julius Popp (http://sphericalrobots.com)
enum parts |
Sphererobot3Masses | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
const Sphererobot3MassesConf & | conf, | |||
const std::string & | name, | |||
double | transparency = 0.5 | |||
) |
constructor
Sphererobot3Masses | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
const Sphererobot3MassesConf & | conf, | |||
const std::string & | name, | |||
const std::string & | revision, | |||
double | transparency | |||
) | [protected] |
constructor for children
constructor
~Sphererobot3Masses | ( | ) | [virtual] |
void create | ( | const osg::Matrix & | pose | ) | [protected, virtual] |
creates vehicle at desired position and orientation
Reimplemented in Barrel2Masses, and Barrel2Masses2nd.
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.
globalData | structure that contains global data from the simulation environment |
Reimplemented from OdeRobot.
static Sphererobot3MassesConf getDefaultConf | ( | ) | [inline, static] |
default configuration
Reimplemented in Barrel2Masses, and Barrel2Masses2nd.
int getMotorNumber | ( | ) | [virtual] |
int getSensorNumber | ( | ) | [virtual] |
int getSensors | ( | sensor * | sensors, | |
int | sensornumber | |||
) | [virtual] |
Writes the sensor values to an array in the memory.
sensor* | pointer to the array | |
sensornumber | length of the sensor array |
Implements AbstractRobot.
Reimplemented in Barrel2Masses, and Barrel2Masses2nd.
void init | ( | ) | [protected] |
initialises some internal variables
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.
void place | ( | const osg::Matrix & | pose | ) | [virtual] |
sets the pose of the vehicle
pose | desired 4x4 pose matrix |
Implements OdeRobot.
void setMotors | ( | const motor * | motors, | |
int | motornumber | |||
) | [virtual] |
sets actual motorcommands
motors | motors scaled to [-1,1] | |
motornumber | length of the motor array |
Implements AbstractRobot.
void update | ( | ) | [virtual] |
OSGPrimitive* axis[servono] [protected] |
Sphererobot3MassesConf conf [protected] |
bool created [protected] |
RaySensorBank irSensorBank [protected] |
a collection of ir sensors
unsigned int numberaxis [protected] |
SliderServo* servo[servono] [protected] |
const int servono = 3 [static, protected] |
double transparency [protected] |