The sonar interface provides access to a collection of fixed range sensors, such as a sonar array.
#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
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
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).
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)