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

# HurlingSnake Class Reference

Hurling snake is a string a beats. More...

`#include <hurlingsnake.h>`

Inherits lpzrobots::OdeRobot.

Collaboration diagram for HurlingSnake:
[legend]

List of all members.

## Public Member Functions
| HurlingSnake (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const std::string &name)
| Constructor.
| ~HurlingSnake ()
virtual void | update ()
| update the subcomponents
virtual void | place (const osg::Matrix &pose)
| sets the pose of the vehicle
virtual void | doInternalStuff (GlobalData &globalData)
| this function is called in each timestep.
virtual int | getSensors (sensor *sensors, int sensornumber)
| returns actual sensorvalues
virtual void | setMotors (const motor *motors, int motornumber)
| sets actual motorcommands
virtual int | getSensorNumber ()
| returns number of sensors
virtual int | getMotorNumber ()
| returns number of motors
virtual int | getSegmentsPosition (std::vector< Position > &poslist)
| returns a vector with the positions of all segments of the robot
virtual void | notifyOnChange (const paramkey &key)
| Is called when a parameter was changes via setParam().
## Protected Member Functions
virtual Primitive * | getMainPrimitive () const
| the main object of the robot, which is used for position and speed tracking

## Detailed Description

Hurling snake is a string a beats.

## Constructor & Destructor Documentation

HurlingSnake | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const std::string & | name |
| ) |  |  |

Constructor.

Parameters:

  | w | world in which robot should be created
  | s | space in which robot should be created
  | c | contactgroup for collision treatment

~HurlingSnake | ( |  | ) |

## Member Function Documentation

void doInternalStuff | ( | GlobalData & | globalData | ) | `[virtual]`

this function is called in each timestep.

It should perform robot-internal checks, like sensor resets/update etc.

Parameters:

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

Reimplemented from OdeRobot.

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

the main object of the robot, which is used for position and speed tracking

Reimplemented from OdeRobot.

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

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:

  | poslist | vector of positions (of all robot segments)

Returns:
  length of the list

Parameters:

  | vector | of positions (of all robot segments)

Returns:
  length of the list

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

returns number of sensors

Implements AbstractRobot.

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

returns actual sensorvalues

Parameters:

  | sensors | sensors scaled to [-1,1]
  | sensornumber | length of the sensor array

Returns:
  number of actually written sensors

Implements AbstractRobot.

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

Parameters:

  | pose | desired 4x4 pose matrix

Implements OdeRobot.

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.

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

update the subcomponents

Implements OdeRobot.

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

- hurlingsnake.h
- hurlingsnake.cpp