|
| Ultrasonic (DigitalOutput *pingChannel, DigitalInput *echoChannel, DistanceUnit units=kInches) |
| Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo channel and a DigitalOutput for the ping channel. More...
|
|
| Ultrasonic (DigitalOutput &pingChannel, DigitalInput &echoChannel, DistanceUnit units=kInches) |
| Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo channel and a DigitalOutput for the ping channel. More...
|
|
| Ultrasonic (std::shared_ptr< DigitalOutput > pingChannel, std::shared_ptr< DigitalInput > echoChannel, DistanceUnit units=kInches) |
| Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo channel and a DigitalOutput for the ping channel. More...
|
|
| Ultrasonic (int pingChannel, int echoChannel, DistanceUnit units=kInches) |
| Create an instance of the Ultrasonic Sensor. More...
|
|
virtual | ~Ultrasonic () |
| Destructor for the ultrasonic sensor. More...
|
|
void | Ping () |
| Single ping to ultrasonic sensor. More...
|
|
bool | IsRangeValid () const |
| Check if there is a valid range measurement. More...
|
|
double | GetRangeInches () const |
| Get the range in inches from the ultrasonic sensor. More...
|
|
double | GetRangeMM () const |
| Get the range in millimeters from the ultrasonic sensor. More...
|
|
bool | IsEnabled () const |
|
void | SetEnabled (bool enable) |
|
double | PIDGet () override |
| Get the range in the current DistanceUnit for the PIDSource base object. More...
|
|
void | SetPIDSourceType (PIDSourceType pidSource) override |
| Set which parameter you are using as a process control variable. More...
|
|
void | SetDistanceUnits (DistanceUnit units) |
| Set the current DistanceUnit that should be used for the PIDSource base object. More...
|
|
DistanceUnit | GetDistanceUnits () const |
| Get the current DistanceUnit that is used for the PIDSource base object. More...
|
|
void | UpdateTable () override |
| Update the table for this sendable object with the latest values.
|
|
void | StartLiveWindowMode () override |
| Start having this sendable object automatically respond to value changes reflect the value on the table.
|
|
void | StopLiveWindowMode () override |
| Stop having this sendable object automatically respond to value changes.
|
|
std::string | GetSmartDashboardType () const override |
|
void | InitTable (std::shared_ptr< ITable > subTable) override |
| Initializes a table for this sendable object. More...
|
|
std::shared_ptr< ITable > | GetTable () const override |
|
| SensorBase (const SensorBase &)=delete |
|
SensorBase & | operator= (const SensorBase &)=delete |
|
| ErrorBase (const ErrorBase &)=delete |
|
ErrorBase & | operator= (const ErrorBase &)=delete |
|
virtual Error & | GetError () |
| Retrieve the current error. More...
|
|
virtual const Error & | GetError () const |
|
virtual void | SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
| Set error information associated with a C library call that set an error to the "errno" global variable. More...
|
|
virtual void | SetImaqError (int success, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
| Set the current error information associated from the nivision Imaq API. More...
|
|
virtual void | SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
| Set the current error information associated with this sensor. More...
|
|
virtual void | SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
| Set the current error information associated with this sensor. More...
|
|
virtual void | SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const |
| Set the current error information associated with this sensor. More...
|
|
virtual void | CloneError (const ErrorBase &rhs) const |
|
virtual void | ClearError () const |
| Clear the current error information associated with this sensor.
|
|
virtual bool | StatusIsFatal () const |
| Check if the current error code represents a fatal error. More...
|
|
PIDSourceType | GetPIDSourceType () const |
|
|
static void | SetAutomaticMode (bool enabling) |
| Turn Automatic mode on/off. More...
|
|
static int | GetDefaultSolenoidModule () |
|
static bool | CheckSolenoidModule (int moduleNumber) |
| Check that the solenoid module number is valid. More...
|
|
static bool | CheckDigitalChannel (int channel) |
| Check that the digital channel number is valid. More...
|
|
static bool | CheckRelayChannel (int channel) |
| Check that the relay channel number is valid. More...
|
|
static bool | CheckPWMChannel (int channel) |
| Check that the digital channel number is valid. More...
|
|
static bool | CheckAnalogInputChannel (int channel) |
| Check that the analog input number is value. More...
|
|
static bool | CheckAnalogOutputChannel (int channel) |
| Check that the analog output number is valid. More...
|
|
static bool | CheckSolenoidChannel (int channel) |
| Verify that the solenoid channel number is within limits. More...
|
|
static bool | CheckPDPChannel (int channel) |
| Verify that the power distribution channel number is within limits. More...
|
|
static void | SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) |
|
static void | SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) |
|
static Error & | GetGlobalError () |
| Retrieve the current global error.
|
|
Ultrasonic rangefinder class.
The Ultrasonic rangefinder measures absolute distance based on the round-trip time of a ping generated by the controller. These sensors use two transducers, a speaker and a microphone both tuned to the ultrasonic range. A common ultrasonic sensor, the Daventech SRF04 requires a short pulse to be generated on a digital channel. This causes the chirp to be emitted. A second line becomes high as the ping is transmitted and goes low when the echo is received. The time that the line is high determines the round trip distance (time of flight).