Mailing lists


Old news
Old stuff

SonarProxy Class Reference

#include <playerclient.h>

Inherits ClientProxy.

List of all members.

Detailed Description

The SonarProxy class is used to control a sonar device. The most recent sonar range measuremts can be read from the range attribute, or using the the [] operator.

Public Member Functions

 SonarProxy (PlayerClient *pc, unsigned short index, unsigned char access= 'c')
int SetSonarState (unsigned char state)
int GetSonarGeom ()
 Request the sonar geometry.

double operator[] (unsigned int index)
void FillData (player_msghdr_t hdr, const char *buffer)
void Print ()
 Print out current sonar range data.

Public Attributes

unsigned short range_count
int pose_count
double poses [PLAYER_SONAR_MAX_SAMPLES][3]

Constructor & Destructor Documentation

SonarProxy::SonarProxy PlayerClient pc,
unsigned short  index,
unsigned char  access = 'c'

Constructor. Leave the access field empty to start unconnected.

Member Function Documentation

int SonarProxy::SetSonarState unsigned char  state  ) 

Enable/disable the sonars. Set state to 1 to enable, 0 to disable. Note that when sonars are disabled the client will still receive sonar data, but the ranges will always be the last value read from the sonars before they were disabled.

Returns 0 on success, -1 if there is a problem.

int SonarProxy::GetSonarGeom  ) 

Request the sonar geometry.

double SonarProxy::operator[] unsigned int  index  )  [inline]

Range access operator. This operator provides an alternate way of access the range data. For example, given a SonarProxy named sp, the following expressions are equivalent: sp.ranges[0] and sp[0].

void SonarProxy::FillData player_msghdr_t  hdr,
const char *  buffer

All proxies must provide this method. It is used internally to parse new data when it is received.

Reimplemented from ClientProxy.

void SonarProxy::Print  )  [virtual]

Print out current sonar range data.

Reimplemented from ClientProxy.

Member Data Documentation

unsigned short SonarProxy::range_count

The number of sonar readings received.

double SonarProxy::ranges[PLAYER_SONAR_MAX_SAMPLES]

The latest sonar scan data. Range is measured in m.

int SonarProxy::pose_count

Number of valid sonar poses

double SonarProxy::poses[PLAYER_SONAR_MAX_SAMPLES][3]

Sonar poses (m,m,radians)

The documentation for this class was generated from the following file:
Generated on Tue May 3 14:16:06 2005 for Player by doxygen 1.3.6