Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Private Member Functions | Private Attributes

mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors Class Reference


Detailed Description

: An interface for the phidget Interface kit board (1018).

Author:
Adrien BARRAL - Robopec (aba@robopec.com).

An interface for the Phidgets Interface kit board (part number 1018) on wich it could be plugged either an Sharp IR adaptater board (phidget's part number : 1101),or a MaxBotix EZ-1 sonar (phidget's part number : 1118). The configuration file describe what is plugged to this board, and the geometry of the sensors on the robots. See the exemple below.

 [PhidgetInterfaceKitProximitySensors]
 sensorLabel = FrontProximitySensors
 process_rate = 100                                             // Integer value in Hz (common to all sensors), default value is 50Hz.
 displayRecapitulativeInformations = true       // default value = false.
 serialNumber = 12345                                           // The interface kit serial number (Integer value), default value is -1.
 sensor1 = SHARP-30cm                                           // sharp InfraRed sensor 30cm range (string value). capital to convert raw data to range data (in meters).
 pose1_x = 0                                                            // position on the robot (float value in meters)
 pose1_y = 0
 pose1_z = 0.5
 pose1_yaw = -45.0                                      // Angles in degrees (float value).
 pose1_pitch = 0
 pose1_roll = 0
  //...
 sensorn = EZ1                                                  // Maxbotix Ultrasound sonar
 posen_x = 0
 // ...

The maximum number of sensors on this board is 8. Sensor 1 is the first sensor. If you haven't plugged any sensor on an entry of the board, you haven't to specify anyithing about this sensor in the configuration file. The following table enumerate the different sensors supported by this class.

Warning:
{The Phidget library use udev. By default, udev require to be root to be launched, if you want to be able to run a program wich use a phidget board without be root, you must modify files in /etc/udev/rules.d .}

Definition at line 90 of file CPhidgetInterfaceKitProximitySensors.h.

#include <mrpt/hwdrivers/CPhidgetInterfaceKitProximitySensors.h>

Inheritance diagram for mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPhidgetInterfaceKitProximitySensors ()
 Constructor.
virtual ~CPhidgetInterfaceKitProximitySensors ()
 Destructor.
void getObservation (mrpt::slam::CObservationRange &outObservation)
 This method tries to get a set of range measurements from the IR sensors.
void initialize ()
 Initialize the sensor according to the parameters previously read in the configuration file.
void doProcess ()
 This method should be called periodically.

Private Member Functions

void loadConfig_sensorSpecific (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::CGPSInterface for the possible parameters.

Private Attributes

std::vector< bool > m_sensorIsPlugged
 An 8 dimension vector of boolean value wich store the presence or abscence of a sensor on the phidget interface kit board.
std::vector< float > m_minRange
 The minimum range in meters, this field is automaticaly filled according to the sensor part number read in the configuration file.
std::vector< float > m_maxRange
 The maximum range in meters, this field is automaticaly filled according to the sensor part number read in the configuration file.
std::vector< SensorTypem_sensorType
 The sensor type.
std::vector< mrpt::math::CPose3Dm_sensorPoses
 The poses of the 8 sensors x[m] y[m] z[m] yaw[deg] pitch[deg] roll[deg].
int m_serialNumber
 The board serial number read in the configuration file.
float m_minOfMinRanges
float m_maxOfMaxRanges
void * m_carteInterfaceKit

Constructor & Destructor Documentation

mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::CPhidgetInterfaceKitProximitySensors ( )

Constructor.

Parameters:
serialNumberThe board's serial number. Set -1 to choose the first available board
virtual mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::~CPhidgetInterfaceKitProximitySensors ( ) [virtual]

Destructor.


Member Function Documentation

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

This method should be called periodically.

Period depend on the process_rate in the configuration file.

Implements mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::getObservation ( mrpt::slam::CObservationRange outObservation)

This method tries to get a set of range measurements from the IR sensors.

Parameters:
outThereIsObservationWill be true if an observation was sucessfully received.
void mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::initialize ( ) [virtual]

Initialize the sensor according to the parameters previously read in the configuration file.

Exceptions:
throwan exception if the board could not be found.
throwan exception if the process rate can't be set on one of the board channel.

Reimplemented from mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific ( const mrpt::utils::CConfigFileBase configSource,
const std::string &  iniSection 
) [private, 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::CGPSInterface for the possible parameters.

Implements mrpt::hwdrivers::CGenericSensor.


Member Data Documentation

Definition at line 146 of file CPhidgetInterfaceKitProximitySensors.h.

Definition at line 144 of file CPhidgetInterfaceKitProximitySensors.h.

The maximum range in meters, this field is automaticaly filled according to the sensor part number read in the configuration file.

Size of this vector depend on the number of sensors described in the configuration file.

Definition at line 130 of file CPhidgetInterfaceKitProximitySensors.h.

Definition at line 143 of file CPhidgetInterfaceKitProximitySensors.h.

The minimum range in meters, this field is automaticaly filled according to the sensor part number read in the configuration file.

Size of this vector depend on the number of sensors described in the configuration file.

Definition at line 125 of file CPhidgetInterfaceKitProximitySensors.h.

An 8 dimension vector of boolean value wich store the presence or abscence of a sensor on the phidget interface kit board.

Definition at line 121 of file CPhidgetInterfaceKitProximitySensors.h.

The poses of the 8 sensors x[m] y[m] z[m] yaw[deg] pitch[deg] roll[deg].

This field is automaticaly filled according to the sensor described in the configuration file.

Definition at line 138 of file CPhidgetInterfaceKitProximitySensors.h.

The sensor type.

Definition at line 134 of file CPhidgetInterfaceKitProximitySensors.h.

The board serial number read in the configuration file.

-1 for any board.

Definition at line 142 of file CPhidgetInterfaceKitProximitySensors.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011