#include <addsensors2robotadapter.h>
Inherits OdeRobot.
Inheritance diagram for AddSensors2RobotAdapter:
Public Member Functions | |
AddSensors2RobotAdapter (const OdeHandle &odeHandle, const OsgHandle &osgHandle, OdeRobot *robot, const std::list< Sensor * > &sensors=std::list< Sensor * >(), const std::list< Motor * > &motors=std::list< Motor * >(), bool sensors_before_rest=false) | |
constructor of adapter | |
virtual | ~AddSensors2RobotAdapter () |
virtual void | addSensor (Sensor *sensor) |
adds a sensor to the robot. Must be called before placement of the robot, otherwise it has no affect | |
virtual void | addMotor (Motor *motor) |
adds a motor to the robot. Must be called before placement of the robot, otherwise it has no affect | |
virtual void | update () |
update the OSG notes here | |
virtual void | place (const osg::Matrix &pose) |
sets the pose of the vehicle | |
virtual bool | collisionCallback (void *data, dGeomID o1, dGeomID o2) |
virtual int | getSensorNumber () |
returns number of sensors | |
virtual int | getSensors (sensor *sensors_, int sensornumber) |
returns actual sensorvalues | |
virtual int | getMotorNumber () |
returns number of motors | |
virtual void | setMotors (const motor *motors_, int motornumber) |
sets actual motorcommands | |
void | doInternalStuff (GlobalData &globalData) |
this function is called in each timestep after control. | |
virtual Primitive * | getMainPrimitive () const |
return the primitive of the robot that is used for tracking and camera following | |
Protected Attributes | |
OdeRobot * | robot |
std::list< Sensor * > | sensors |
std::list< Motor * > | motors |
bool | sensors_before_rest |
Examples are Speed sensors, microphons and beepers and so forth TODO: add inspectable, make configurable work! Maybe it is easier to add this into OdeRobot itself!
AddSensors2RobotAdapter | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
OdeRobot * | robot, | |||
const std::list< Sensor * > & | sensors = std::list< Sensor * >() , |
|||
const std::list< Motor * > & | motors = std::list< Motor * >() , |
|||
bool | sensors_before_rest = false | |||
) |
constructor of adapter
robot | robot the wrap and plug sensors in | |
sensors | list of sensors to add | |
motors | list of motors to add |
~AddSensors2RobotAdapter | ( | ) | [virtual] |
void addMotor | ( | Motor * | motor | ) | [virtual] |
adds a motor to the robot. Must be called before placement of the robot, otherwise it has no affect
void addSensor | ( | Sensor * | sensor | ) | [virtual] |
adds a sensor to the robot. Must be called before placement of the robot, otherwise it has no affect
virtual bool collisionCallback | ( | void * | data, | |
dGeomID | o1, | |||
dGeomID | o2 | |||
) | [inline, virtual] |
Reimplemented from OdeRobot.
void doInternalStuff | ( | GlobalData & | globalData | ) | [virtual] |
this function is called in each timestep after control.
It should perform robot-internal checks and actions, like acting and sensing of internal motors/sensors etc.
globalData | structure that contains global data from the simulation environment |
Implements OdeRobot.
virtual Primitive* getMainPrimitive | ( | ) | const [inline, virtual] |
return the primitive of the robot that is used for tracking and camera following
Implements OdeRobot.
int getMotorNumber | ( | ) | [virtual] |
int getSensorNumber | ( | ) | [virtual] |
int getSensors | ( | sensor * | sensors_, | |
int | sensornumber | |||
) | [virtual] |
returns actual sensorvalues
sensors | sensors scaled to [-1,1] | |
sensornumber | length of the sensor array |
Implements AbstractRobot.
void place | ( | const osg::Matrix & | pose | ) | [virtual] |
void setMotors | ( | const motor * | motors_, | |
int | motornumber | |||
) | [virtual] |
sets actual motorcommands
motors | motors scaled to [-1,1] | |
motornumber | length of the motor array |
Implements AbstractRobot.
virtual void update | ( | ) | [inline, virtual] |
bool sensors_before_rest [protected] |