phyepuck.cpp
1 /********************************************************************************
2  * WorldSim -- library for robot simulations *
3  * Copyright (C) 2012-2013 *
4  * Gianluca Massera <emmegian@yahoo.it> *
5  * Fabrizio Papi <erkito87@gmail.com> *
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the Free Software *
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
20  ********************************************************************************/
21 
22 #include "phyepuck.h"
23 #include "phybox.h"
24 #include "phycylinder.h"
25 #include "phyfixed.h"
26 #include "phyballandsocket.h"
27 #include "physphere.h"
28 #include "physuspension.h"
29 #include "phycompoundobject.h"
30 #include "phycone.h"
31 #include "mathutils.h"
32 #include "graphicalmarkers.h"
33 #include <cmath>
34 
35 namespace farsa {
36 
37 // All measures have been taken on the LARAL e-puck or the official specifications. Lengths are in
38 // meters, weights in kilograms.
39 const real PhyEpuck::batteryplacex = 0.043f;
40 const real PhyEpuck::batteryplacey = 0.055f;
41 const real PhyEpuck::batteryplacez = 0.033f;
42 const real PhyEpuck::batterym = 0.042f;
44 const real PhyEpuck::bodyr = 0.035f;
45 const real PhyEpuck::bodyh = 0.021f;
46 const real PhyEpuck::wholebodym = 0.078f;
47 const real PhyEpuck::wheelr = 0.0205f;
48 const real PhyEpuck::wheelh = 0.003f;
49 const real PhyEpuck::wheelm = 0.010f;
50 const real PhyEpuck::axletrack = 0.053f;
51 const real PhyEpuck::passivewheelr = 0.005f;
52 const real PhyEpuck::passivewheelm = 0.005f;
53 
54 PhyEpuck::PhyEpuck(World* world, QString name, const wMatrix& transformation) :
55  WObject(world, name, transformation, false),
56  m_body(NULL),
57  m_turret(NULL),
58  m_wheels(),
59  m_wheelsTransformation(),
60  m_wheelJoints(),
61  m_wheelsCtrl(NULL),
62  m_proximityIR(NULL),
63  m_groundIR(NULL),
64  m_kinematicSimulation(false),
65  m_leftWheelVelocity(0.0f),
66  m_rightWheelVelocity(0.0f),
67  m_frontMarker(NULL),
68  m_ledColors(),
69  m_uniformColor(QList<PhyCylinder::SegmentColor>() << PhyCylinder::SegmentColor(SimpleInterval(-PI_GRECO, PI_GRECO), color()))
70 {
71  // --- reference frame
72  // X
73  // ^
74  // | ------
75  // | | |
76  // | -------------------
77  // | | battery |
78  // | | |
79  // | -------------------
80  // | | |
81  // | ------
82  // |
83  // +---------------------> Y
84  // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
85  // and the camera is in -Y
86 
87  // Creating a material for the e-puck
88  world->materials().createMaterial("epuckMaterial");
89  world->materials().setProperties("epuckMaterial", "default", 0.0f, 0.0f, 0.01f, 0.01f, true);
90  world->materials().createMaterial("epuckTire");
91  world->materials().setProperties("epuckTire", "default", 1.2f, 0.9f, 0.01f, 0.01f, true);
92 
93  // Now creating the body of the e-puck. It is made up of two pieces: a box modelling the battery
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
97  // plane)
98  {
99  QVector<PhyObject*> bodyObjs;
101  // First we create the battery pack
103  tm.w_pos.z = (batteryplacez / 2.0f) + batteryplacedistancefromground;
104  obj->setMatrix(tm);
105  bodyObjs << obj;
106  // Then we create the upper part
107  m_turret = new PhyCylinder(bodyr, bodyh, world);
108  tm = wMatrix::yaw(toRad(90.0f));
109  tm.w_pos.z = batteryplacez + batteryplacedistancefromground + (bodyh / 2.0f);
110  m_turret->setMatrix( tm );
111  bodyObjs << m_turret;
112  // Finally we create the compound object actually modelling the body
113  m_body = new PhyCompoundObject(bodyObjs, world, "base");
114  m_body->setMass(batterym + wholebodym);
115  m_body->setMaterial("epuckMaterial");
116  m_body->setOwner(this, false);
117  m_body->setMatrix(transformation);
118  }
119 
120  // Creating all the wheels. We first create the two motorized wheels and then the two passive ones.
121  // The position of the wheels and their indexes are as follows (remember that the front of the
122  // robot is towards -Y):
123  //
124  // X
125  // ^
126  // | ------
127  // | | 0 |
128  // | -------------------
129  // | | battery |
130  // | | 3 2 |
131  // | -------------------
132  // | | 1 |
133  // | ------
134  // |
135  // +---------------------> Y
136 
137  // Creating the first motorized wheel and its joint
138  {
139  // The matrix is relative to the base. First creating the wheel
141  tm.w_pos = wVector(axletrack / 2.0f, 0.0f, wheelr);
142  PhyObject* wheel = new PhyCylinder(wheelr, wheelh, world, "motorWheel");
143  wheel->setMass(wheelm);
144  wheel->setColor(Qt::blue);
145  wheel->setMaterial("epuckTire");
146  wheel->setOwner(this, false);
147  wheel->setMatrix(tm * m_body->matrix());
148  m_wheels.append(wheel);
149  m_wheelsTransformation.append(tm);
150 
151  // Now creating the joint
152  PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
153  joint->dofs()[0]->disableLimits();
154  joint->setOwner(this, false);
155  joint->updateJointInfo();
156  m_wheelJoints.append(joint);
157  }
158 
159  // Creating the second motorized wheel and its joint
160  {
161  // The matrix is relative to the base. First creating the wheel
163  tm.w_pos = wVector(-axletrack / 2.0f, 0.0f, wheelr);
164  PhyObject* wheel = new PhyCylinder(wheelr, wheelh, world, "motorWheel");
165  wheel->setMass(wheelm);
166  wheel->setColor(Qt::blue);
167  wheel->setMaterial("epuckTire");
168  wheel->setOwner(this, false);
169  wheel->setMatrix(tm * m_body->matrix());
170  m_wheels.append(wheel);
171  m_wheelsTransformation.append(tm);
172 
173  // Now creating the joint
174  PhyJoint* joint = new PhySuspension(m_body->matrix().x_ax, wheel->matrix().w_pos, m_body->matrix().z_ax, m_body, wheel);
175  joint->dofs()[0]->disableLimits();
176  joint->setOwner(this, false);
177  joint->updateJointInfo();
178  m_wheelJoints.append(joint);
179  }
180 
181  // Creating the first passive wheel and its joint
182  {
183  // The matrix is relative to the base. First creating the wheel
185  tm.w_pos = wVector(0.0f, (batteryplacey / 2.0f) - passivewheelr, passivewheelr);
186  PhyObject* wheel = new PhySphere(passivewheelr, world, "passiveWheel");
187  wheel->setMass(passivewheelm);
188  wheel->setColor(Qt::blue);
189  wheel->setMaterial("epuckTire");
190  wheel->setOwner(this, false);
191  wheel->setMatrix(tm * m_body->matrix());
192  m_wheels.append(wheel);
193  m_wheelsTransformation.append(tm);
194 
195  // Now creating the joint
196  PhyJoint* joint = new PhyBallAndSocket(wheel->matrix().w_pos, m_body, wheel);
197  joint->setOwner(this, false);
198  joint->updateJointInfo();
199  m_wheelJoints.append(joint);
200  }
201 
202  // Creating the second passive wheel and its joint
203  {
204  // The matrix is relative to the base. First creating the wheel
206  tm.w_pos = wVector(0.0f, -((batteryplacey / 2.0f) - passivewheelr), passivewheelr);
207  PhyObject* wheel = new PhySphere(passivewheelr, world, "passiveWheel");
208  wheel->setMass(passivewheelm);
209  wheel->setColor(Qt::blue);
210  wheel->setMaterial("epuckTire");
211  wheel->setOwner(this, false);
212  wheel->setMatrix(tm * m_body->matrix());
213  m_wheels.append(wheel);
214  m_wheelsTransformation.append(tm);
215 
216  // Now creating the joint
217  PhyJoint* joint = new PhyBallAndSocket(wheel->matrix().w_pos, m_body, wheel);
218  joint->setOwner(this, false);
219  joint->updateJointInfo();
220  m_wheelJoints.append(joint);
221  }
222 
223  // Now we can create the motor controller
224  QVector<PhyDOF*> motors;
225  motors << m_wheelJoints[0]->dofs()[0] << m_wheelJoints[1]->dofs()[0];
226  m_wheelsCtrl = new WheelMotorController(motors, world);
227  m_wheelsCtrl->setOwner(this, false);
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)
230  const real maxAngularSpeed = 1.1f * 2.0f * PI_GRECO;
231  m_wheelsCtrl->setSpeedLimits(-maxAngularSpeed, -maxAngularSpeed, maxAngularSpeed, maxAngularSpeed);
232 
233  // Connecting wheels speed signals to be able to move the robot when in kinematic
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)));
236 
237  // Creating the proximity IR sensors
238  QVector<SingleIR> sensors;
239 
240 #if defined(__GNUC__) && defined(DEVELOPER_WARNINGS)
241  #warning QUI DECIDERE PER I RANGE/APERTURE E LE POSIZIONI
242 #endif
243  // Adding the sensors. The epuck has 8 proximity infrared sensors
244  const double sensorsAngles[] = {-90.0, -54.0, -18.0, 18.0, 54.0, 90.0, 150.0, 210.0};
245  for (unsigned int i = 0; i < 8; i++) {
246  const double curAngle = sensorsAngles[i] - 90.0; //double(i) * (360.0 / 8.0) + ((360.0 / 8.0) / 2.0);
247  const double radius = bodyr;
248 
249  wMatrix mtr = wMatrix::yaw(toRad(curAngle + 90.0)) * wMatrix::pitch(PI_GRECO / 2.0);
250  mtr.w_pos.x = radius * cos(toRad(curAngle));
251  mtr.w_pos.y = radius * sin(toRad(curAngle));
253 
254  sensors.append(SingleIR(m_body, mtr, 0.0, 0.05, 10.0, 5));
255  }
256  m_proximityIR = new SimulatedIRProximitySensorController(world, sensors);
257 
258  // Now creating the three ground IR sensors
259  sensors.clear();
260  wMatrix mtr = wMatrix::yaw(PI_GRECO);
261 
262  // Adding the sensors. The e-puck has 3 ground infrared sensors in the front part
263  mtr.w_pos = wVector(-batteryplacex / 2.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
264  sensors.append(SingleIR(m_body, mtr, 0.0, mtr.w_pos.z + 0.005, 0.0, 1));
265  mtr.w_pos = wVector(0.0f, -batteryplacey / 2.0f, batteryplacedistancefromground);
266  sensors.append(SingleIR(m_body, mtr, 0.0, mtr.w_pos.z + 0.005, 0.0, 1));
268  sensors.append(SingleIR(m_body, mtr, 0.0, mtr.w_pos.z + 0.005, 0.0, 1));
269  m_groundIR = new SimulatedIRGroundSensorController(world, sensors);
270 
271  world->pushObject(this);
272 }
273 
275 {
276  foreach (PhyJoint* j, m_wheelJoints) {
277  delete j;
278  }
279  foreach (PhyObject* w, m_wheels) {
280  delete w;
281  }
282  delete m_wheelsCtrl;
283  delete m_body;
284  delete m_proximityIR;
285  delete m_groundIR;
286 }
287 
289 {
290  // Updating motors
291  if (m_wheelsCtrl->isEnabled()) {
292  m_wheelsCtrl->update();
293  }
294 
295  if (m_kinematicSimulation) {
296  // In kinematic mode, we have to manually move the robot depending on the wheel velocities
297  wMatrix mtr = matrix();
298  wheeledRobotsComputeKinematicMovement(mtr, m_leftWheelVelocity, m_rightWheelVelocity, wheelr, axletrack, world()->timeStep());
299 
300  // This will also update the position of all pieces
301  setMatrix(mtr);
302  }
303 }
304 
306 {
307  // Updating sensors
308  if (m_proximityIR->isEnabled()) {
309  m_proximityIR->update();
310  }
311  if (m_groundIR->isEnabled()) {
312  m_groundIR->update();
313  }
314 
315  // Updating the transformation matrix of the robot. It is coincident with the matrix of the body
316  tm = m_body->matrix();
317 }
318 
319 void PhyEpuck::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
320 {
321  m_proximityIR->setGraphicalProperties(drawSensor, drawRay, drawRealRay);
322 }
323 
324 void PhyEpuck::setGroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
325 {
326  m_groundIR->setGraphicalProperties(drawSensor, drawRay, drawRealRay);
327 }
328 
329 void PhyEpuck::setDrawFrontMarker(bool drawMarker)
330 {
331  if (getDrawFrontMarker() == drawMarker) {
332  return;
333  }
334 
335  if (drawMarker) {
336  m_frontMarker = new PlanarArrowGraphicalMarker(bodyr, bodyr / 6.0f, bodyr / 4.0f, 0.7f, world());
337  m_frontMarker->setUseColorTextureOfOwner(false);
338  m_frontMarker->setColor(Qt::green);
339  m_frontMarker->setTexture("");
340 
341  wMatrix displacement = wMatrix::roll(-PI_GRECO / 2.0f);
342  displacement.w_pos = wVector(0.0, 0.0, batteryplacedistancefromground + batteryplacez + bodyh + 0.0001f);
343  m_frontMarker->attachToObject(this, true, displacement);
344  } else {
345  delete m_frontMarker;
346  m_frontMarker = NULL;
347  }
348 }
349 
351 {
352  return (m_frontMarker != NULL);
353 }
354 
356 {
357  if (m_kinematicSimulation == k) {
358  return;
359  }
360 
361  m_kinematicSimulation = k;
362  if (m_kinematicSimulation) {
363  // First disabling all joints...
364  for (int i = 0; i < m_wheelJoints.size(); i++) {
365  m_wheelJoints[i]->enable(false);
366  }
367 
368  // ... then setting all objects to kinematic behaviour
369  m_body->setKinematic(true, true);
370  for (int i = 0; i < m_wheels.size(); i++) {
371  m_wheels[i]->setKinematic(true, true);
372  }
373  } else {
374  // First setting all objects to dynamic behaviour...
375  m_body->setKinematic(false);
376  for (int i = 0; i < m_wheels.size(); i++) {
377  m_wheels[i]->setKinematic(false);
378  }
379 
380  // ... then enabling all joints (if the corresponding part is enabled)
381  for (int i = 0; i < m_wheelJoints.size(); i++) {
382  m_wheelJoints[i]->enable(true);
383  m_wheelJoints[i]->updateJointInfo();
384  }
385  }
386 }
387 
388 void PhyEpuck::setLedColors(QList<QColor> c, QColor upperBaseColor)
389 {
390  if (c.size() != 8) {
391  return;
392  }
393 
394  m_turret->setUseColorTextureOfOwner(false);
395 
396  m_ledColors = c;
397  QList<PhyCylinder::SegmentColor> s;
398  const real startAngle = (PI_GRECO / 2.0f) - (PI_GRECO / 8.0f);
399  for (int i = 0; i < 8; i++) {
400  const real rangeMin = (real(i) * PI_GRECO / 4.0) + startAngle;
401  const real rangeMax = (real(i + 1) * PI_GRECO / 4.0) + startAngle;
402  s.append(PhyCylinder::SegmentColor(SimpleInterval(normalizeRad(rangeMin), normalizeRad(rangeMax)), m_ledColors[i]));
403  }
404  m_turret->setSegmentsColor(Qt::white, s);
405  m_turret->setUpperBaseColor(color());
406  m_turret->setLowerBaseColor(upperBaseColor.isValid() ? upperBaseColor : color());
407 }
408 
409 QList<QColor> PhyEpuck::ledColors() const
410 {
411  if (m_ledColors.isEmpty()) {
412  QList<QColor> c;
413  for (int i = 0; i < 8; i++) {
414  c.append(color());
415  }
416  return c;
417  } else {
418  return m_ledColors;
419  }
420 }
421 
422 const QList<PhyCylinder::SegmentColor>& PhyEpuck::segmentsColor() const
423 {
424  if (m_ledColors.isEmpty()) {
425  m_uniformColor[0].color = color();
426  return m_uniformColor;
427  } else {
428  return m_turret->segmentsColor();
429  }
430 }
431 
433 {
434  m_leftWheelVelocity = velocity;
435 }
436 
438 {
439  m_rightWheelVelocity = velocity;
440 }
441 
443 {
444  wMatrix tm = matrix();
445  m_body->setMatrix(tm);
446  for (int i = 0; i < m_wheels.size(); i++) {
447  m_wheels[i]->setMatrix(m_wheelsTransformation[i] * tm);
448  }
449  foreach (PhyJoint* j, m_wheelJoints) {
450  j->updateJointInfo();
451  }
452 }
453 
454 } // end namespace farsa
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)
World's Object class.
Definition: wobject.h:39
static wMatrix identity()
create an identity matrix
Definition: wmatrix.h:460
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
wMatrix tm
Trasformation matrix.
Definition: wobject.h:193
PhySphere class.
Definition: physphere.h:37
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 setMass(real)
Set the mass without touching the Inertia data.
Definition: phyobject.cpp:219
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
World * world()
Return the world.
Definition: wobject.cpp:61
const QList< PhyCylinder::SegmentColor > & segmentsColor() const
Returns the colors of segments of the turret.
Definition: phyepuck.cpp:422
QColor color() const
return the color of this object
Definition: wobject.cpp:89
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.
void setTexture(QString textureName)
Set the texture to use for this WObject when rendered.
Definition: wobject.cpp:73
virtual void postUpdate()
Post-updates the robot.
Definition: phyepuck.cpp:305
static const real passivewheelm
The mass of the passive wheels.
Definition: phyepuck.h:127
World class.
Definition: world.h:223
void setLedColors(QList< QColor > c, QColor upperBaseColor=QColor())
Sets the color of the leds of the epuck.
Definition: phyepuck.cpp:388
void setColor(QColor c)
Set the color to use on rendering.
Definition: wobject.cpp:81
virtual QVector< PhyDOF * > dofs()
Return descriptions of DOF.
Definition: phyjoint.h:391
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
bool isEnabled()
Returns true if the sensor is enabled.
QList< QColor > ledColors() const
Returns the color of the leds.
Definition: phyepuck.cpp:409
void setSpeedLimits(QVector< double > minSpeeds, QVector< double > maxSpeeds)
sets the minimum and maximum velocities for each wheel
The structure used to define the color of intervals of the cylinder.
Definition: phycylinder.h:63
PhyJoint class.
Definition: phyjoint.h:359
virtual void update()
Updates sensor reading.
wMatrix class
Definition: wmatrix.h:48
const wMatrix & matrix() const
return a reference to the transformation matrix
Definition: wobject.cpp:47
virtual void update()
Updates sensor reading.
virtual void preUpdate()
Pre-updates the robot.
Definition: phyepuck.cpp:288
PhyCompoundObject class.
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 wheelr
The radius of the motorized wheels.
Definition: phyepuck.h:96
static const real batterym
The mass of the battery.
Definition: phyepuck.h:68
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
static const real wheelm
The mass of one motorized wheel.
Definition: phyepuck.h:106
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 isEnabled()
return true is if enable (hence if it is on)
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.
const QList< SegmentColor > & segmentsColor() const
Returns the color of segments of the cylinder.
Definition: phycylinder.h:180
A single proximity IR sensor.
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.
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
virtual void update()
apply the velocities on the wheels
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
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
PhyCylinder class.
Definition: phycylinder.h:53
void setRightWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the right wheel.
Definition: phyepuck.cpp:437
void setMatrix(const wMatrix &newm)
set a new matrix
Definition: wobject.cpp:109
virtual ~PhyEpuck()
Destructor.
Definition: phyepuck.cpp:274
A graphical object displaying a planar arrow.
PhyBallAndSocket class.
PhyBox class.
Definition: phybox.h:37
static const real passivewheelr
The radius of the passive wheels.
Definition: phyepuck.h:119
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.
void setDrawFrontMarker(bool drawMarker)
Whether to draw a marker in the front part of the robot or not.
Definition: phyepuck.cpp:329
static const real wheelh
The height of the motorized wheels.
Definition: phyepuck.h:101
PhyObject class.
Definition: phyobject.h:46
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
static const real bodyr
The radius of the upper part of the robot (containing the main electionic board)
Definition: phyepuck.h:79