The MarXbot robot. More...

Inheritance diagram for PhyMarXbot:

Public Member Functions

 PhyMarXbot (World *world, QString name, const wMatrix &tm=wMatrix::identity())
 Create a MarXbot. More...
 
virtual ~PhyMarXbot ()
 Destroy the MarXbot. More...
 
PhyObjectattachmentDevice ()
 Returns the solid modelling the attachment device. More...
 
MarXbotAttachmentDeviceMotorControllerattachmentDeviceController ()
 returns the motor controller for the attachment device More...
 
bool attachmentDeviceEnabled () const
 Returns true if the attachment device is enabled. More...
 
PhyHingeattachmentDeviceJoint ()
 Returns the joint of the attachment device. More...
 
PhyObjectbase ()
 Returns the solid modelling the base of the robot. More...
 
void doKinematicSimulation (bool k)
 Changes the robot model from dynamic to kinematic and vice-versa. More...
 
void enableAttachmentDevice (bool enable)
 Enables or disables the attachment device. More...
 
bool getDrawFrontMarker () const
 Returns whether a marker in the front part of the robot is drawn or not. More...
 
SimulatedIRGroundSensorControllergroundAroundIRSensorController ()
 return the ground IR sensors on the base (just above the wheels) More...
 
SimulatedIRGroundSensorControllergroundBottomIRSensorController ()
 returns the ground IR sensors below the battery pack More...
 
bool isKinematic () const
 Returns true if we are using the kinematic model. More...
 
QList< QColor > ledColors () const
 Returns the color of the leds on the attachring. More...
 
virtual void postUpdate ()
 postUpdate the robot this method is called at each step of the world just after the physic update. More...
 
virtual void preUpdate ()
 preUpdate the robot this method is called at each step of the world just before the physic update. More...
 
SimulatedIRProximitySensorControllerproximityIRSensorController ()
 returns the proximity infrared sensors More...
 
void resetAttachmentDevice ()
 Resets the attachment device. More...
 
const QList< PhyCylinder::SegmentColor > & segmentsColor () const
 Returns the colors of segments of the attachring. More...
 
void setDrawFrontMarker (bool drawMarker)
 Whether to draw a marker in the front part of the robot or not. More...
 
void setGroundAroundIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false)
 Sets whether ground around IR sensors are drawn or not and how. More...
 
void setGroundBottomIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false)
 Sets whether ground bottom IR sensors are drawn or not and how. More...
 
void setLedColors (QList< QColor > c)
 Sets the color of the leds on the attachring of the MarXbot. More...
 
void setProximityIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false)
 Sets whether proximity IR sensors are drawn or not and how. More...
 
TractionSensorControllertractionSensorController ()
 return traction sensor of the robot More...
 
PhyObjectturret ()
 Returns the solid modelling the turret of the robot. More...
 
WheelMotorControllerwheelsController ()
 returns the motor controller for the wheels More...
 
- Public Member Functions inherited from WObject
 WObject (World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity(), bool addToWorld=true)
 create the object and automatically put this into the world More...
 
virtual ~WObject ()
 destroy the Object and drop it from the world More...
 
QColor color () const
 return the color of this object More...
 
void drawLocalAxes (bool d)
 Sets whether the object local frame of reference should be drawn or not. More...
 
bool isInvisible () const
 return if it is invisible More...
 
const QString & label () const
 Returns the text label to render along with the object. More...
 
const QColor & labelColor () const
 Returns the color of the label. More...
 
const wVectorlabelPosition () const
 Returns the label position relative to this object. More...
 
bool labelShown () const
 Returns whether the label is shown or not. More...
 
bool localAxesDrawn () const
 Returns true if the local frame of refecence of the object should be drawn. More...
 
const wMatrixmatrix () const
 return a reference to the transformation matrix More...
 
QString name () const
 Return the name of this object. More...
 
void setAlpha (int alpha)
 set the value of alpha channel (the transparency) More...
 
void setColor (QColor c)
 Set the color to use on rendering. More...
 
void setInvisible (bool b)
 set invisibility More...
 
void setLabel (QString label)
 Sets a text label to render along with the object. More...
 
void setLabel (QString label, wVector pos)
 Sets a text label to render along with the object and its position. More...
 
