: An interface for the phidget Interface kit board (1018).
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.
Definition at line 90 of file CPhidgetInterfaceKitProximitySensors.h.
#include <mrpt/hwdrivers/CPhidgetInterfaceKitProximitySensors.h>
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< SensorType > | m_sensorType |
The sensor type. | |
std::vector< mrpt::math::CPose3D > | m_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 |
mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::CPhidgetInterfaceKitProximitySensors | ( | ) |
Constructor.
serialNumber | The board's serial number. Set -1 to choose the first available board |
virtual mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::~CPhidgetInterfaceKitProximitySensors | ( | ) | [virtual] |
Destructor.
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.
outThereIsObservation | Will 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.
throw | an exception if the board could not be found. | |
throw | an 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.
Definition at line 146 of file CPhidgetInterfaceKitProximitySensors.h.
Definition at line 144 of file CPhidgetInterfaceKitProximitySensors.h.
std::vector<float> mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::m_maxRange [private] |
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.
std::vector<float> mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::m_minRange [private] |
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.
std::vector<bool> mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::m_sensorIsPlugged [private] |
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.
std::vector<mrpt::math::CPose3D> mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::m_sensorPoses [private] |
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.
std::vector<SensorType> mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::m_sensorType [private] |
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.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |