next up previous contents
Next: 6.24 sound Up: 6. Device Interfaces Previous: 6.22 ptz   Contents

Subsections


6.23 sonar

Synopsis

The sonar interface provides access to a collection of fixed range sensors, such as a sonar array.

Constants

#define PLAYER_SONAR_MAX_SAMPLES 64
maximum number of sonar samples in a data packet

#define PLAYER_SONAR_GET_GEOM_REQ ((uint8_t)1)
#define PLAYER_SONAR_POWER_REQ ((uint8_t)2)
request types

Data



struct player_sonar_data : The sonar interface returns up to 32 range readings from a robot's sonars. The format is:

uint16_t range_count;
The number of valid range readings.

uint16_t ranges[PLAYER_SONAR_MAX_SAMPLES];
The range readings

Commands

This interface accepts no commands.

Configuration: Query geometry



struct player_sonar_geom : To query the geometry of the sonar transducers, use the request given below, but only fill in the subtype. The server will reply with the other fields filled in.

uint8_t subtype;
Subtype. Must be PLAYER_SONAR_GET_GEOM_REQ.

uint16_t pose_count;
The number of valid poses.

int16_t poses[PLAYER_SONAR_MAX_SAMPLES][3];
Pose of each sonar, in robot cs (mm, mm, degrees).

Configuration: Sonar power



struct player_sonar_power_config : On some robots, the sonars can be turned on and off from software. To do so, issue a request of the form given below. The server will reply with a zero-length acknowledgement.

uint8_t subtype;
Packet subtype. Must be PLAYER_P2OS_SONAR_POWER_REQ.

uint8_t value;
Turn power off (0) or on (>0)


next up previous contents
Next: 6.24 sound Up: 6. Device Interfaces Previous: 6.22 ptz   Contents
2004-06-02