EpuckPosition2d Class Reference

It controls the e-puck velocity and odometry. More...

#include <epuckPosition2d.hpp>

Inheritance diagram for EpuckPosition2d:
Collaboration diagram for EpuckPosition2d:

List of all members.


Detailed Description

It controls the e-puck velocity and odometry.

Author:
Renato Florentino Garcia
Date:
August 2008

Classes

struct  BodyGeometry
 Struct which represents the geometry of e-puck body. More...
struct  DynamicConfiguration
 Struct which represents the pose and velocity of e-puck. More...

Public Member Functions

 EpuckPosition2d (const SerialPort *const serialPort)
 The EpuckPosition2d class constructor.
void SetVel (float px, float pa) const
 Set linear and angular velocities to e-puck.
DynamicConfiguration UpdateOdometry ()
 Estimate the current pose and velocities.
void SetOdometry (Triple odometry)
 Set the current pose estimated by odometry.
void ResetOdometry ()
 Set the current pose estimated by odometry - (x,y,theta) - to (0,0,0).
void StopMotors () const
 Stop the e-puck motors.
BodyGeometry GetGeometry () const
 Give the e-puck geometry.

Private Attributes

EpuckTimer timer
DynamicConfiguration odometryState
BodyGeometry geometry

Static Private Attributes

static const float WHEEL_DIAMETER = 0.0412
static const float TRACK = 0.05255
static const float r_DIV_L = 0.392007612
static const float r_DIV_2 = 0.0103
static const float STEP_ANG_DISP = 6.283185308e-3

Constructor & Destructor Documentation

EpuckPosition2d::EpuckPosition2d ( const SerialPort *const  serialPort)

The EpuckPosition2d class constructor.

Parameters:
serialPortPointer for a SerialPort class already created and connected with an e-puck.

References EpuckInterface::EPUCK_DIAMETER, EpuckPosition2d::BodyGeometry::height, and EpuckPosition2d::BodyGeometry::width.


Member Function Documentation

BodyGeometry EpuckPosition2d::GetGeometry ( ) const [inline]

Give the e-puck geometry.

Returns:
A BodyGeometry struct.
void EpuckPosition2d::SetOdometry ( Triple  odometry)

Set the current pose estimated by odometry.

Set the internal representation for e-puck current pose estimated from odometry to the given value.

Parameters:
odometryThe value which will be set.

References EpuckInterface::GET_STEPS, EpuckPosition2d::DynamicConfiguration::pose, SerialPort::recvInt(), EpuckInterface::serialPort, EpuckInterface::Triple::theta, EpuckInterface::Triple::x, and EpuckInterface::Triple::y.

Here is the call graph for this function:

void EpuckPosition2d::SetVel ( float  px,
float  pa 
) const

Set linear and angular velocities to e-puck.

Receive the linear and agular velocities, convert to correspondent steps per seconds motors commands and send to e-puck.

Parameters:
pxLinear velocity. [m/s]
paAngular velocity. [rad/s]

References SerialPort::recvChar(), SerialPort::sendInt(), EpuckInterface::serialPort, and EpuckInterface::SET_VEL.

Here is the call graph for this function:

void EpuckPosition2d::StopMotors ( ) const

Stop the e-puck motors.

Stop the two motors and update the odometry by the steps yet non computed.

References SerialPort::recvChar(), EpuckInterface::serialPort, and EpuckInterface::STOP_MOTORS.

Here is the call graph for this function:

EpuckPosition2d::DynamicConfiguration EpuckPosition2d::UpdateOdometry ( )

Estimate the current pose and velocities.

Receive from e-puck the motors steps made since the last call at this function, and estimate the new current pose and velocities.

Returns:
A DynamicConfiguration struct.

References EpuckInterface::GET_STEPS, EpuckTimer::intervalDelay(), EpuckPosition2d::DynamicConfiguration::pose, SerialPort::recvInt(), EpuckTimer::resetInterval(), EpuckInterface::serialPort, EpuckInterface::Triple::theta, EpuckPosition2d::DynamicConfiguration::velocity, EpuckInterface::Triple::x, and EpuckInterface::Triple::y.

Here is the call graph for this function:


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