phykhepera.cpp
77 // // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
81 // world->materials().setProperties("kheperaMaterial", "default", 0.0f, 0.0f, 0.01f, 0.01f, true);
86 // // frame of reference of the body (which is equal to that of the whole robot) on the ground to have
87 // // move stability and to simplify moving the robot (no need to apply displacements to put it on a
105 // // Creating all the wheels. We first create the two motorized wheels and then the two passive ones.
106 // // The position of the wheels and their indexes are as follows (remember that the front of the
137 // PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
159 // PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
213 // // The min and max speed in rad/s have been derived for the e-puck wheel considering as maximum linear
214 // // displacement 14 cm/s (that for the give wheel radius is approximately 1.1 ratations per second)
216 // m_wheelsCtrl->setSpeedLimits(-maxAngularSpeed, -maxAngularSpeed, maxAngularSpeed, maxAngularSpeed);
219 // connect(m_wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
220 // connect(m_wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
247 // mtr.w_pos = wVector(-batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
251 // mtr.w_pos = wVector(batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
297 // // To compute the actual movement of the robot I assume the movement is on the plane on which
300 // // it around the axis passing through the instant center of rotation and perpendicular to the
307 // // If the speed of the two wheels is very similar, simply moving the robot forward (doing the
363 // // Now we have to compute the angular velocity of the robot. This is simply equal to v/r where
364 // // v is the linear velocity at a point that is distant r from C. We use the velocity of one of
365 // // the wheel: which weels depends on its distance from C. We take the wheel which is furthest from
366 // // C to avoid having r = 0 (which would lead to an invalid value of the angular velocity). Distances
370 // const real angularVelocity = (fabs(distLeftWheel) > fabs(distRightWheel)) ? (-leftSpeed / distLeftWheel) : (-rightSpeed / distRightWheel);
372 // // The angular displacement is simply the angular velocity multiplied by the timeStep. Here we
373 // // also compute the center of rotation in world coordinates (we also need to compute it in the frame
374 // // of reference centered between the wheels, not in O) and the axis of rotation (that is simply the
377 // const wVector centerOfRotation = matrix().transformVector(C - wVector(axletrack / 2.0, 0.0, 0.0));
399 // // Updating the transformation matrix of the robot. It is coincident with the matrix of the body
403 // void PhyEpuck::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)