void setLabel (QString label, wVector pos, QColor color)
 Sets a text label to render along with the object and its position and color. More...
 
void setLabelColor (const QColor &color)
 Sets the color of the label. More...
 
void setLabelPosition (const wVector &pos)
 Sets the label position relative to this object. More...
 
void setMatrix (const wMatrix &newm)
 set a new matrix More...
 
void setPosition (const wVector &newpos)
 set the position specified in global coordinate frame More...
 
void setPosition (real x, real y, real z)
 set the position specified in global coordinate frame More...
 
void setTexture (QString textureName)
 Set the texture to use for this WObject when rendered. More...
 
void setUseColorTextureOfOwner (bool b)
 set if the object will be rendered with the color and texture of our owner (if we have one) More...
 
void showLabel (bool show)
 Sets whether to show the label or not. More...
 
QString texture () const
 Return the texture name. More...
 
bool useColorTextureOfOwner () const
 if true, we will use color and texture of our owner (if we have one) More...
 
Worldworld ()
 Return the world. More...
 
const Worldworld () const
 Return the world (const version) More...
 
- Public Member Functions inherited from Ownable
 Ownable ()
 Constructor. More...
 
virtual ~Ownable ()
 Destructor. More...
 
const QList< Owned > & owned () const
 Returns the list of objects owned by this one. More...
 
Ownableowner () const
 Returns the owner of this object. More...
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object. More...
 

Static Public Attributes

static const real attachdevm = 0.03f
 
static const real attachdevr = bodyr
 
static const real attachdevx = turreth * 0.8f
 
static const real attachdevy = turreth * 0.4f
 
static const real attachdevz = turreth * 0.2f
 
static const real axledistance = 0.104f
 
static const real basem = 0.4f
 
static const real basex = 0.034f
 
static const real basey = 0.143f
 
static const real basez = 0.048f
 
static const real bodyh = 0.0055f
 
static const real bodym = 0.02f
 
static const real bodyr = 0.085f
 
static const real trackheight = 0.0295f
 
static const real trackm = 0.05f
 
static const real trackradius = 0.022f
 
static const real treaddepth = 0.004f
 
static const real turreth = 0.0385f
 
static const real turretm = 0.08f
 
static const real wheelh = 0.0215f
 
static const real wheelm = 0.02f
 
static const real wheelr = 0.027f
 

Protected Slots

void setLeftWheelDesideredVelocity (real velocity)
 Sets the desidered velocity of the left wheel. More...
 
void setRightWheelDesideredVelocity (real velocity)
 Sets the desidered velocity of the right wheel. More...
 

Protected Member Functions

virtual void changedMatrix ()
 update the matrix of all sub-objects More...
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 The type for the list of owned objects. More...
 
- Protected Attributes inherited from WObject
QColor colorv
 Color, it contains also alpha channel. More...
 
bool invisible
 if TRUE it will not renderized More...
 
QColor labelcol
 The color of the label. More...
 
bool labeldrawn
 Whether the label should be rendered or not. More...
 
wVector labelpos
 The position of the label in the object frame of reference. More...
 
QString labelv
 The text label of the object. More...
 
bool localFrameOfReferenceDrawn
 If true, the local frame of reference of the object is drawn. More...
 
QString namev
 Name of the WObject. More...
 
QString texturev
 Texture name. More...
 
wMatrix tm
 Trasformation matrix. More...
 
bool usecolortextureofowner
 if true, we will use color and texture of our owner (if we have one). More...
 
Worldworldv
 World. More...
 

Detailed Description

The MarXbot robot.

