Robot Simulator of the Robotics Group for Self-Organization of Control: Sphererobot3Masses Class Reference

# Sphererobot3Masses Class Reference

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.

Collaboration diagram for Sphererobot3Masses:
[legend]

List of all members.

## 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

## Detailed Description

A spherical robot with 3 internal masses, which can slide on their orthogonal axes.

This robot was inspired by Julius Popp (http://sphericalrobots.com)

Examples:

  template_sphererobot/main.cpp.

## Member Enumeration Documentation

enum parts

enum for the objects of the robot

Enumerator:

  Base |
  Pendular1 |
  Pendular2 |
  Pendular3 |
  Last |

## Constructor & Destructor Documentation

Sphererobot3Masses | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const Sphererobot3MassesConf & | conf,
|  | const std::string & | name,
|  | double | transparency = `0.5` |
| ) |  |  |

constructor

Examples:
  sphererobot3masses.cpp.

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]`

Examples:
  sphererobot3masses.cpp.

## Member Function Documentation

void create | ( | const osg::Matrix & | pose | ) | `[protected, virtual]`

creates vehicle at desired position and orientation

Reimplemented in Barrel2Masses, and Barrel2Masses2nd.

Examples:
  sphererobot3masses.cpp.

void destroy | ( |  | ) | `[protected, virtual]`

destroys vehicle and space

Examples:
  sphererobot3masses.cpp.

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.

Parameters:

  | globalData | structure that contains global data from the simulation environment

Reimplemented from OdeRobot.

Examples:
  sphererobot3masses.cpp.

static Sphererobot3MassesConf getDefaultConf | ( |  | ) | `[inline, static]`

default configuration

Reimplemented in Barrel2Masses, and Barrel2Masses2nd.

int getMotorNumber | ( |  | ) | `[virtual]`

returns number of motors

Implements AbstractRobot.

Examples:
  sphererobot3masses.cpp.

int getSensorNumber | ( |  | ) | `[virtual]`

returns number of sensors

Implements AbstractRobot.

Examples:
  sphererobot3masses.cpp.

int getSensors | ( | sensor * | sensors,
|  | int | sensornumber |
| ) |  |  | `[virtual]`

Writes the sensor values to an array in the memory.

Parameters:

  | sensor* | pointer to the array
  | sensornumber | length of the sensor array

Returns:
  number of actually written sensors

Implements AbstractRobot.

Reimplemented in Barrel2Masses, and Barrel2Masses2nd.

Examples:
  sphererobot3masses.cpp.

void init | ( |  | ) | `[protected]`

initialises some internal variables

Examples:
  sphererobot3masses.cpp.

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.

Examples:
  sphererobot3masses.cpp.

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

sets the pose of the vehicle

Parameters:

  | pose | desired 4x4 pose matrix

Implements OdeRobot.

Examples:
  sphererobot3masses.cpp.

void setMotors | ( | const motor * | motors,
|  | int | motornumber |
| ) |  |  | `[virtual]`

sets actual motorcommands

Parameters:

  | motors | motors scaled to [-1,1]
  | motornumber | length of the motor array

Implements AbstractRobot.

Examples:
  sphererobot3masses.cpp.

void update | ( |  | ) | `[virtual]`

update the OSG notes here

Implements OdeRobot.

Examples:
  sphererobot3masses.cpp.

## Member Data Documentation

OSGPrimitive* axis[servono]`[protected]`

Examples:
  sphererobot3masses.cpp.

Sphererobot3MassesConf conf`[protected]`

bool created`[protected]`

Examples:
  sphererobot3masses.cpp.

RaySensorBank irSensorBank`[protected]`

a collection of ir sensors

Examples:
  sphererobot3masses.cpp.

unsigned int numberaxis`[protected]`

Examples:
  sphererobot3masses.cpp.

SliderServo* servo[servono]`[protected]`

Examples:
  sphererobot3masses.cpp.

const int servono = 3`[static, protected]`

Examples:
  sphererobot3masses.cpp.

double transparency`[protected]`

The documentation for this class was generated from the following files:

- sphererobot3masses.h
- sphererobot3masses.cpp