The class modelling a kephera II robot. More...

Inheritance diagram for PhyKhepera:

Public Member Functions

 PhyKhepera (World *world, QString name, const wMatrix &transformation=wMatrix::identity())
 Creates a khepera II robot.
 
virtual ~PhyKhepera ()
 Destructor.
 
void doKinematicSimulation (bool k)
 Changes the robot model from dynamic to kinematic and vice-versa.
 
bool isKinematic () const
 Returns true if we are using the kinematic model.
 
virtual void postUpdate ()
 Post-updates the robot.
 
virtual void preUpdate ()
 Pre-updates the robot.
 
IRSensorControllerproximityIRSensorController ()
 Returns the proximity infrared sensors controller.
 
void setProximityIRSensorsGraphicalProperties (bool drawSensor, bool drawRay=false, bool drawRealRay=false)
 Sets whether proximity IR sensors are drawn or not and how.
 
WheelMotorControllerwheelsController ()
 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 wMatrixmatrix () 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)
 
Worldworld ()
 Return the world.
 
const Worldworld () 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.
 
Ownableowner () const
 Returns the owner of this object.
 
void setOwner (Ownable *owner, bool destroy=true)
 Sets the owner of this object.
 

Static Public Attributes

static const real axletrack = 0.055f
 The distance between the two motorized wheels.
 
static const real bodydistancefromground = 0.0015f
 The distance of the body from the ground.
 
static const real bodyh = 0.030f
 The height of the body of the robot.
 
static const real bodym = 0.066f
 The mass of the robot without the wheels.
 
static const real bodyr = 0.035f
 The radius of the body of the robot.
 
static const real passivewheelm = 0.002f
 The mass of the passive wheels.
 
static const real passivewheelr = 0.003f
 The radius of the passive wheels.
 
static const real wheelh = 0.003f
 The height of the motorized wheels.
 
static const real wheelm = 0.005f
 The mass of one motorized wheel.
 
static const real wheelr = 0.015f
 The radius of the motorized wheels.
 

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 ()
 The function called when the transformation matrix of the robot is changed.
 

Additional Inherited Members

- Public Types inherited from Ownable
typedef QList< OwnedOwnedList
 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).
 
Worldworldv
 World.
 

Detailed Description

The class modelling a kephera II robot.

This class models a khepera II robot. For more information about the robot go to http://www.k-team.com/mobile-robotics-products/khepera-ii/introduction

Definition at line 44 of file phykhepera.h.

Constructor & Destructor Documentation

~PhyKhepera ( )
virtual

Destructor.

Definition at line 245 of file phykhepera.cpp.

Member Function Documentation

void changedMatrix ( )
protectedvirtual

The function called when the transformation matrix of the robot is changed.

This updates the matrix of all sub-objects

Reimplemented from WObject.

Definition at line 334 of file phykhepera.cpp.

References WObject::matrix(), WObject::setMatrix(), WObject::tm, 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 Kephera II model, if false to the dynamic one (at creation the model is always dynamic)

Definition at line 291 of file phykhepera.cpp.

References PhyObject::setKinematic().

bool isKinematic ( ) const
inline

Returns true if we are using the kinematic model.

Returns
true if we are using the kinematic model

Definition at line 182 of file phykhepera.h.

void postUpdate ( )
virtual

Post-updates the robot.

This method is called at each step of the world just after the physic update

Reimplemented from WObject.

Definition at line 275 of file phykhepera.cpp.

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

void preUpdate ( )
virtual

Pre-updates the robot.

This method is called at each step of the world just before the physic update

Reimplemented from WObject.

Definition at line 258 of file phykhepera.cpp.

References PhyKhepera::axletrack, MotorController::isEnabled(), WObject::matrix(), WObject::setMatrix(), WheelMotorController::update(), PhyKhepera::wheelr, and WObject::world().

IRSensorController* proximityIRSensorController ( )
inline

Returns the proximity infrared sensors controller.

Returns
the proximity infrared sensors controller

Definition at line 134 of file phykhepera.h.

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 324 of file phykhepera.cpp.

Referenced by PhyKhepera::PhyKhepera().

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

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

Parameters
drawSensorwhether to draw the sensor or not
drawRaywhether to draw the IR rays or not
drawRealRayif true rays are drawn in their actual length, otherwise only the direction is given

Definition at line 286 of file phykhepera.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 329 of file phykhepera.cpp.

Referenced by PhyKhepera::PhyKhepera().

WheelMotorController* wheelsController ( )
inline

Returns the motor controller for the wheels.

Returns
the motor controller for the wheels

Definition at line 124 of file phykhepera.h.

Member Data Documentation

const real axletrack = 0.055f
static

The distance between the two motorized wheels.

Definition at line 86 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera(), and PhyKhepera::preUpdate().

const real bodydistancefromground = 0.0015f
static

The distance of the body from the ground.

Definition at line 51 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real bodyh = 0.030f
static

The height of the body of the robot.

Definition at line 61 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real bodym = 0.066f
static

The mass of the robot without the wheels.

Definition at line 66 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real bodyr = 0.035f
static

The radius of the body of the robot.

Definition at line 56 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real passivewheelm = 0.002f
static

The mass of the passive wheels.

The real robot has no passive wheels, here we need them to reduce the friction with the ground

Definition at line 102 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real passivewheelr = 0.003f
static

The radius of the passive wheels.

The real robot has no passive wheels, here we need them to reduce the friction with the ground

Definition at line 94 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real wheelh = 0.003f
static

The height of the motorized wheels.

Definition at line 76 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real wheelm = 0.005f
static

The mass of one motorized wheel.

Definition at line 81 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera().

const real wheelr = 0.015f
static

The radius of the motorized wheels.

Definition at line 71 of file phykhepera.h.

Referenced by PhyKhepera::PhyKhepera(), and PhyKhepera::preUpdate().


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