class mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors

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

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. {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 .}

#include <mrpt/hwdrivers/CPhidgetInterfaceKitProximitySensors.h>

class CPhidgetInterfaceKitProximitySensors:
    public mrpt::system::COutputLogger,
    public mrpt::hwdrivers::CGenericSensor
{
public:
    // construction

    CPhidgetInterfaceKitProximitySensors();

    //
methods

    void getObservation(mrpt::obs::CObservationRange& outObservation);
    virtual void initialize();
    virtual void doProcess();
};

Inherited Members

public:
    // structs

    struct TMsg;

    //
methods

    CGenericSensor& operator = (const CGenericSensor&);
    virtual void doProcess() = 0;

Construction

CPhidgetInterfaceKitProximitySensors()

Constructor.

Parameters:

serialNumber

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

Methods

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()

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

Parameters:

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()

This method should be called periodically.

Period depend on the process_rate in the configuration file.