Difference between revisions of "Architecture:Specification of BABEL Interfaces"

From The BABEL Development Site
(Hardware Abstraction Drivers (HAD) interfaces)
(DRV_WHEELS_MOBILE_BASE)
Line 169: Line 169:
 
<tr>
 
<tr>
 
  <td rowspan="8" align="center" valign="center">
 
  <td rowspan="8" align="center" valign="center">
<big><code> DRV_XXX  </code></big><br> <br>
+
<big><code> DRV_WHEELS_MOBILE_BASE  </code></big><br> <br>
For XXXXX
+
For robotics mobile bases using wheels on 2D surfaces.
 
  </td>
 
  </td>
 
  <td> <!-- DECLARATION -->
 
  <td> <!-- DECLARATION -->
Line 246: Line 246:
 
</table>
 
</table>
 
</center>
 
</center>
 
 
 
  
 
=== DRV_XXX ===
 
=== DRV_XXX ===

Revision as of 22:51, 17 May 2009

Previous: Overview Next: Modules


Interfaces

Overview

In this page we present a number of standardized interfaces (IFs) for each layer of modules in our architecture. One given module may implement only one or several such interfaces simultaneously, a specially common case in the HAD layer.

Each interface is implemented in one and only one BABEL service groups, whose services are specified here. Data types are given in the standard BABEL description language (BDL), with some small additions declared under the namespace BABEL::COMMON, as shown in this Appendix.

The input parameter "devIndex" deserves more discussion, since it solves the problem of multiple copies of hardware devices with just one software module. This parameter is a zero-based index which specifies which device is being referenced for each access. The number of different devices is stored in the RPD (see section 4). Only modules in layers 2 and 3 are supposed to know about this parameter, so high-level modules never need to worry about how many hardware devices are present on the robot.

Developers of HAD modules are strongly encouraged to do implement real support for "devIndex". For example, at module start-up, the RPD may be checked to discover how many devices are present on the robot and what are they parameters (configuration ".ini"-like text block). An internal list of objects can be hold within the BABEL module, one for each physical device, so each request is directed to the appropriate device.


Hardware Abstraction Drivers (HAD) interfaces

The next section (Modules) contains a list of existing modules and the corresponding implemented IFs.

DRV_IOBOARD

BABEL service group BABEL services to implement

DRV_IOBOARD

For devices with capabilities for at least one of the following: Controlling of sonars range sensors, servos, ADC and DAC.

<cpp>

getCountADC(

in short devIndex, out unsigned short count ) </cpp>

Returns the number of Analog-to-Digital converters (ADC) available as inputs on this device.

<cpp>

getReadingsADC(

in short devIndex, out COMMMON::SeqOfFloats readings, out boolean error ) </cpp>

Return the latest ADC readings from the device. They are given in volts and are supposed to be acquired in last few milliseconds (Max. 1 sec.). Error is true on any error.

<cpp>

getCountDAC(

in short devIndex, out unsigned short count ) </cpp>

Returns the number of Digital-to-Analog converters (DAC) available as outputs on this device.

<cpp>

setOutputDAC(

in short devIndex, in unsigned short channel, in float value, out boolean error ) </cpp>

Sets an analog output. Desired value is given in volts, first channel is 0; error is true on failure.

<cpp>

getCountSonars(

in short devIndex, out unsigned short count ) </cpp>

Returns the number of sonars-range-finders attached to this device.

<cpp>

getReadingsSonars(

in short devIndex, out COMMMON::SeqOfFloats readings, out boolean error ) </cpp>

Return the latest sonars readings from the device. They are given in meters and are supposed to be acquired in last few milliseconds (Max. 1 sec.). Error is true on any error.

<cpp>

getCountPWM(

in short devIndex, out unsigned short count ) </cpp>

Returns the number of PWM generators available as outputs on this device. They can be used to control servos.

<cpp>

setOutputPWM(

in short devIndex, in unsigned short channel, in float value, out boolean error ) </cpp>

Sets the PWM “on” period, given in seconds. Typical values are 0.0002-0.004 secs; first channel is 0; error is true on failure.


DRV_WHEELS_MOBILE_BASE

BABEL service group BABEL services to implement

DRV_WHEELS_MOBILE_BASE

For robotics mobile bases using wheels on 2D surfaces.

<cpp>

getOdometry(

in short devIndex, in boolean reset, out double x, out double y, out double phi, out double v, out double w, out boolean error ) </cpp>

Reads the current odometric increment: x,y in meters and phi in radians, positive values are anticlockwise. phi=0 means heading towards positive x axis. If reset is true, odometry is set to (0,0,0) thus each request acquires the motion difference. Linear (v) and angular (w) velocities are also estimated, in m/s (positive/negative for forward/backward) and rad/s (positive is anticlockwise), respectively; error is true on failure.

<cpp>

setOdometry(

in short devIndex, in double x, in double y, in double phi, out boolean error ) </cpp>

Changes the odometry estimation of the device. ; error is true on failure.

<cpp>

setVelocities(

in short devIndex, in double v, in double w, out boolean error ) </cpp>

Changes the desired base linear (v) and angular (w) velocities, in m/s and rad/s, respectively. The conventions are the same than in service “getOdometry”

error is true on failure.

<cpp>

getGroundThruth(

in short devIndex, out double x, out double y, out double phi, out double v, out double w, out boolean error ) </cpp>

Only for simulated robots: It returns the true pose, and velocities, of the robot in the simulated world coordinate reference. In non-simulated modules this method may return the current robot odometry.

DRV_XXX

BABEL service group BABEL services to implement

DRV_XXX

For XXXXX

<cpp>

get....

</cpp>

Returns...

<cpp>

get...

</cpp>

Return...

Common Sensory Interface

Common Actions Interface