Robotsystem from Robot Group Leipzig: ComponentToRobot Class Reference

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

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

# ComponentToRobot Class Reference

`#include <component_to_robot.h>`

Inheritance diagram for ComponentToRobot:

[legend]
Collaboration diagram for ComponentToRobot:

[legend]
List of all members.

## Detailed Description

Definition at line 50 of file component_to_robot.h.

## Public Member Functions
| ComponentToRobot (IComponent *_p_component, const OdeHandle &odehandle, const OsgHandle &osghandle)
virtual | ~ComponentToRobot ()
const char * | getName () const
| returns the name of the robot
virtual void | draw ()
virtual void | place (Position pos, Color *c=NULL)
virtual bool | collisionCallback (void *data, dGeomID o1, dGeomID o2)
| checks for internal collisions and treats them.
virtual void | doInternalStuff (const 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 (vector< Position > &poslist)
virtual void | setColor (Color col)
## Protected Member Functions
virtual Primitive * | getMainPrimitive ()
## Protected Attributes
IComponent * | p_component
WireContainer | wire_container

## Constructor & Destructor Documentation

ComponentToRobot | ( | IComponent * | _p_component,
|  | const OdeHandle & | odehandle,
|  | const OsgHandle & | osghandle
| ) |

| Definition at line 44 of file component_to_robot.cpp.

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

| Definition at line 57 of file component_to_robot.cpp.

## Member Function Documentation

bool collisionCallback | ( | void * | data,
|  | dGeomID | o1,
|  | dGeomID | o2
| ) | `[virtual]`

| checks for internal collisions and treats them. In case of a treatment return true (collision will be ignored by other objects and the default routine) else false (collision is passed to other objects and (if not treated) to the default routine). Implements OdeRobot. Definition at line 81 of file component_to_robot.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 86 of file component_to_robot.cpp.

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

| Definition at line 68 of file component_to_robot.cpp.

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

| Definition at line 186 of file component_to_robot.cpp.

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

| returns number of motors Implements AbstractRobot. Definition at line 161 of file component_to_robot.cpp.

const char * getName | ( |  | ) | const

| returns the name of the robot Reimplemented from AbstractRobot. Definition at line 62 of file component_to_robot.cpp.

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

| Definition at line 175 of file component_to_robot.cpp.

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

| returns number of sensors Implements AbstractRobot. Definition at line 146 of file component_to_robot.cpp.

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

void place | ( | Position | pos,
|  | Color * | c = `NULL`
| ) | `[virtual]`

| Definition at line 74 of file component_to_robot.cpp.

void setColor | ( | Color | col | ) | `[virtual]`

| Definition at line 181 of file component_to_robot.cpp.

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. Definition at line 117 of file component_to_robot.cpp.

## Member Data Documentation

IComponent* p_component`[protected]`

| Definition at line 53 of file component_to_robot.h.

WireContainer wire_container`[protected]`

| Definition at line 55 of file component_to_robot.h.