phymarxbot.cpp
61 PhyMarXbot::PhyMarXbot( World* w, QString name, const wMatrix& basetm ) : WObject( w, name, basetm, false ) {
79 // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
129 xoffs[i] * (basex + trackheight)/2.0f + (yoffs[i]==0 ? xoffs[i]*(trackheight/2.0+wheelh/2.0f+0.006f) : 0.0f),
186 // We always create the attachment device controller, it will however not work unless the attachment
202 connect(wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
203 connect(wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
231 mtr.w_pos = wVector(basex / 2.0f + trackheight - distFromBorder, axledistance / 2.0f - distFromBorder, treaddepth);
233 mtr.w_pos = wVector(basex / 2.0f + trackheight - distFromBorder, -axledistance / 2.0f + distFromBorder, treaddepth);
235 mtr.w_pos = wVector(-basex / 2.0f - trackheight + distFromBorder, axledistance / 2.0f - distFromBorder, treaddepth);
237 mtr.w_pos = wVector(-basex / 2.0f - trackheight + distFromBorder, -axledistance / 2.0f + distFromBorder, treaddepth);
301 wheeledRobotsComputeKinematicMovement(mtr, leftWheelVelocity, rightWheelVelocity, wheelr, wheelstm[0].w_pos.x - wheelstm[1].w_pos.x, world()->timeStep());
321 // Updating the transformation matrix of the robot. It is coincident with the matrix of the base
325 void PhyMarXbot::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
330 void PhyMarXbot::setGroundBottomIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
335 void PhyMarXbot::setGroundAroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
347 frontMarker = new PlanarArrowGraphicalMarker(PhyMarXbot::bodyr, PhyMarXbot::bodyr / 6.0f, PhyMarXbot::bodyr / 4.0f, 0.7f, world());
353 displacement.w_pos = wVector(0.0, 0.0, basez + trackradius * 2.0f + treaddepth + turreth - 0.010f + 0.0001f);
382 attachdevjoint = new PhyHinge(wVector(1.0f, 0.0, 0.0), wVector(0.0, 0.0, 0.0), 0.0, turretv, attachdev, world());
385 attachdevjoint->dofs()[0]->setStiffness(0.1f); // This way the attachdev motor is not very strong
459 #warning PROBLEMA RELATIVO AI LED DEL MARXBOT: NON C È L'ATTACHRING, SOLO LA TORRETTA CHE PERÒ È FISSA. NEL ROBOT REALE I LED SONO SULL' ATTACHRING, QUINDI RUOTANO (CONTROLLARE!!!), QUI SONO SULLA TORRETTA QUINDI SONO FISSI
475 s.append(PhyCylinder::SegmentColor(SimpleInterval(normalizeRad(rangeMin), normalizeRad(rangeMax)), ledColorsv[i]));
554 PhyMarXbot::PhyMarXbot( World* w, QString name, const wMatrix& basetm ) : WObject( w, name, basetm, false ) {
571 // The front of the robot is towards -Y (positive speeds of the wheel make the robot move towards -Y)
672 xoffs[i] * (basex + trackheight)/2.0f + (yoffs[i]==0 ? xoffs[i]*(trackheight/2.0+wheelh/2.0f+0.006f) : 0.0f),
766 connect(wheelJoints[0]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setRightWheelDesideredVelocity(real)));
767 connect(wheelJoints[1]->dofs()[0], SIGNAL(changedDesiredVelocity(real)), this, SLOT(setLeftWheelDesideredVelocity(real)));
854 wheeledRobotsComputeKinematicMovement(mtr, leftWheelVelocity, rightWheelVelocity, wheelr, wheelstm[0].w_pos.x - wheelstm[1].w_pos.x, world()->timeStep());
874 // Updating the transformation matrix of the robot. It is coincident with the matrix of the base
878 void PhyMarXbot::setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
883 void PhyMarXbot::setGroundBottomIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
888 void PhyMarXbot::setGroundAroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay, bool drawRealRay)
FARSA_UTIL_TEMPLATE real toRad(real x)
void enableCollision(QString mat1, QString mat2, bool enable=true)
Enable/Disable the collision between materials passed.
Definition: world.cpp:119
void setKinematic(bool b, bool c=false)
Changes between kinematic/dynamic behaviour for the object.
Definition: phyobject.cpp:56
The class modelling the motor for the attachment device of the MarXbot.
Definition: motorcontrollers.h:284
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
virtual void postUpdate()
postUpdate the robot this method is called at each step of the world just after the physic update...
Definition: phymarxbot.cpp:308
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: phymarxbot.cpp:505
virtual void updateJointInfo()
Update the Joint informations (each PhyDOF will be updated)
Definition: phyhinge.cpp:181
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
virtual void postUpdate()
postUpdate the robot this method is called at each step of the world just after the physic update ...
Definition: phymarxbot.cpp:861
void setRightWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the right wheel.
Definition: phymarxbot.cpp:936
void setGroundAroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether ground around IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:335
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
const QList< PhyCylinder::SegmentColor > & segmentsColor() const
Returns the colors of segments of the attachring.
Definition: phymarxbot.cpp:495
void setSpeedLimits(QVector< double > minSpeeds, QVector< double > maxSpeeds)
sets the minimum and maximum velocities for each wheel
Definition: motorcontrollers.cpp:448
PhyMarXbot(World *world, QString name, const wMatrix &tm=wMatrix::identity())
Create a MarXbot.
Definition: phymarxbot.cpp:61
The structure used to define the color of intervals of the cylinder.
Definition: phycylinder.h:63
void setElasticity(QString mat1, QString mat2, real)
configure the default Elasticity between materials specified the order doesn't matter ...
Definition: world.cpp:80
void setLedColors(QList< QColor > c)
Sets the color of the leds on the attachring of the MarXbot.
Definition: phymarxbot.cpp:461
const wMatrix & matrix() const
return a reference to the transformation matrix
Definition: wobject.cpp:47
bool attachmentDeviceEnabled() const
Returns true if the attachment device is enabled.
Definition: phymarxbot.h:178
void setGroundBottomIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether ground bottom IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:883
PhyMarXbot(World *world, QString name, const wMatrix &tm=wMatrix::identity())
Create a MarXbot.
Definition: phymarxbot.cpp:554
void setSoftness(QString mat1, QString mat2, real)
configure the default Softness between materials specified the order doesn't matter ...
Definition: world.cpp:93
PhySuspension class PhySuspension is a joint implementing the system of springs, shock absorbers and ...
Definition: physuspension.h:41
void doKinematicSimulation(bool k)
Changes the robot model from dynamic to kinematic and vice-versa.
Definition: phymarxbot.cpp:407
void setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether proximity IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:325
void setGroundAroundIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether ground around IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:888
bool getDrawFrontMarker() const
Returns whether a marker in the front part of the robot is drawn or not.
Definition: phymarxbot.cpp:361
void setOwner(Ownable *owner, bool destroy=true)
Sets the owner of this object.
Definition: ownable.cpp:47
virtual void preUpdate()
preUpdate the robot this method is called at each step of the world just before the physic update...
Definition: phymarxbot.cpp:288
virtual void preUpdate()
preUpdate the robot this method is called at each step of the world just before the physic update ...
Definition: phymarxbot.cpp:844
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
float real
MaterialDB & materials()
return the MaterialDB object for managing World's materials
Definition: world.h:334
void setDrawFrontMarker(bool drawMarker)
Whether to draw a marker in the front part of the robot or not.
Definition: phymarxbot.cpp:340
The controller for traction sensor.
Definition: sensorcontrollers.h:667
void setSegmentsColor(QColor base, const QList< SegmentColor > &segmentsColor)
Sets the color of segments of the cylinder.
Definition: phycylinder.cpp:104
void setGroundBottomIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether ground bottom IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:330
static wMatrix yaw(real ang)
create a rotation around Y axis of ang radians
Definition: wmatrix.h:503
void enableAttachmentDevice(bool enable)
Enables or disables the attachment device.
Definition: phymarxbot.cpp:366
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:599
void setProximityIRSensorsGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets whether proximity IR sensors are drawn or not and how.
Definition: phymarxbot.cpp:878
void setRightWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the right wheel.
Definition: phymarxbot.cpp:510
A graphical object displaying a planar arrow.
Definition: graphicalmarkers.h:92
QList< QColor > ledColors() const
Returns the color of the leds on the attachring.
Definition: phymarxbot.cpp:482
void doKinematicSimulation(bool k)
Changes the robot model from dynamic to kinematic and vice-versa.
Definition: phymarxbot.cpp:893
virtual void update()
The method updating the attachment device at each timestep.
Definition: motorcontrollers.cpp:499
Dedicated controller for wheeled robots.
Definition: motorcontrollers.h:167
A collection of SingleIR.
Definition: sensorcontrollers.h:504
virtual void updateJointInfo()
Update the Joint informations (each PhyDOF will be updated)
Definition: phyfixed.cpp:79
void setGraphicalProperties(bool drawSensor, bool drawRay=false, bool drawRealRay=false)
Sets graphical properties of all sensors.
Definition: sensorcontrollers.cpp:542
void setLeftWheelDesideredVelocity(real velocity)
Sets the desidered velocity of the left wheel.
Definition: phymarxbot.cpp:931