phyepuck.cpp
37 // All measures have been taken on the LARAL e-puck or the official specifications. Lengths are in
69 m_uniformColor(QList<PhyCylinder::SegmentColor>() << PhyCylinder::SegmentColor(SimpleInterval(-PI_GRECO, PI_GRECO), color()))
84 // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
94 // pack and a short cylinder modelling the upper part (where the electronic board is). We put the
95 // frame of reference of the body (which is equal to that of the whole robot) on the ground to have
96 // move stability and to simplify moving the robot (no need to apply displacements to put it on a
120 // Creating all the wheels. We first create the two motorized wheels and then the two passive ones.
152 PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
174 PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
228 // The min and max speed in rad/s have been derived for the e-puck wheel considering as maximum linear
229 // displacement 14 cm/s (that for the give wheel radius is approximately 1.1 ratations per second)
231 m_wheelsCtrl->setSpeedLimits(-maxAngularSpeed, -maxAngularSpeed, maxAngularSpeed, maxAngularSpeed);
234 connect(m_wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
235 connect(m_wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
246 const double curAngle = sensorsAngles[i] - 90.0; //double(i) * (360.0 / 8.0) + ((360.0 / 8.0) / 2.0);
263 mtr.w_pos = wVector(-batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
267 mtr.w_pos = wVector(batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
298 wheeledRobotsComputeKinematicMovement(mtr, m_leftWheelVelocity, m_rightWheelVelocity, wheelr, axletrack, world()->timeStep());
315 // Updating the transformation matrix of the robot. It is coincident with the matrix of the body
319 void PhyEpuck::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
324 void PhyEpuck::setGroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
336 m_frontMarker = new PlanarArrowGraphicalMarker(bodyr, bodyr / 6.0f, bodyr / 4.0f, 0.7f, world());
342 displacement.w_pos = wVector(0.0, 0.0, batteryplacedistancefromground + batteryplacez + bodyh + 0.0001f);
402 s.append(PhyCylinder::SegmentColor(SimpleInterval(normalizeRad(rangeMin), normalizeRad(rangeMax)), m_ledColors[i]));
bool getDrawFrontMarker() const
Returns whether a marker in the front part of the robot is drawn or not.
Definition: phyepuck.cpp:350
FARSA_UTIL_TEMPLATE real toRad(real x)
static const real batteryplacex
The x dimension of the battery pack under the robot.
Definition: phyepuck.h:53
void setKinematic(bool b, bool c=false)
Changes between kinematic/dynamic behaviour for the object.
Definition: phyobject.cpp:56
static const real wholebodym
The mass of the robot without the wheels and the battery.
Definition: phyepuck.h:91
void setGroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether ground IR sensors are drawn or not and how.
Definition: phyepuck.cpp:324
FARSA_UTIL_TEMPLATE real normalizeRad(real x)
void setUseColorTextureOfOwner(bool b)
set if the object will be rendered with the color and texture of our owner (if we have one) ...
Definition: wobject.cpp:97
void setLowerBaseColor(QColor color)
Sets the color of the lower base.
Definition: phycylinder.cpp:64
void setLeftWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the left wheel.
Definition: phyepuck.cpp:432
const QList< PhyCylinder::SegmentColor > & segmentsColor() const
Returns the colors of segments of the turret.
Definition: phyepuck.cpp:422
void setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether proximity IR sensors are drawn or not and how.
Definition: phyepuck.cpp:319
virtual void updateJointInfo()=0
Update the Joint informations (each PhyDOF will be updated)
void setUpperBaseColor(QColor color)
Sets the color of the upper base.
Definition: phycylinder.cpp:51
void attachToObject(WObject *object, bool makeOwner=false, const wMatrix &displacement=wMatrix::identity())
Attaches this object to another WObject.
Definition: graphicalwobject.cpp:43
void setTexture(QString textureName)
Set the texture to use for this WObject when rendered.
Definition: wobject.cpp:73
void setLedColors(QList< QColor > c, QColor upperBaseColor=QColor())
Sets the color of the leds of the epuck.
Definition: phyepuck.cpp:388
static wMatrix roll(real ang)
create a rotation around Z axis of ang radians
Definition: wmatrix.h:512
static wMatrix pitch(real ang)
create a rotation around X axis of ang radians
Definition: wmatrix.h:494
static const real batteryplacez
The z dimension of the battery pack under the robot.
Definition: phyepuck.h:63
void setSpeedLimits(QVector< double > minSpeeds, QVector< double > maxSpeeds)
sets the minimum and maximum velocities for each wheel
Definition: motorcontrollers.cpp:448
The structure used to define the color of intervals of the cylinder.
Definition: phycylinder.h:63
const wMatrix & matrix() const
return a reference to the transformation matrix
Definition: wobject.cpp:47
PhySuspension class PhySuspension is a joint implementing the system of springs, shock absorbers and ...
Definition: physuspension.h:41
PhyEpuck(World *world, QString name, const wMatrix &transformation=wMatrix::identity())
Creates an e-puck robot.
Definition: phyepuck.cpp:54
static const real axletrack
The distance between the two motorized wheels.
Definition: phyepuck.h:111
void doKinematicSimulation(bool k)
Changes the robot model from dynamic to kinematic and vice-versa.
Definition: phyepuck.cpp:355
void setOwner(Ownable *owner, bool destroy=true)
Sets the owner of this object.
Definition: ownable.cpp:47
static const real batteryplacey
The y dimension of the battery pack under the robot.
Definition: phyepuck.h:58
bool createMaterial(QString name)
Create a new material It return false if already exists a material with name passed.
Definition: world.cpp:40
A collection of SingleIR modelling ground sensors.
Definition: sensorcontrollers.h:587
const QList< SegmentColor > & segmentsColor() const
Returns the color of segments of the cylinder.
Definition: phycylinder.h:180
static const real batteryplacedistancefromground
The distance of the battery pack from the ground.
Definition: phyepuck.h:73
float real
MaterialDB & materials()
return the MaterialDB object for managing World's materials
Definition: world.h:334
void setSegmentsColor(QColor base, const QList< SegmentColor > &segmentsColor)
Sets the color of segments of the cylinder.
Definition: phycylinder.cpp:104
virtual void changedMatrix()
The function called when the transformation matrix of the robot is changed.
Definition: phyepuck.cpp:442
static wMatrix yaw(real ang)
create a rotation around Y axis of ang radians
Definition: wmatrix.h:503
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:599
void setProperties(QString mat1, QString mat2, real fs, real fk, real el, real sf, bool en=true)
set Frictions, Elasticity, Softness and Enabled/Disable collision between materials ...
Definition: world.cpp:131
void setRightWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the right wheel.
Definition: phyepuck.cpp:437
A graphical object displaying a planar arrow.
Definition: graphicalmarkers.h:92
static const real bodyh
The height of the upper part of the robot (containing the main electionic board)
Definition: phyepuck.h:85
Dedicated controller for wheeled robots.
Definition: motorcontrollers.h:167
A collection of SingleIR.
Definition: sensorcontrollers.h:504
void setDrawFrontMarker(bool drawMarker)
Whether to draw a marker in the front part of the robot or not.
Definition: phyepuck.cpp:329
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:542
static const real bodyr
The radius of the upper part of the robot (containing the main electionic board)
Definition: phyepuck.h:79