phyepuck.cpp
36 // All measures have been taken on the LARAL e-puck or the official specifications. Lengths are in
79 // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
89 // pack and a short cylinder modelling the upper part (where the electronic board is). We put the
90 // frame of reference of the body (which is equal to that of the whole robot) on the ground to have
91 // move stability and to simplify moving the robot (no need to apply displacements to put it on a
115 // Creating all the wheels. We first create the two motorized wheels and then the two passive ones.
147 PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
169 PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
223 // The min and max speed in rad/s have been derived for the e-puck wheel considering as maximum linear
224 // displacement 14 cm/s (that for the give wheel radius is approximately 1.1 ratations per second)
226 m_wheelsCtrl->setSpeedLimits(-maxAngularSpeed, -maxAngularSpeed, maxAngularSpeed, maxAngularSpeed);
229 connect(m_wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
230 connect(m_wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
257 mtr.w_pos = wVector(-batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
261 mtr.w_pos = wVector(batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
361 // the wheel: which weels depends on its distance from C. We take the wheel which is furthest from
362 // C to avoid having r = 0 (which would lead to an invalid value of the angular velocity). Distances
366 const real angularVelocity = (fabs(distLeftWheel) > fabs(distRightWheel)) ? (-leftSpeed / distLeftWheel) : (-rightSpeed / distRightWheel);
369 // also compute the center of rotation in world coordinates (we also need to compute it in the frame
370 // of reference centered between the wheels, not in O) and the axis of rotation (that is simply the
373 const wVector centerOfRotation = matrix().transformVector(C - wVector(axletrack / 2.0, 0.0, 0.0));
395 // Updating the transformation matrix of the robot. It is coincident with the matrix of the body
399 void PhyEpuck::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
404 void PhyEpuck::setGroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)