Class CPhidgetInterfaceKitProximitySensors

Inheritance Relationships

Base Types

Class Documentation

class CPhidgetInterfaceKitProximitySensors : public mrpt::system::COutputLogger, public mrpt::hwdrivers::CGenericSensor

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

An interface for the Phidgets Interface kit board (part number 1018) on which 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 example 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
// ...
Author

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

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 which use a phidget board without be root, you must modify files in /etc/udev/rules.d .}

Public Functions

CPhidgetInterfaceKitProximitySensors()

Constructor

Parameters:

serialNumber – The board’s serial number. Set -1 to choose the first available board

~CPhidgetInterfaceKitProximitySensors() override

Destructor

void getObservation(mrpt::obs::CObservationRange &outObservation)

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

Parameters:

outThereIsObservation – Will be true if an observation was sucessfully received.

virtual void initialize() override

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

Throws:
  • 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.

virtual void doProcess() override

This method should be called periodically. Period depend on the process_rate in the configuration file.