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

# Arm Class Reference

`#include <arm.h>`

Inherits lpzrobots::OdeRobot.

Collaboration diagram for Arm:
[legend]

List of all members.

## Public Member Functions
| Arm (const OdeHandle &odeHandle, const OsgHandle &osgHandle, const ArmConf &conf, const std::string &name)
virtual | ~Arm ()
virtual paramkey | getName () const
| return the name of the object
virtual void | place (const osg::Matrix &pose)
| sets the pose of the vehicle
virtual void | update ()
| update the subcomponents
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
void | getEndeffectorPosition (double *position)
| returns the position of the endeffector (hand)
virtual void | doInternalStuff (GlobalData &globalData)
| this function is called in each timestep.
virtual void | notifyOnChange (const paramkey &key)
| Is called when a parameter was changes via setParam().
virtual Primitive * | getMainObject () const
virtual Primitive * | getMainPrimitive () const
| the main object of the robot, which is used for position and speed tracking
void | setDlearnTargetHack (double *post)
void | setDmotorTargetHack (double *post)
## Static Public Member Functions
static ArmConf | getDefaultConf ()
## Protected Member Functions
virtual void | create (const osg::Matrix &pose)
| creates vehicle at desired pose
virtual void | destroy ()
| destroys vehicle and space
void | hitTarget ()
double | dBodyGetPositionAll (dBodyID basis, int para)
double | dGeomGetPositionAll (dGeomID basis, int para)
void | BodyCreate (int n, dMass m, dReal x, dReal y, dReal z, dReal qx, dReal qy, dReal qz, dReal qangle)
## Static Protected Member Functions
static void | mycallback (void *data, dGeomID o1, dGeomID o2)
## Protected Attributes
ArmConf | conf
matrix::Matrix | endeff
paramval | factorSensors
paramval | print
std::vector< HingeServo * > | hingeServos
int | sensorno
int | motorno
bool | created
dSpaceID | parentspace
int | printed

## Constructor & Destructor Documentation

Arm | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | const ArmConf & | conf,
|  | const std::string & | name |
| ) |  |  |

virtual ~Arm | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

void BodyCreate | ( | int | n,
|  | dMass | m,
|  | dReal | x,
|  | dReal | y,
|  | dReal | z,
|  | dReal | qx,
|  | dReal | qy,
|  | dReal | qz,
|  | dReal | qangle |
| ) |  |  | `[protected]`

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

creates vehicle at desired pose

creates arm at desired position

Parameters:

  | pose | 4x4 pose matrix
  | snowmanmode | snowman body

double dBodyGetPositionAll | ( | dBodyID | basis,
|  | int | para |
| ) |  |  | `[protected]`

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

destroys vehicle and space

double dGeomGetPositionAll | ( | dGeomID | basis,
|  | int | para |
| ) |  |  | `[protected]`

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

Reimplemented from OdeRobot.

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

void getEndeffectorPosition | ( | double * | position | ) |

returns the position of the endeffector (hand)

Parameters:

  | position | vector position vector

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

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

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

Reimplemented from OdeRobot.

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

returns number of motors

Implements AbstractRobot.

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

return the name of the object

Reimplemented from Configurable.

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

virtual int getSensorNumber | ( |  | ) | `[inline, 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

Parameters:

  | sensors | sensors scaled to [-1,1] (more or less)
  | sensornumber | length of the sensor array

Returns:
  number of actually written sensors

Implements AbstractRobot.

void hitTarget | ( |  | ) | `[protected]`

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

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 setDlearnTargetHack | ( | double * | post | ) |

void setDmotorTargetHack | ( | double * | post | ) |

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

draws the arm

Implements OdeRobot.

## Member Data Documentation

ArmConf conf`[protected]`

bool created`[protected]`

matrix::Matrix endeff`[protected]`

paramval factorSensors`[protected]`

std::vector<HingeServo*> hingeServos`[protected]`

int motorno`[protected]`

dSpaceID parentspace`[protected]`

Reimplemented from OdeRobot.

paramval print`[protected]`

int printed`[protected]`

int sensorno`[protected]`

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

- arm.h
- arm.cpp