MRPT logo

mrpt::hwdrivers::CActivMediaRobotBase Class Reference

This software driver implements the communications (and some rudimentary control) for ActivMedia robotic bases (Pioneer DX/AT, PeopleBot, etc). More...

#include <mrpt/hwdrivers/CActivMediaRobotBase.h>

Inheritance diagram for mrpt::hwdrivers::CActivMediaRobotBase:

mrpt::hwdrivers::CGenericSensor mrpt::utils::CUncopiable

List of all members.

Public Member Functions

void initialize ()
 Connects to the robot.
 CActivMediaRobotBase ()
 Constructor.
virtual ~CActivMediaRobotBase ()
 Destructor: turns off communications.
void loadConfig (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
 Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CActivMediaRobotBase for the possible parameters.
void setSerialPortConfig (const std::string &portName, int portBaudRate)
 Manually sets the serial port configuration.
void doProcess ()
 Collect odometry readings and put them in the "observations" queue: DO NOT call this normally, it's useful only for the application rawloggrabber.
void changeOdometry (const mrpt::poses::CPose2D &newOdometry)
 Change the current robot odometry pose.
void getOdometry (poses::CPose2D &out_odom)
 Get the current robot's odometry.
void getOdometryFull (poses::CPose2D &out_odom, double &out_lin_vel, double &out_ang_vel, int64_t &out_left_encoder_ticks, int64_t &out_right_encoder_ticks)
 Get the current robot's odometry.
void getOdometryIncrement (poses::CPose2D &out_incr_odom, double &out_lin_vel, double &out_ang_vel, int64_t &out_incr_left_encoder_ticks, int64_t &out_incr_right_encoder_ticks)
 Get the robot's odometry increment since the last call to this method (the first time the increments are always fixed to zero).
void getSonarsReadings (bool &thereIsObservation, mrpt::slam::CObservationRange &obs)
 Get the readings from the sonars, only if the observations are new.
void getBatteryCharge (double &out_batery_volts)
 Get the robot battery charge.
void setVelocities (const double &lin_vel, const double &ang_vel)
 Set the robot linear and angular velocities.

Protected Member Functions

void disconnectAndDisableMotors ()
void connectAndEnableMotors ()

Protected Attributes

std::string m_com_port
 The serial port name to use for communications (COM1, ttyS1,...).
int m_robotBaud
 The bauds for ARIA communications to the robot.
bool m_firstIncreOdometry
 Used in getOdometryIncrement.
bool m_enableSonars
void * m_robot
void * m_sonarDev
void * m_simpleConnector
 The connection to the robot.


Detailed Description

This software driver implements the communications (and some rudimentary control) for ActivMedia robotic bases (Pioneer DX/AT, PeopleBot, etc).

There is implemented access to robot odometry, ticks counts, velocities, battery charge status, and sonar readings, as well as basic velocity control.

It is required to check MRPT_BUILD_ARIA in the cmake configuration to enable this class to work properly.

See also the application "RawLogGrabber" for a ready-to-use application to gather data from the robot base.

  PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
 -------------------------------------------------------
   [supplied_section_name]
    robotPort_WIN               = COM1
    robotPort_LIN               = /dev/ttyS0
    robotBaud                   = 115200
    enableSonars         = 0     ; 0:Disabled (default), 1: Enabled
    joystick_control            = 0             ; 0:Disabled (default), 1: Enabled
           joystick_max_v               = 0.3   ; Max joystick control speed (m/s)
           joystick_max_w_degps = 40    ; Max joystick control speed (deg/s)
           joystick_is_gamepad  = 0             ; 0: Direct control of speeds, 1: Gamepad control speed *increments*, buttons = stop.

Definition at line 63 of file CActivMediaRobotBase.h.


Constructor & Destructor Documentation

mrpt::hwdrivers::CActivMediaRobotBase::CActivMediaRobotBase (  ) 

Constructor.

virtual mrpt::hwdrivers::CActivMediaRobotBase::~CActivMediaRobotBase (  )  [virtual]

Destructor: turns off communications.


Member Function Documentation

void mrpt::hwdrivers::CActivMediaRobotBase::changeOdometry ( const mrpt::poses::CPose2D newOdometry  ) 

Change the current robot odometry pose.

void mrpt::hwdrivers::CActivMediaRobotBase::connectAndEnableMotors (  )  [protected]

void mrpt::hwdrivers::CActivMediaRobotBase::disconnectAndDisableMotors (  )  [protected]

void mrpt::hwdrivers::CActivMediaRobotBase::doProcess (  )  [virtual]

Collect odometry readings and put them in the "observations" queue: DO NOT call this normally, it's useful only for the application rawloggrabber.

Implements mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CActivMediaRobotBase::getBatteryCharge ( double &  out_batery_volts  ) 

Get the robot battery charge.

void mrpt::hwdrivers::CActivMediaRobotBase::getOdometry ( poses::CPose2D out_odom  ) 

Get the current robot's odometry.

Parameters:
out_odom The odometry will be returned here.
See also:
getOdometryFull, getOdometryIncrement

void mrpt::hwdrivers::CActivMediaRobotBase::getOdometryFull ( poses::CPose2D out_odom,
double &  out_lin_vel,
double &  out_ang_vel,
int64_t &  out_left_encoder_ticks,
int64_t &  out_right_encoder_ticks 
)

Get the current robot's odometry.

Parameters:
out_odom The odometry will be returned here.
out_lin_vel The linear speed, in m/s, positive is forward.
out_ang_vel The angular speed, in rad/s, positive is anticlockwise.
out_left_encoder_ticks The current overall count of ticks for the left wheel encoder.
out_right_encoder_ticks The current overall count of ticks for the right wheel encoder.
See also:
getOdometry, getOdometryIncrement

void mrpt::hwdrivers::CActivMediaRobotBase::getOdometryIncrement ( poses::CPose2D out_incr_odom,
double &  out_lin_vel,
double &  out_ang_vel,
int64_t &  out_incr_left_encoder_ticks,
int64_t &  out_incr_right_encoder_ticks 
)

Get the robot's odometry increment since the last call to this method (the first time the increments are always fixed to zero).

Parameters:
out_odom The odometry increment.
out_lin_vel The current linear speed, in m/s, positive is forward (Absolute values, not increments)
out_ang_vel The angular speed, in rad/s, positive is anticlockwise (Absolute values, not increments).
out_left_encoder_ticks The increment in ticks for the left wheel encoder.
out_right_encoder_ticks The increment in ticks for the right wheel encoder.
See also:
getOdometry, getOdometryFull

void mrpt::hwdrivers::CActivMediaRobotBase::getSonarsReadings ( bool &  thereIsObservation,
mrpt::slam::CObservationRange obs 
)

Get the readings from the sonars, only if the observations are new.

void mrpt::hwdrivers::CActivMediaRobotBase::initialize (  )  [virtual]

Connects to the robot.

Reimplemented from mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CActivMediaRobotBase::loadConfig ( const mrpt::utils::CConfigFileBase configSource,
const std::string &  iniSection 
) [virtual]

Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CActivMediaRobotBase for the possible parameters.

See also:
setSerialPortConfig

Implements mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CActivMediaRobotBase::setSerialPortConfig ( const std::string &  portName,
int  portBaudRate 
)

Manually sets the serial port configuration.

Parameters:
portName Examples: Windows: "COM1" , Linux: "/dev/ttyUSB0"
portBaudRate 9600, 115200, etc..
See also:
loadConfig

void mrpt::hwdrivers::CActivMediaRobotBase::setVelocities ( const double &  lin_vel,
const double &  ang_vel 
)

Set the robot linear and angular velocities.

Parameters:
lin_vel Linear speed, in m/s.
ang_vel Angular speed, in rad/s.


Member Data Documentation

The serial port name to use for communications (COM1, ttyS1,...).

Definition at line 155 of file CActivMediaRobotBase.h.

Definition at line 159 of file CActivMediaRobotBase.h.

Used in getOdometryIncrement.

Definition at line 158 of file CActivMediaRobotBase.h.

Definition at line 161 of file CActivMediaRobotBase.h.

The bauds for ARIA communications to the robot.

Definition at line 156 of file CActivMediaRobotBase.h.

The connection to the robot.

Definition at line 163 of file CActivMediaRobotBase.h.

Definition at line 162 of file CActivMediaRobotBase.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:35:09 EST 2009