Robotsystem from Robot Group Leipzig: Schlange Class Reference

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

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

# Schlange Class Reference

`#include <schlange.h>`

Inheritance diagram for Schlange:

[legend]
Collaboration diagram for Schlange:

[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

Definition at line 85 of file schlange.h.

## Public Member Functions
| Schlange (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const SchlangeConf &conf, const char *name)
virtual | ~Schlange ()
virtual void | place (const osg::Matrix &pose)
| sets the pose of the vehicle
virtual void | update ()
| update all primitives and joints
virtual bool | collisionCallback (void *data, dGeomID o1, dGeomID o2)
| This is the collision handling function for snake robots.
virtual void | doInternalStuff (const GlobalData &global)
| this function is called in each timestep.
virtual void | setMotors (const motor *motors, int motornumber)=0
| Reads the actual motor commands from an array, an sets all motors of the snake to this values.
virtual int | getSensors (sensor *sensors, int sensornumber)=0
| Writes the sensor values to an array in the memory.
virtual int | getSensorNumber ()=0
| returns number of sensors
virtual int | getMotorNumber ()=0
| returns number of motors
virtual int | getSegmentsPosition (vector< Position > &poslist)
| returns a vector with the positions of all segments of the robot
virtual paramkey | getName () const
| returns the name of the object (with version number)
virtual paramlist | getParamList () const
| The list of all parameters with there value as allocated lists.
virtual paramval | getParam (const paramkey &key) const
virtual bool | setParam (const paramkey &key, paramval val)
virtual Primitive * | getMainPrimitive () const
| the main object of the robot, which is used for position and speed tracking
## Static Public Member Functions
static SchlangeConf | getDefaultConf ()
static void | mycallback (void *data, dGeomID o1, dGeomID o2)
## Protected Member Functions
virtual void | create (const osg::Matrix &pose)
| creates vehicle at desired position
virtual void | destroy ()
| destroys vehicle and space
## Protected Attributes
bool | created
vector< Primitive * > | objects
vector< Joint * > | joints
vector< AngularMotor * > | frictionmotors
SchlangeConf | conf

## Constructor & Destructor Documentation

Schlange | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const SchlangeConf & | conf,
|  | const char * | name
| ) |

| Definition at line 51 of file schlange.cpp.

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

| Definition at line 61 of file schlange.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 129 of file schlange.cpp.

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

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

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

| destroys vehicle and space Definition at line 234 of file schlange.cpp.

void doInternalStuff | ( | const GlobalData & | global | ) | `[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 84 of file schlange.cpp.

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

| Reimplemented in SchlangeVelocity. Definition at line 100 of file schlange.h.

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

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

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

| returns number of motors Implements AbstractRobot. Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

virtual paramkey getName | ( |  | ) | const`[inline, virtual]`

| returns the name of the object (with version number) Reimplemented from Configurable. Definition at line 171 of file schlange.h.

Configurable::paramval getParam | ( | const paramkey & | key | ) | const`[virtual]`

| Definition at line 173 of file schlange.cpp.

Configurable::paramlist getParamList | ( |  | ) | const`[virtual]`

  | The list of all parameters with there value as allocated lists. Parameters:
  | keylist,vallist | will be allocated with malloc (free it after use!)
Returns: length of the lists Reimplemented from Configurable. Definition at line 163 of file schlange.cpp.

int getSegmentsPosition | ( | vector< Position > & | poslist | ) | `[virtual]`

  | returns a vector with the positions of all segments of the robot Parameters:
  | poslist | vector of positions (of all robot segments)
Returns: length of the list Definition at line 196 of file schlange.cpp.

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

| returns number of sensors Implements AbstractRobot. Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

virtual int getSensors | ( | sensor * | sensors,
|  | int | sensornumber
| ) | `[pure 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. Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

void mycallback | ( | void * | data,
|  | dGeomID | o1,
|  | dGeomID | o2
| ) | `[static]`

| Definition at line 91 of file schlange.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 67 of file schlange.cpp.

virtual void setMotors | ( | const motor * | motors,
|  | int | motornumber
| ) | `[pure 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. Implemented in SchlangeForce, SchlangeServo, SchlangeServo2, and SchlangeVelocity.

bool setParam | ( | const paramkey & | key,
|  | paramval | val
| ) | `[virtual]`

| Reimplemented in SchlangeServo, and SchlangeServo2. Definition at line 181 of file schlange.cpp.

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

| update all primitives and joints Implements OdeRobot. Definition at line 74 of file schlange.cpp.

## Member Data Documentation

SchlangeConf conf`[protected]`

| Definition at line 94 of file schlange.h.

bool created`[protected]`

| Definition at line 89 of file schlange.h.

vector<AngularMotor*> frictionmotors`[protected]`

| Definition at line 93 of file schlange.h.

vector<Joint*> joints`[protected]`

| Definition at line 92 of file schlange.h.

vector<Primitive*> objects`[protected]`

| Definition at line 91 of file schlange.h.