31 #include <selforg/storeable.h>
73 const std::string& name,
const std::string& revision);
132 virtual void place(
const Pos& pos)
final;
214 virtual bool store(FILE* f)
const;
247 virtual void fixate(
GlobalData& global,
int primitiveID=-1,
double duration = 0);
Matrix type.
Definition: matrix.h:65
Pose initialPose
Definition: oderobot.h:273
virtual int getSensors(double *sensors, int sensornumber) final
returns actual sensorvalues
Definition: oderobot.cpp:59
Interface for objects, that can be stored and restored to/from a file stream (binary).
Definition: storeable.h:33
virtual Primitive * getMainPrimitive() const
return the primitive of the robot that is used for tracking and camera following
Definition: oderobot.h:197
Data structure for accessing the ODE.
Definition: odehandle.h:44
virtual bool unFixate(GlobalData &global)
release the robot in case it is fixated and return true in this case
Definition: oderobot.cpp:343
virtual void doInternalStuff(GlobalData &globalData)
this function is called in each simulation timestep (always after control).
Definition: oderobot.cpp:236
structure to hold attachment data for sensors and motors
Definition: oderobot.h:48
virtual Position getPosition() const
returns position of the object
Definition: oderobot.cpp:357
virtual void setColor(const Color &col)
sets color of the robot
Definition: oderobot.cpp:203
static bool isGeomInPrimitiveList(Primitive **ps, int len, dGeomID geom)
Definition: oderobot.cpp:255
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual bool restore(FILE *f)
loads the object from the given file stream (ASCII preferred).
Definition: oderobot.cpp:412
virtual int getMotorNumberIntern()
overload this function in a subclass to specific the number of custom sensors
Definition: oderobot.h:100
virtual Primitives & getAllPrimitives()
Definition: oderobot.h:204
virtual std::list< SensorMotorInfo > getSensorInfos() override
returns the information for the sensors.
Definition: oderobot.cpp:99
double sensor
Definition: types.h:29
virtual Joints getAllJoints() const
returns a list of all primitives of the robot (const version) (used to store and restore the robot) ...
Definition: oderobot.h:208
virtual int getSensorNumberIntern()
overload this function in a subclass to specific the number of custom sensors
Definition: oderobot.h:97
std::vector< Primitive * > Primitives
Definition: oderobot.h:54
virtual int getSensorsIntern(double *sensors, int sensornumber)
overload this function in a subclass to do specific sensor handling, not needed for generic sensors ...
Definition: oderobot.h:90
OdeRobot(const OdeHandle &odeHandle, const OsgHandle &osgHandle, const std::string &name, const std::string &revision)
Constructor.
Definition: oderobot.cpp:39
virtual void update()
update the OSG notes here, if overwritten, call OdeRobot::update()!
Definition: oderobot.cpp:242
bool initialized
Definition: oderobot.h:281
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
virtual matrix::Matrix getOrientation() const
returns the orientation of the object
Definition: oderobot.cpp:383
virtual void moveToPose(Pose pose, int primitiveID=-1)
relocates robot such its primitive with the given ID is at the new pose (keep relative pose of all pr...
Definition: oderobot.cpp:298
virtual void setMotorsIntern(const double *motors, int motorsnumber)
overload this function in a subclass to do specific sensor handling, not needed for generic motors ...
Definition: oderobot.h:94
Attachment(int pI=-1, int jI=-1)
Definition: oderobot.h:49
Joints joints
list of joints (should be populated by subclasses)
Definition: oderobot.h:267
virtual Pose getRelativeInitialPose()
returns the initial relative pose of the main primitive (use it with moveToPose to further translate ...
Definition: oderobot.h:239
virtual bool store(FILE *f) const
returns a list of all joints of the robot (const version)
Definition: oderobot.cpp:398
virtual void addSensor(std::shared_ptr< Sensor > sensor, Attachment attachment=Attachment())
adds a sensor to the robot.
Definition: oderobot.cpp:152
std::vector< Joint * > Joints
Definition: oderobot.h:55
Definition: position.h:30
virtual void addTorqueSensors(double maxtorque=1.0, int avg=1)
adds a torque sensor to each joint. Call it after placement of robot.
Definition: oderobot.cpp:172
std::pair< std::shared_ptr< Sensor >, Attachment > SensorAttachment
Definition: oderobot.h:56
osg::Matrix Pose
Definition: pose.h:35
virtual bool collisionCallback(void *data, dGeomID o1, dGeomID o2)
Definition: oderobot.h:149
int primitiveIndex
Definition: oderobot.h:50
virtual int getSensorNumber() final
returns number of sensors
Definition: oderobot.cpp:79
void attachSensor(SensorAttachment &sa)
Definition: oderobot.cpp:120
Interface for objects, that can be stored and restored to/from a file stream (binary).
Definition: sensormotorinfo.h:33
virtual void placeIntern(const osg::Matrix &pose)=0
wrapper to for
Definition: oderobot.cpp:54
holding a temporary joint
Definition: tmpprimitive.h:101
virtual int getMotorNumber() final
returns number of motors
Definition: oderobot.cpp:89
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
virtual Position getSpeed() const
returns linear speed vector of the object
Definition: oderobot.cpp:367
virtual void moveToPosition(Pos pos=Pos(0, 0, 0.5), int primitiveID=-1)
relocates robot such its primitive with the given ID is at the new postion (keep current pose)...
Definition: oderobot.cpp:269
Data structure holding all essential global information.
Definition: globaldata.h:57
Specialised agent for ode robots.
Definition: odeagent.h:62
int jointIndex
Definition: oderobot.h:51
virtual std::list< SensorAttachment > getAttachedSensors()
returns all generic sensors with their attachment
Definition: oderobot.h:114
std::list< SensorAttachment > sensors
Definition: oderobot.h:269
virtual Joints & getAllJoints()
Definition: oderobot.h:210
virtual Primitives getAllPrimitives() const
returns a list of all primitives of the robot (used to store and restore the robot) ...
Definition: oderobot.h:202
std::pair< std::shared_ptr< Motor >, Attachment > MotorAttachment
Definition: oderobot.h:57
virtual void place(const Pos &pos) final
sets the vehicle to position pos
Definition: oderobot.cpp:210
void attachMotor(MotorAttachment &ma)
Definition: oderobot.cpp:136
OsgHandle osgHandle
Definition: oderobot.h:278
OdeHandle odeHandle
Definition: oderobot.h:277
double motor
Definition: types.h:30
dSpaceID parentspace
Definition: oderobot.h:279
Abstract class for ODE robots.
Definition: oderobot.h:64
virtual Pose getInitialPose()
returns the initial pose of the main primitive (use it e.g. with moveToPose)
Definition: oderobot.h:233
bool askedfornumber
Definition: oderobot.h:282
Pose initialRelativePose
Definition: oderobot.h:275
virtual ~OdeRobot()
calls cleanup()
Definition: oderobot.cpp:50
Primitives objects
list of objects (should be populated by subclasses)
Definition: oderobot.h:265
virtual void cleanup()
deletes all objects (primitives) and joints (is called automatically in destructor) ...
Definition: oderobot.cpp:186
virtual std::list< MotorAttachment > getAttachedMotors()
returns all generic motors with their attachment
Definition: oderobot.h:119
virtual Position getAngularSpeed() const
returns angular velocity vector of the object
Definition: oderobot.cpp:375
virtual void sense(GlobalData &globalData)
this function is called each controlstep before control.
Definition: oderobot.cpp:230
virtual void fixate(GlobalData &global, int primitiveID=-1, double duration=0)
fixates the given primitive of the robot at its current position to the world for a certain time...
Definition: oderobot.cpp:325
std::list< MotorAttachment > motors
Definition: oderobot.h:270
virtual void setMotors(const double *motors, int motornumber) final
sets actual motorcommands
Definition: oderobot.cpp:69
Abstract class (interface) for robot in general.
Definition: abstractrobot.h:41
virtual void addMotor(std::shared_ptr< Motor > motor, Attachment attachment=Attachment())
adds a motor to the robot.
Definition: oderobot.cpp:162
virtual std::list< SensorMotorInfo > getMotorInfos() override
returns the information for the motors.
Definition: oderobot.cpp:109
TmpJoint * fixationTmpJoint
Definition: oderobot.h:272