gusimplewhiteboard
guWhiteboard::SENSORSSonarSensors Class Reference

Contains the latest Sonar readings. More...

#include <SENSORSSonarSensors.hpp>

Inheritance diagram for guWhiteboard::SENSORSSonarSensors:
Collaboration diagram for guWhiteboard::SENSORSSonarSensors:

Public Member Functions

 SENSORSSonarSensors ()
 
bool operator== (const SENSORSSonarSensors &s)
 comparison operator More...
 
bool operator!= (const SENSORSSonarSensors &s)
 compare two sonar sensor value records and return false if they are the same More...
 
 SENSORSSonarSensors (const std::string &str)
 string constructor (see from_string() below) More...
 
void from_string (const std::string &str)
 parse class properties from a string More...
 
std::string description () const
 pretty print method for showing the current property values More...
 

Detailed Description

Contains the latest Sonar readings.

Measured in CM, Range is 0-255, Updated at 10Hz (currently, max of 100Hz). Object nearer than 20cm to a Nao will report a distance of 20cm.

Examples

Get the distance in cm to the nearest object on the left

SENSORSSonarSensors s = SENSORSSonarSensors_t.get(); //get from the whiteboard
int dist = s.sonar(Sonar::Left0); //pull the variable out of the class

Definition at line 119 of file SENSORSSonarSensors.hpp.

Constructor & Destructor Documentation

◆ SENSORSSonarSensors() [1/2]

guWhiteboard::SENSORSSonarSensors::SENSORSSonarSensors ( )
inline

Definition at line 123 of file SENSORSSonarSensors.hpp.

◆ SENSORSSonarSensors() [2/2]

guWhiteboard::SENSORSSonarSensors::SENSORSSonarSensors ( const std::string &  str)
inline

string constructor (see from_string() below)

Parameters
stra serialised string containing properties to set in this class

Definition at line 151 of file SENSORSSonarSensors.hpp.

References from_string().

Member Function Documentation

◆ description()

std::string guWhiteboard::SENSORSSonarSensors::description ( ) const
inline

pretty print method for showing the current property values

Returns
pretty printed string

Definition at line 172 of file SENSORSSonarSensors.hpp.

References guWhiteboard::Sonar::NUMBER_OF_READINGS.

◆ from_string()

void guWhiteboard::SENSORSSonarSensors::from_string ( const std::string &  str)
inline

parse class properties from a string

Parameters
stra serialised string containing properties to set in this class

Definition at line 156 of file SENSORSSonarSensors.hpp.

References guWhiteboard::Sonar::NUMBER_OF_READINGS, and u_int8_t.

Referenced by SENSORSSonarSensors().

◆ operator!=()

bool guWhiteboard::SENSORSSonarSensors::operator!= ( const SENSORSSonarSensors s)
inline

compare two sonar sensor value records and return false if they are the same

Definition at line 142 of file SENSORSSonarSensors.hpp.

◆ operator==()

bool guWhiteboard::SENSORSSonarSensors::operator== ( const SENSORSSonarSensors s)
inline

comparison operator

Definition at line 129 of file SENSORSSonarSensors.hpp.

References guWhiteboard::Sonar::Left0, and guWhiteboard::Sonar::NUMBER_OF_READINGS.


The documentation for this class was generated from the following file: