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

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Sphererobot Class Reference

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

`#include <sphererobot.h>`

Inherits OdeRobot.

Inheritance diagram for Sphererobot:

[legend]
Collaboration diagram for Sphererobot:

[legend]
List of all members.

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

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

Enumerator:

  Base |
  Pendular |
  Pole1Bot |
  Pole2Bot |
  Pole3Bot |
  Pole1Top |
  Pole2Top |
  Pole3Top |
  Last |

## Constructor & Destructor Documentation

Sphererobot | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const SphererobotConf & | conf,
|  | const std::string & | name |
| ) |  |  |

~Sphererobot | ( |  | ) | `[virtual]`

## Member Function Documentation

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.

Parameters:

  | data |
  | o1 | first geometrical object, which has taken part in the collision
  | o2 | second geometrical object, which has taken part in the collision

Returns:
  true if the collision was threated by the robot, false if not

Reimplemented from OdeRobot.

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

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

Implements 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

Implements OdeRobot.

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

Returns the number of motors used by the snake.

Returns:
  number of motors

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

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

SliderServo* servo[3]

SliderJoint* slider[3]

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

- sphererobot.h
- sphererobot.cpp