This class represents a MarXbot robot (http://mobots.epfl.ch/marxbot.html) The robot has a base with two motorize wheels and an upper part. Moreover the attachring module (the one used to connect two MarXbot robots) can be enabled or disabled. Conversely from the real robot the traction sensor on the attachring can be used even if the attachring module is disabled. This allows to have slightly faster simulations when the traction sensor is used but the possibility to attach two robots is not allowed

Definition at line 55 of file phymarxbot.h.

Constructor & Destructor Documentation

~PhyMarXbot ( )
virtual

Destroy the MarXbot.

Definition at line 266 of file phymarxbot.cpp.

Member Function Documentation

PhyObject* attachmentDevice ( )
inline

Returns the solid modelling the attachment device.

Returns
the solid modelling the attachment device or NULL if the attachment device is not enabled

Definition at line 221 of file phymarxbot.h.

Referenced by MarXbotAttachmentDeviceMotorController::update().

MarXbotAttachmentDeviceMotorController* attachmentDeviceController ( )
inline

returns the motor controller for the attachment device

Definition at line 109 of file phymarxbot.h.

Referenced by MarXbotAttachmentDeviceMotorController::update().

bool attachmentDeviceEnabled ( ) const
inline

Returns true if the attachment device is enabled.

Returns
true if the attachment device is enabled

Definition at line 178 of file phymarxbot.h.

Referenced by MarXbotAttachmentDeviceMotorController::attachmentDeviceEnabled(), PhyMarXbot::enableAttachmentDevice(), and PhyMarXbot::resetAttachmentDevice().

PhyObject* base ( )
inline

Returns the solid modelling the base of the robot.

Returns
the solid modelling the base of the robot

Definition at line 198 of file phymarxbot.h.

void changedMatrix ( )
protectedvirtual

update the matrix of all sub-objects

Reimplemented from WObject.

Definition at line 515 of file phymarxbot.cpp.

References WObject::matrix(), WObject::setMatrix(), WObject::tm, PhyFixed::updateJointInfo(), PhyHinge::updateJointInfo(), and PhyJoint::updateJointInfo().

void doKinematicSimulation ( bool  k)

Changes the robot model from dynamic to kinematic and vice-versa.

Parameters
kif true switches to the kinematic MarXbot model, if false to the dynamic one (at creation the model is always dynamic)

Definition at line 407 of file phymarxbot.cpp.

References PhyJoint::enable(), PhyObject::setKinematic(), PhyFixed::updateJointInfo(), and PhyHinge::updateJointInfo().

void enableAttachmentDevice ( bool  enable)

Enables or disables the attachment device.

Parameters
enableif true enables the attachment device, if false disables it
Note
When the attachment device is disabled, the parts making it up are deleted

Definition at line 366 of file phymarxbot.cpp.

References PhyMarXbot::attachmentDeviceEnabled(), PhyJoint::dofs(), WObject::matrix(), PhyObject::setMass(), WObject::setMatrix(), Ownable::setOwner(), and WObject::world().

Referenced by PhyMarXbot::resetAttachmentDevice().

bool getDrawFrontMarker ( ) const

Returns whether a marker in the front part of the robot is drawn or not.

Returns
true if a marker in the front part of the robot is drawn

Definition at line 361 of file phymarxbot.cpp.

Referenced by PhyMarXbot::setDrawFrontMarker().

SimulatedIRGroundSensorController* groundAroundIRSensorController ( )
inline

return the ground IR sensors on the base (just above the wheels)

Definition at line 121 of file phymarxbot.h.

SimulatedIRGroundSensorController* groundBottomIRSensorController ( )
inline

returns the ground IR sensors below the battery pack

Definition at line 117 of file phymarxbot.h.

bool isKinematic ( ) const
inline

Returns true if we are using the kinematic model.

Definition at line 246 of file phymarxbot.h.

QList< QColor > ledColors ( ) const

Returns the color of the leds on the attachring.

Returns
the color of leds on the attachring

Definition at line 482 of file phymarxbot.cpp.

References WObject::color().

void postUpdate ( )
virtual

postUpdate the robot this method is called at each step of the world just after the physic update.

It updates sensors

Reimplemented from WObject.

Definition at line 308 of file phymarxbot.cpp.

References SensorController::isEnabled(), WObject::matrix(), WObject::tm, SimulatedIRProximitySensorController::update(), and SimulatedIRGroundSensorController::update().

void preUpdate ( )
virtual

preUpdate the robot this method is called at each step of the world just before the physic update.

It updates motors

Reimplemented from WObject.

Definition at line 288 of file phymarxbot.cpp.

References MotorController::isEnabled(), WObject::matrix(), WObject::setMatrix(), WheelMotorController::update(), MarXbotAttachmentDeviceMotorController::update(), and WObject::world().

SimulatedIRProximitySensorController* proximityIRSensorController ( )
inline

returns the proximity infrared sensors

Definition at line 113 of file phymarxbot.h.

void resetAttachmentDevice ( )

Resets the attachment device.

This function completely resets the device: the status is set to open (possibly detaching an attached robot), the position to 0 and all robots attached to us are detached

Definition at line 398 of file phymarxbot.cpp.

References PhyMarXbot::attachmentDeviceEnabled(), and PhyMarXbot::enableAttachmentDevice().

const QList< PhyCylinder::SegmentColor > & segmentsColor ( ) const

Returns the colors of segments of the attachring.

This is a low-level function that returns the color of segments on the attachring modelling the led colors

Returns
the colors of segments of the attachring

Definition at line 495 of file phymarxbot.cpp.

References WObject::color(), and PhyCylinder::segmentsColor().

void setDrawFrontMarker ( bool  drawMarker)

Whether to draw a marker in the front part of the robot or not.

Parameters
drawMarkerif true draws a marker in the front part of the robot

Definition at line 340 of file phymarxbot.cpp.

References GraphicalWObject::attachToObject(), PhyMarXbot::getDrawFrontMarker(), wMatrix::roll(), WObject::setColor(), WObject::setTexture(), WObject::setUseColorTextureOfOwner(), and WObject::world().

void setGroundAroundIRSensorsGraphicalProperties ( bool  drawSensor,
bool  drawRay = false,
bool  drawRealRay = false 
)

Sets whether ground around IR sensors are drawn or not and how.

Definition at line 335 of file phymarxbot.cpp.

References SimulatedIRGroundSensorController::setGraphicalProperties().

void setGroundBottomIRSensorsGraphicalProperties ( bool  drawSensor,
bool  drawRay = false,
bool  drawRealRay = false 
)

Sets whether ground bottom IR sensors are drawn or not and how.

Definition at line 330 of file phymarxbot.cpp.

References SimulatedIRGroundSensorController::setGraphicalProperties().

void setLedColors ( QList< QColor >  c)

Sets the color of the leds on the attachring of the MarXbot.

This function takes a list of exactly 12 colors for the leds on the attachring. If this function is never called, all leds take the color set by setColor(). As soon as this function is called, the color of the leds becomes indipendent of the color set by setColor()

Parameters
cthe list of colors of leds. This must have exactly 12 elements, otherwise colors are not changed

Definition at line 461 of file phymarxbot.cpp.

References WObject::color(), farsa::normalizeRad(), PhyCylinder::setLowerBaseColor(), PhyCylinder::setSegmentsColor(), PhyCylinder::setUpperBaseColor(), and WObject::setUseColorTextureOfOwner().

void setLeftWheelDesideredVelocity ( real  velocity)
protectedslot

Sets the desidered velocity of the left wheel.

This is used when in kinematic to move the robot. We only use velocity because robots can only move by setting wheel velocities

Parameters
velocitythe desidered velocity (in radiants per second)

Definition at line 505 of file phymarxbot.cpp.

Referenced by PhyMarXbot::PhyMarXbot().

void setProximityIRSensorsGraphicalProperties ( bool  drawSensor,
bool  drawRay = false,
bool  drawRealRay = false 
)

Sets whether proximity IR sensors are drawn or not and how.

Definition at line 325 of file phymarxbot.cpp.

References SimulatedIRProximitySensorController::setGraphicalProperties().

void setRightWheelDesideredVelocity ( real  velocity)
protectedslot

Sets the desidered velocity of the right wheel.

This is used when in kinematic to move the robot. We only use velocity because robots can only move by setting wheel velocities

Parameters
velocitythe desidered velocity (in radiants per second)

Definition at line 510 of file phymarxbot.cpp.

Referenced by PhyMarXbot::PhyMarXbot().

TractionSensorController* tractionSensorController ( )
inline

return traction sensor of the robot

Definition at line 125 of file phymarxbot.h.

PhyObject* turret ( )
inline

Returns the solid modelling the turret of the robot.

Returns
the solid modelling the turret of the robot

Definition at line 209 of file phymarxbot.h.

Referenced by MarXbotAttachmentDeviceMotorController::update().

WheelMotorController* wheelsController ( )
inline

returns the motor controller for the wheels

Definition at line 105 of file phymarxbot.h.


The documentation for this class was generated from the following files: