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

# AmosII Class Reference

`#include <amosII.h>`

Inherits lpzrobots::OdeRobot, and Inspectable.

Collaboration diagram for AmosII:
[legend]

List of all members.

## Classes
struct | Leg
## Public Types
enum | LegPos { L0, L1, L2, R0, R1, R2, LEG_POS_MAX }
enum | LegPosUsage { LEG, WHEEL, UNUSED }
enum | LegJointType { TC, CTR, FTI, LEG_JOINT_TYPE_MAX }
typedef AmosIIMotorNames | MotorName
typedef AmosIISensorNames | SensorName
## Public Member Functions
| AmosII (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const AmosIIConf &conf=getDefaultConf(), const std::string &name="AmosII robot")
| constructor
virtual | ~AmosII ()
virtual void | update ()
| updates the OSG nodes of the vehicle
virtual void | place (const osg::Matrix &pose)
| sets the pose of the vehicle
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 void | doInternalStuff (GlobalData &globalData)
| this function is called in each timestep.
virtual double | getMassOfRobot ()
void | setLegPosUsage (LegPos leg, LegPosUsage usage)
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 AmosIIConf | getDefaultConf (double _scale=1.0, bool _useShoulder=1, bool _useFoot=1, bool _useBack=0)
| Returns the default configuration values.
static AmosIIConf | getAmosIIv1Conf (double _scale=1.0, bool _useShoulder=1, bool _useFoot=1, bool _useBack=0)
static AmosIIConf | getAmosIIv2Conf (double _scale=1.0, bool _useShoulder=1, bool _useFoot=1, bool _useBack=0)
static MotorName | getMotorName (LegPos leg, LegJointType joint)
| returns the MotorName enum value for the given joint at the given leg.
static LegJointType | getLegJointType (MotorName)
| Returns the joint type of the given motor.
static LegPos | getMotorLegPos (MotorName)
| Returns the leg of the given motor.
## Protected Member Functions
virtual void | create (const osg::Matrix &pose)
| creates vehicle at desired pose
virtual void | destroy ()
| destroys vehicle and space
void | nameMotor (const int motorNo, const char *name)
| Assign a human readable name to a motor.
void | nameSensor (const int sensorNo, const char *name)
| Assign a human readable name to a sensor.

## Member Typedef Documentation

typedef AmosIIMotorNames MotorName

typedef AmosIISensorNames SensorName

## Member Enumeration Documentation

enum LegJointType

Enumerator:

  TC |
  CTR |
  FTI |
  LEG_JOINT_TYPE_MAX |

enum LegPos

Enumerator:

  L0 |
  L1 |
  L2 |
  R0 |
  R1 |
  R2 |
  LEG_POS_MAX |

enum LegPosUsage

Enumerator:

  LEG |
  WHEEL |
  UNUSED |

## Constructor & Destructor Documentation

AmosII | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const AmosIIConf & | conf = `getDefaultConf()`,
|  | const std::string & | name = `"AmosII robot"` |
| ) |  |  |

constructor

Parameters:

  | odeHandle | data structure for accessing ODE
  | osgHandle | ata structure for accessing OSG
  | conf | configuration object
  | name | name to display for this robot

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

## Member Function Documentation

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

creates vehicle at desired pose

creates vehicle at desired position

Parameters:

  | pose | 4x4 pose matrix
  | pos | struct Position with desired position

central position of the trunk

parameters are set later

parameters are set later

parameters are set later

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

destroys vehicle and space

void doInternalStuff | ( | 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

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

Parameters:

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

Reimplemented from OdeRobot.

AmosIIConf getAmosIIv1Conf | ( | double | _scale = `1.0`,
|  | bool | _useShoulder = `1`,
|  | bool | _useFoot = `1`,
|  | bool | _useBack = `0` |
| ) |  |  | `[static]`

AmosIIConf getAmosIIv2Conf | ( | double | _scale = `1.0`,
|  | bool | _useShoulder = `1`,
|  | bool | _useFoot = `1`,
|  | bool | _useBack = `0` |
| ) |  |  | `[static]`

AmosIIConf getDefaultConf | ( | double | _scale = `1.0`,
|  | bool | _useShoulder = `1`,
|  | bool | _useFoot = `1`,
|  | bool | _useBack = `0` |
| ) |  |  | `[static]`

Returns the default configuration values.

AmosII::LegJointType getLegJointType | ( | MotorName | name | ) | `[static]`

Returns the joint type of the given motor.

returns the joint type of the given motor.

If the given motor name is not associated with a leg joint JOINT_TYPE_MAX is returend and a warning is given out.

Parameters:

  | MotorName | name of the motor

Returns:
  joint type controlled by this motor or JOINT_TYPE_MAX if MotorName is invalid

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

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

Reimplemented from OdeRobot.

double getMassOfRobot | ( |  | ) | `[virtual]`

AmosII::LegPos getMotorLegPos | ( | MotorName | name | ) | `[static]`

Returns the leg of the given motor.

If the given motor name is not associated wit a leg LEG_POS_MAX is returned and a warning is given out.

Parameters:

  | MotorName | name of the motor

Returns:
  the leg on which this motor operates or LEG_POS_MAX if MotorName is invalid

If the given motor name is not associated wit a leg LEG_POS_MAX is returned and a warning is given out

Parameters:

  | MotorName | name of the motor

Returns:
  the leg on which this motor operates or LEG_POS_MAX if MotorName is invalid

AmosII::MotorName getMotorName | ( | LegPos | leg,
|  | LegJointType | joint |
| ) |  |  | `[static]`

returns the MotorName enum value for the given joint at the given leg.

If the value for leg or joint are not valid AMOSII_MOTOR_MAX is returned.

Parameters:

  | leg | leg position
  | joint | leg joint type

Returns:
  the motor name value or AMOSII_MOTOR_MAX if parameters are invalid

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

returns number of motors

Implements AbstractRobot.

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

returns number of sensors

Implements AbstractRobot.

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

returns actual sensorvalues

Parameters:

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

Returns:
  number of actually written sensors

Implements AbstractRobot.

void nameMotor | ( | const int | motorNo,
|  | const char * | name |
| ) |  |  | `[protected]`

Assign a human readable name to a motor.

This name is used for the associated inspectable value as used e.g. in guilogger.

Parameters:

  | motorNo | index of the motor (for standard motors defined by the MotorName enum)
  | name | human readable name for the motor

void nameSensor | ( | const int | sensorNo,
|  | const char * | name |
| ) |  |  | `[protected]`

Assign a human readable name to a sensor.

This name is used for the associated inspectable value as used e.g. in guilogger.

Parameters:

  | motorNo | index of the motor (for standard motors defined by the SensorName enum)
  | name | human readable name for the sensor

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

sets the pose of the vehicle

Parameters:

  | pose | desired pose matrix

Implements OdeRobot.

void setLegPosUsage | ( | LegPos | leg,
|  | LegPosUsage | usage |
| ) |  |  |

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.

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

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

updates the OSG nodes of the vehicle

updates the osg notes

Implements OdeRobot.

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

- amosII.h
- amosII.cpp