phykhepera.cpp
80 // The front of the robot is towards -Y (positive speeds of the wheel cause the robot to move towards -Y)
89 // frame of reference of the body (which is equal to that of the whole robot) on the ground to have
90 // more stability and to simplify moving the robot (no need to apply displacements to put it on a
104 // Creating all the wheels. We first create the two motorized wheels and then the two passive ones.
136 PhyJoint* joint = new PhySuspension(wVector::Z(), m_body->matrix().untransformVector(wheel->matrix().w_pos), wVector::X(), m_body, wheel);
158 PhyJoint* joint = new PhySuspension(wVector::Z(), m_body->matrix().untransformVector(wheel->matrix().w_pos), wVector::X(), m_body, wheel);
180 PhyJoint* joint = new PhyBallAndSocket(m_body->matrix().untransformVector(wheel->matrix().w_pos), m_body, wheel);
201 PhyJoint* joint = new PhyBallAndSocket(m_body->matrix().untransformVector(wheel->matrix().w_pos), m_body, wheel);
212 // The min and max speed in rad/s have been derived for the e-puck wheel considering as maximum linear
213 // displacement 14 cm/s (that for the give wheel radius is approximately 1.1 ratations per second)
218 m_wheelsCtrl->setSpeedLimits(-maxAngularSpeed, -maxAngularSpeed, maxAngularSpeed, maxAngularSpeed);
221 connect(m_wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
222 connect(m_wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
233 const double curAngle = sensorsAngles[i] - 90.0; //double(i) * (360.0 / 8.0) + ((360.0 / 8.0) / 2.0);
271 wheeledRobotsComputeKinematicMovement(mtr, m_leftWheelVelocity, m_rightWheelVelocity, wheelr, axletrack, world()->timeStep());
285 // Updating the transformation matrix of the robot. It is coincident with the matrix of the body
289 void PhyKhepera::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
301 m_frontMarker = new PlanarArrowGraphicalMarker(bodyr, bodyr / 6.0f, bodyr / 4.0f, 0.7f, world());
void doKinematicSimulation(bool k)
Changes the robot model from dynamic to kinematic and vice-versa.
Definition: phykhepera.cpp:320
FARSA_UTIL_TEMPLATE real toRad(real x)
void setKinematic(bool b, bool c=false)
Changes between kinematic/dynamic behaviour for the object.
Definition: phyobject.cpp:56
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 setRightWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the right wheel.
Definition: phykhepera.cpp:358
static const real axletrack
The distance between the two motorized wheels.
Definition: phykhepera.h:87
void setLeftWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the left wheel.
Definition: phykhepera.cpp:353
void setDrawFrontMarker(bool drawMarker)
Whether to draw a marker in the front part of the robot or not.
Definition: phykhepera.cpp:294
virtual void updateJointInfo()=0
Update the Joint informations (each PhyDOF will be updated)
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
PhyKhepera(World *world, QString name, const wMatrix &transformation=wMatrix::identity())
Creates a khepera II robot.
Definition: phykhepera.cpp:52
static wMatrix roll(real ang)
create a rotation around Z axis of ang radians
Definition: wmatrix.h:512
void setSpeedLimits(QVector< double > minSpeeds, QVector< double > maxSpeeds)
sets the minimum and maximum velocities for each wheel
Definition: motorcontrollers.cpp:448
static const real bodydistancefromground
The distance of the body from the ground.
Definition: phykhepera.h:52
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
void setOwner(Ownable *owner, bool destroy=true)
Sets the owner of this object.
Definition: ownable.cpp:47
wVector untransformVector(const wVector &v) const
invert the rotation and translation on the vector v
Definition: wmatrix.h:368
bool createMaterial(QString name)
Create a new material It return false if already exists a material with name passed.
Definition: world.cpp:40
float real
MaterialDB & materials()
return the MaterialDB object for managing World's materials
Definition: world.h:334
static wMatrix yaw(real ang)
create a rotation around Y axis of ang radians
Definition: wmatrix.h:503
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
A graphical object displaying a planar arrow.
Definition: graphicalmarkers.h:92
virtual void changedMatrix()
The function called when the transformation matrix of the robot is changed.
Definition: phykhepera.cpp:363
bool getDrawFrontMarker() const
Returns whether a marker in the front part of the robot is drawn or not.
Definition: phykhepera.cpp:315
Dedicated controller for wheeled robots.
Definition: motorcontrollers.h:167
A collection of SingleIR.
Definition: sensorcontrollers.h:504
void setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether proximity IR sensors are drawn or not and how.
Definition: phykhepera.cpp:289
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:542