Robotsystem from Robot Group Leipzig: Sphererobot Class Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

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

# Sphererobot Class Reference

`#include <sphererobot.h>`

Inheritance diagram for Sphererobot:

[legend]
Collaboration diagram for Sphererobot:

[legend]
List of all members.

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

Definition at line 81 of file sphererobot.h.

## Public Types
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 char *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 (const 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 (vector< Position > &poslist)
| returns a vector with the positions of all segments of the robot
## 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 Primitive * | getMainPrimitive () const
| the main object of the robot, which is used for position and speed tracking
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

## Member Enumeration Documentation

enum objects

  | Enumerator:
  Base |
  Pendular |
  Pole1Bot |
  Pole2Bot |
  Pole3Bot |
  Pole1Top |
  Pole2Top |
  Pole3Top |
  Last |
Definition at line 84 of file sphererobot.h.

## Constructor & Destructor Documentation

Sphererobot | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const SphererobotConf & | conf,
|  | const char * | name
| ) |

| Definition at line 58 of file sphererobot.cpp.

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

| Definition at line 69 of file sphererobot.cpp.

## 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 Implements OdeRobot. Definition at line 124 of file sphererobot.cpp.

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

  | creates vehicle at desired position Parameters:
  | pose | 4x4 pose matrix
Definition at line 192 of file sphererobot.cpp.

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

| destroys vehicle and space Definition at line 273 of file sphererobot.cpp.

void doInternalStuff | ( | const 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. Definition at line 122 of file sphererobot.cpp.

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

| Definition at line 106 of file sphererobot.h.

virtual Primitive* getMainPrimitive | ( |  | ) | const`[inline, protected, virtual]`

| the main object of the robot, which is used for position and speed tracking Implements OdeRobot. Definition at line 176 of file sphererobot.h.

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

| Returns the number of motors used by the snake. Returns: number of motors Implements AbstractRobot. Definition at line 163 of file sphererobot.cpp.

int getSegmentsPosition | ( | 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 Definition at line 181 of file sphererobot.cpp.

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

| Returns the number of sensors used by the robot. Returns: number of sensors Implements AbstractRobot. Definition at line 173 of file sphererobot.cpp.

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. Definition at line 88 of file sphererobot.cpp.

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

  | sets the pose of the vehicle Parameters:
  | pose | desired 4x4 pose matrix
Implements OdeRobot. Definition at line 113 of file sphererobot.cpp.

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. Definition at line 105 of file sphererobot.cpp.

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

| update the subcomponents Implements OdeRobot. Definition at line 73 of file sphererobot.cpp.

## Member Data Documentation

SphererobotConf conf`[protected]`

| Definition at line 90 of file sphererobot.h.

bool created`[protected]`

| Definition at line 91 of file sphererobot.h.

Joint* joint[6]

| Definition at line 97 of file sphererobot.h.

Primitive* object[Last]

| Definition at line 95 of file sphererobot.h.

const int sensorno = 9`[static, protected]`

| Definition at line 88 of file sphererobot.h.

SliderServo* servo[3]

| Definition at line 94 of file sphererobot.h.

SliderJoint* slider[3]

| Definition at line 96 of file sphererobot.h.