The MarXbot robot. More...
Public Member Functions | |
PhyMarXbot (World *world, QString name, const wMatrix &tm=wMatrix::identity()) | |
Create a MarXbot. | |
virtual | ~PhyMarXbot () |
Destroy the MarXbot. | |
PhyObject * | attachmentDevice () |
Returns the solid modelling the attachment device. | |
MarXbotAttachmentDeviceMotorController * | attachmentDeviceController () |
returns the motor controller for the attachment device | |
bool | attachmentDeviceEnabled () const |
Returns true if the attachment device is enabled. | |
PhyHinge * | attachmentDeviceJoint () |
Returns the joint of the attachment device. | |
PhyObject * | base () |
Returns the solid modelling the base of the robot. | |
void | doKinematicSimulation (bool k) |
Changes the robot model from dynamic to kinematic and vice-versa. | |
void | enableAttachmentDevice (bool enable) |
Enables or disables the attachment device. | |
bool | getDrawFrontMarker () const |
Returns whether a marker in the front part of the robot is drawn or not. | |
IRSensorController * | groundAroundIRSensorController () |
return the ground IR sensors on the base (just above the wheels) | |
IRSensorController * | groundBottomIRSensorController () |
returns the ground IR sensors below the battery pack | |
bool | isKinematic () const |
Returns true if we are using the kinematic model. | |
virtual void | postUpdate () |
postUpdate the robot this method is called at each step of the world just after the physic update | |
virtual void | preUpdate () |
preUpdate the robot this method is called at each step of the world just before the physic update | |
IRSensorController * | proximityIRSensorController () |
returns the proximity infrared sensors | |
void | resetAttachmentDevice () |
Resets the attachment device. | |
void | setDrawFrontMarker (bool drawMarker) |
Whether to draw a marker in the front part of the robot or not. | |
void | setGroundAroundIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets whether ground around IR sensors are drawn or not and how. | |
void | setGroundBottomIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets whether ground bottom IR sensors are drawn or not and how. | |
void | setProximityIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false) |
Sets whether proximity IR sensors are drawn or not and how. | |
TractionSensorController * | tractionSensorController () |
return traction sensor of the robot | |
PhyObject * | turret () |
Returns the solid modelling the turret of the robot. | |
WheelMotorController * | wheelsController () |
returns the motor controller for the wheels | |
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 | |
virtual | ~WObject () |
destroy the Object and drop it from the world | |
QColor | color () const |
return the color of this object | |
bool | isInvisible () |
return if it is invisible | |
const wMatrix & | matrix () const |
return a reference to the transformation matrix | |
QString | name () const |
Return the name of this object. | |
void | setAlpha (int alpha) |
set the value of alpha channel (the transparency) | |
void | setColor (QColor c) |
Set the color to use on rendering. | |
void | setInvisible (bool b) |
set invisibility | |
void | setMatrix (const wMatrix &newm) |
set a new matrix | |
void | setPosition (const wVector &newpos) |
set the position specified in global coordinate frame | |
void | setPosition (real x, real y, real z) |
set the position specified in global coordinate frame | |
void | setTexture (QString textureName) |
Set the texture to use for this WObject when rendered. | |
void | setUseColorTextureOfOwner (bool b) |
set if the object will be rendered with the color and texture of our owner (if we have one) | |
QString | texture () const |
Return the texture name. | |
bool | useColorTextureOfOwner () const |
if true, we will use color and texture of our owner (if we have one) | |
World * | world () |
Return the world. | |
const World * | world () const |
Return the world (const version) | |
Public Member Functions inherited from Ownable | |
Ownable () | |
Constructor. | |
virtual | ~Ownable () |
Destructor. | |
const QList< Owned > & | owned () const |
Returns the list of objects owned by this one. | |
Ownable * | owner () const |
Returns the owner of this object. | |
void | setOwner (Ownable *owner, bool destroy=true) |
Sets the owner of this object. | |
Protected Slots | |
void | setLeftWheelDesideredVelocity (real velocity) |
Sets the desidered velocity of the left wheel. | |
void | setRightWheelDesideredVelocity (real velocity) |
Sets the desidered velocity of the right wheel. | |
Protected Member Functions | |
virtual void | changedMatrix () |
update the matrix of all sub-objects | |
Additional Inherited Members | |
Public Types inherited from Ownable | |
typedef QList< Owned > | OwnedList |
The type for the list of owned objects. | |
Protected Attributes inherited from WObject | |
QColor | colorv |
Color, it contains also alpha channel. | |
bool | invisible |
if TRUE it will not renderized | |
QString | namev |
Name of the WObject. | |
QString | texturev |
Texture name. | |
wMatrix | tm |
Trasformation matrix. | |
bool | usecolortextureofowner |
if true, we will use color and texture of our owner (if we have one). | |
World * | worldv |
World. | |
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 54 of file phymarxbot.h.
Constructor & Destructor Documentation
PhyMarXbot | ( | World * | world, |
QString | name, | ||
const wMatrix & | tm = wMatrix::identity() |
||
) |
Create a MarXbot.
- Parameters
-
tm specify the position and rotation of the marXbot
Definition at line 61 of file phymarxbot.cpp.
References MaterialDB::createMaterial(), PhyJoint::dofs(), MaterialDB::enableCollision(), wMatrix::identity(), World::materials(), WObject::matrix(), wMatrix::pitch(), MaterialDB::setElasticity(), PhyMarXbot::setLeftWheelDesideredVelocity(), PhyObject::setMass(), WObject::setMatrix(), Ownable::setOwner(), PhyMarXbot::setRightWheelDesideredVelocity(), MaterialDB::setSoftness(), WheelMotorController::setSpeedLimits(), WObject::setUseColorTextureOfOwner(), WObject::tm, farsa::toRad(), PhyJoint::updateJointInfo(), WObject::world(), and wMatrix::yaw().
|
virtual |
Destroy the MarXbot.
Definition at line 263 of file phymarxbot.cpp.
Member Function Documentation
|
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 220 of file phymarxbot.h.
Referenced by MarXbotAttachmentDeviceMotorController::update().
|
inline |
returns the motor controller for the attachment device
Definition at line 108 of file phymarxbot.h.
Referenced by MarXbotAttachmentDeviceMotorController::update().
|
inline |
Returns true if the attachment device is enabled.
- Returns
- true if the attachment device is enabled
Definition at line 177 of file phymarxbot.h.
Referenced by MarXbotAttachmentDeviceMotorController::attachmentDeviceEnabled(), PhyMarXbot::enableAttachmentDevice(), and PhyMarXbot::resetAttachmentDevice().
|
inline |
Returns the joint of the attachment device.
- Returns
- the joint of the attachment device or NULL if the attachment device is not enabled
Definition at line 231 of file phymarxbot.h.
Referenced by MarXbotAttachmentDeviceMotorController::getDesiredPosition(), MarXbotAttachmentDeviceMotorController::getDesiredVelocity(), MarXbotAttachmentDeviceMotorController::getMaxVelocity(), MarXbotAttachmentDeviceMotorController::getPosition(), MarXbotAttachmentDeviceMotorController::getVelocity(), MarXbotAttachmentDeviceMotorController::setDesiredPosition(), MarXbotAttachmentDeviceMotorController::setDesiredVelocity(), and MarXbotAttachmentDeviceMotorController::setMaxVelocity().
|
inline |
Returns the solid modelling the base of the robot.
- Returns
- the solid modelling the base of the robot
Definition at line 197 of file phymarxbot.h.
|
protectedvirtual |
update the matrix of all sub-objects
Reimplemented from WObject.
Definition at line 465 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
-
k if true switches to the kinematic MarXbot model, if false to the dynamic one (at creation the model is always dynamic)
Definition at line 404 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
-
enable if 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 363 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 358 of file phymarxbot.cpp.
Referenced by PhyMarXbot::setDrawFrontMarker().
|
inline |
return the ground IR sensors on the base (just above the wheels)
Definition at line 120 of file phymarxbot.h.
|
inline |
returns the ground IR sensors below the battery pack
Definition at line 116 of file phymarxbot.h.
|
inline |
Returns true if we are using the kinematic model.
Definition at line 245 of file phymarxbot.h.
|
virtual |
postUpdate the robot this method is called at each step of the world just after the physic update
Reimplemented from WObject.
Definition at line 305 of file phymarxbot.cpp.
References SensorController::isEnabled(), WObject::matrix(), WObject::tm, SimulatedIRProximitySensorController::update(), and SimulatedIRGroundSensorController::update().
|
virtual |
preUpdate the robot this method is called at each step of the world just before the physic update
Reimplemented from WObject.
Definition at line 285 of file phymarxbot.cpp.
References MotorController::isEnabled(), WObject::matrix(), WObject::setMatrix(), WheelMotorController::update(), MarXbotAttachmentDeviceMotorController::update(), and WObject::world().
|
inline |
returns the proximity infrared sensors
Definition at line 112 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 395 of file phymarxbot.cpp.
References PhyMarXbot::attachmentDeviceEnabled(), and PhyMarXbot::enableAttachmentDevice().
void setDrawFrontMarker | ( | bool | drawMarker | ) |
Whether to draw a marker in the front part of the robot or not.
- Parameters
-
drawMarker if true draws a marker in the front part of the robot
Definition at line 337 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 332 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 327 of file phymarxbot.cpp.
References SimulatedIRGroundSensorController::setGraphicalProperties().
|
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
-
velocity the desidered velocity (in radiants per second)
Definition at line 455 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 322 of file phymarxbot.cpp.
References SimulatedIRProximitySensorController::setGraphicalProperties().
|
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
-
velocity the desidered velocity (in radiants per second)
Definition at line 460 of file phymarxbot.cpp.
Referenced by PhyMarXbot::PhyMarXbot().
|
inline |
return traction sensor of the robot
Definition at line 124 of file phymarxbot.h.
|
inline |
Returns the solid modelling the turret of the robot.
- Returns
- the solid modelling the turret of the robot
Definition at line 208 of file phymarxbot.h.
Referenced by MarXbotAttachmentDeviceMotorController::update().
|
inline |
returns the motor controller for the wheels
Definition at line 104 of file phymarxbot.h.
The documentation for this class was generated from the following files:
- worldsim/include/phymarxbot.h
- worldsim/src/phymarxbot.cpp