The class modelling an e-puck robot. More...
Public Member Functions | |
PhyEpuck (World *world, QString name, const wMatrix &transformation=wMatrix::identity()) | |
Creates an e-puck robot. | |
virtual | ~PhyEpuck () |
Destructor. | |
void | doKinematicSimulation (bool k) |
Changes the robot model from dynamic to kinematic and vice-versa. | |
bool | getDrawFrontMarker () const |
Returns whether a marker in the front part of the robot is drawn or not. | |
IRSensorController * | groundIRSensorController () |
Returns the ground IR sensors controller. | |
bool | isKinematic () const |
Returns true if we are using the kinematic model. | |
virtual void | postUpdate () |
Post-updates the robot. | |
virtual void | preUpdate () |
Pre-updates the robot. | |
IRSensorController * | proximityIRSensorController () |
Returns the proximity infrared sensors controller. | |
void | setDrawFrontMarker (bool drawMarker) |
Whether to draw a marker in the front part of the robot or not. | |
void | setGroundIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets whether ground IR sensors are drawn or not and how. | |
void | setProximityIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets whether proximity IR sensors are drawn or not and how. | |
WheelMotorController * | wheelsController () |
Returns the motor controller for the wheels. | |
Public Member Functions inherited from WObject | |
WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true) | |
create the object and automatically put this into the world | |
virtual | ~WObject () |
destroy the Object and drop it from the world | |
QColor | color () const |
return the color of this object | |
bool | isInvisible () |
return if it is invisible | |
const wMatrix & | matrix () const |
return a reference to the transformation matrix | |
QString | name () const |
Return the name of this object. | |
void | setAlpha (int alpha) |
set the value of alpha channel (the transparency) | |
void | setColor (QColor c) |
Set the color to use on rendering. | |
void | setInvisible (bool b) |
set invisibility | |
void | setMatrix (const wMatrix &newm) |
set a new matrix | |
void | setPosition (const wVector &newpos) |
set the position specified in global coordinate frame | |
void | setPosition (real x, real y, real z) |
set the position specified in global coordinate frame | |
void | setTexture (QString textureName) |
Set the texture to use for this WObject when rendered. | |
void | setUseColorTextureOfOwner (bool b) |
set if the object will be rendered with the color and texture of our owner (if we have one) | |
QString | texture () const |
Return the texture name. | |
bool | useColorTextureOfOwner () const |
if true, we will use color and texture of our owner (if we have one) | |
World * | world () |
Return the world. | |
const World * | world () const |
Return the world (const version) | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
Static Public Attributes | |
static const real | axletrack = 0.053f |
The distance between the two motorized wheels. | |
static const real | batterym = 0.042f |
The mass of the battery. | |
static const real | batteryplacedistancefromground = 0.0015f |
The distance of the battery pack from the ground. | |
static const real | batteryplacex = 0.043f |
The x dimension of the battery pack under the robot. | |
static const real | batteryplacey = 0.055f |
The y dimension of the battery pack under the robot. | |
static const real | batteryplacez = 0.033f |
The z dimension of the battery pack under the robot. | |
static const real | bodyh = 0.021f |
The height of the upper part of the robot (containing the main electionic board) | |
static const real | bodyr = 0.035f |
The radius of the upper part of the robot (containing the main electionic board) | |
static const real | passivewheelm = 0.005f |
The mass of the passive wheels. | |
static const real | passivewheelr = 0.005f |
The radius of the passive wheels. | |
static const real | wheelh = 0.003f |
The height of the motorized wheels. | |
static const real | wheelm = 0.010f |
The mass of one motorized wheel. | |
static const real | wheelr = 0.0205f |
The radius of the motorized wheels. | |
static const real | wholebodym = 0.078f |
The mass of the robot without the wheels and the battery. | |
Protected Slots | |
void | setLeftWheelDesideredVelocity (real velocity) |
Sets the desidered velocity of the left wheel. | |
void | setRightWheelDesideredVelocity (real velocity) |
Sets the desidered velocity of the right wheel. | |
Protected Member Functions | |
virtual void | changedMatrix () |
The function called when the transformation matrix of the robot is changed. | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
Protected Attributes inherited from WObject | |
QColor | colorv |
Color, it contains also alpha channel. | |
bool | invisible |
if TRUE it will not renderized | |
QString | namev |
Name of the WObject. | |
QString | texturev |
Texture name. | |
wMatrix | tm |
Trasformation matrix. | |
bool | usecolortextureofowner |
if true, we will use color and texture of our owner (if we have one). | |
World * | worldv |
World. | |
Detailed Description
The class modelling an e-puck robot.
This class models an e-puck robot. For more information about the robot go to http://mobots.epfl.ch/e-puck.html
Definition at line 45 of file phyepuck.h.
Constructor & Destructor Documentation
PhyEpuck | ( | World * | world, |
QString | name, | ||
const wMatrix & | transformation = wMatrix::identity() |
||
) |
Creates an e-puck robot.
- Parameters
-
world the world in which the robot lives name the name of the robots transformation the transformation matrix of the robot
Definition at line 54 of file phyepuck.cpp.
References PhyEpuck::axletrack, PhyEpuck::batterym, PhyEpuck::batteryplacedistancefromground, PhyEpuck::batteryplacex, PhyEpuck::batteryplacey, PhyEpuck::batteryplacez, PhyEpuck::bodyh, PhyEpuck::bodyr, MaterialDB::createMaterial(), PhyJoint::dofs(), wMatrix::identity(), World::materials(), WObject::matrix(), PhyEpuck::passivewheelm, PhyEpuck::passivewheelr, wMatrix::pitch(), WObject::setColor(), PhyEpuck::setLeftWheelDesideredVelocity(), PhyObject::setMass(), WObject::setMatrix(), Ownable::setOwner(), MaterialDB::setProperties(), PhyEpuck::setRightWheelDesideredVelocity(), WheelMotorController::setSpeedLimits(), WObject::tm, farsa::toRad(), PhyJoint::updateJointInfo(), PhyEpuck::wheelh, PhyEpuck::wheelm, PhyEpuck::wheelr, PhyEpuck::wholebodym, and wMatrix::yaw().
|
virtual |
Destructor.
Definition at line 271 of file phyepuck.cpp.
Member Function Documentation
|
protectedvirtual |
The function called when the transformation matrix of the robot is changed.
This updates the matrix of all sub-objects
Reimplemented from WObject.
Definition at line 395 of file phyepuck.cpp.
References WObject::matrix(), WObject::setMatrix(), WObject::tm, and PhyJoint::updateJointInfo().
void doKinematicSimulation | ( | bool | k | ) |
Changes the robot model from dynamic to kinematic and vice-versa.
- Parameters
-
k if true switches to the kinematic e-puck model, if false to the dynamic one (at creation the model is always dynamic)
Definition at line 352 of file phyepuck.cpp.
References PhyObject::setKinematic().
bool getDrawFrontMarker | ( | ) | const |
Returns whether a marker in the front part of the robot is drawn or not.
- Returns
- true if a marker in the front part of the robot is drawn
Definition at line 347 of file phyepuck.cpp.
Referenced by PhyEpuck::setDrawFrontMarker().
|
inline |
Returns the ground IR sensors controller.
- Returns
- the ground IR sensors controller
Definition at line 168 of file phyepuck.h.
|
inline |
Returns true if we are using the kinematic model.
- Returns
- true if we are using the kinematic model
Definition at line 246 of file phyepuck.h.
|
virtual |
Post-updates the robot.
This method is called at each step of the world just after the physic update
Reimplemented from WObject.
Definition at line 302 of file phyepuck.cpp.
References SensorController::isEnabled(), WObject::matrix(), WObject::tm, SimulatedIRProximitySensorController::update(), and SimulatedIRGroundSensorController::update().
|
virtual |
Pre-updates the robot.
This method is called at each step of the world just before the physic update
Reimplemented from WObject.
Definition at line 285 of file phyepuck.cpp.
References PhyEpuck::axletrack, MotorController::isEnabled(), WObject::matrix(), WObject::setMatrix(), WheelMotorController::update(), PhyEpuck::wheelr, and WObject::world().
|
inline |
Returns the proximity infrared sensors controller.
- Returns
- the proximity infrared sensors controller
Definition at line 158 of file phyepuck.h.
void setDrawFrontMarker | ( | bool | drawMarker | ) |
Whether to draw a marker in the front part of the robot or not.
- Parameters
-
drawMarker if true draws a marker in the front part of the robot
Definition at line 326 of file phyepuck.cpp.
References GraphicalWObject::attachToObject(), PhyEpuck::batteryplacedistancefromground, PhyEpuck::batteryplacez, PhyEpuck::bodyh, PhyEpuck::bodyr, PhyEpuck::getDrawFrontMarker(), wMatrix::roll(), WObject::setColor(), WObject::setTexture(), WObject::setUseColorTextureOfOwner(), and WObject::world().
void setGroundIRSensorsGraphicalProperties | ( | bool | drawSensor, |
bool | drawRay = false , |
||
bool | drawRealRay = false |
||
) |
Sets whether ground IR sensors are drawn or not and how.
- Parameters
-
drawSensor whether to draw the sensor or not drawRay whether to draw the IR rays or not drawRealRay if true rays are drawn in their actual length, otherwise only the direction is given
Definition at line 321 of file phyepuck.cpp.
References SimulatedIRGroundSensorController::setGraphicalProperties().
|
protectedslot |
Sets the desidered velocity of the left wheel.
This is used when in kinematic to move the robot. We only use velocity because robots can only move by setting wheel velocities
- Parameters
-
velocity the desidered velocity (in radiants per second)
Definition at line 385 of file phyepuck.cpp.
Referenced by PhyEpuck::PhyEpuck().
void setProximityIRSensorsGraphicalProperties | ( | bool | drawSensor, |
bool | drawRay = false , |
||
bool | drawRealRay = false |
||
) |
Sets whether proximity IR sensors are drawn or not and how.
- Parameters
-
drawSensor whether to draw the sensor or not drawRay whether to draw the IR rays or not drawRealRay if true rays are drawn in their actual length, otherwise only the direction is given
Definition at line 316 of file phyepuck.cpp.
References SimulatedIRProximitySensorController::setGraphicalProperties().
|
protectedslot |
Sets the desidered velocity of the right wheel.
This is used when in kinematic to move the robot. We only use velocity because robots can only move by setting wheel velocities
- Parameters
-
velocity the desidered velocity (in radiants per second)
Definition at line 390 of file phyepuck.cpp.
Referenced by PhyEpuck::PhyEpuck().
|
inline |
Returns the motor controller for the wheels.
- Returns
- the motor controller for the wheels
Definition at line 148 of file phyepuck.h.
Member Data Documentation
|
static |
The distance between the two motorized wheels.
Definition at line 110 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::preUpdate().
|
static |
The mass of the battery.
Definition at line 67 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The distance of the battery pack from the ground.
Definition at line 72 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::setDrawFrontMarker().
|
static |
The x dimension of the battery pack under the robot.
Definition at line 52 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The y dimension of the battery pack under the robot.
Definition at line 57 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The z dimension of the battery pack under the robot.
Definition at line 62 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::setDrawFrontMarker().
|
static |
The height of the upper part of the robot (containing the main electionic board)
Definition at line 84 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::setDrawFrontMarker().
|
static |
The radius of the upper part of the robot (containing the main electionic board)
Definition at line 78 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::setDrawFrontMarker().
|
static |
The mass of the passive wheels.
The real robot has no passive wheels, here we need them to reduce the friction with the ground
Definition at line 126 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The radius of the passive wheels.
The real robot has no passive wheels, here we need them to reduce the friction with the ground
Definition at line 118 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The height of the motorized wheels.
Definition at line 100 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The mass of one motorized wheel.
Definition at line 105 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
|
static |
The radius of the motorized wheels.
Definition at line 95 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck(), and PhyEpuck::preUpdate().
|
static |
The mass of the robot without the wheels and the battery.
Definition at line 90 of file phyepuck.h.
Referenced by PhyEpuck::PhyEpuck().
The documentation for this class was generated from the following files:
- worldsim/include/phyepuck.h
- worldsim/src/phyepuck.cpp