![]() |
EduArt Sensor Ring Library 4.0.0
|
Device wrapper for a TMF8829 Time-of-Flight sensor on the sensorring bus. More...
#include <TMF8829_Device.hpp>
Public Member Functions | |
| TMF8829_Device (TMF8829_Params params, com::ComInterfaceID interface, unsigned int idx) | |
| Construct a new TMF8829 device instance. | |
| ~TMF8829_Device () | |
| Destructor. | |
| const TMF8829_Params & | getParams () const override |
| Get the sensor parameters used to configure this device. | |
| bool | setResolutionMode (ResolutionMode mode) |
| Set the resolution mode of the sensor. | |
| bool | getResolutionMode (ResolutionMode &mode) |
| Get the resolution mode of the sensor. | |
| bool | setIterationsSetting (std::uint16_t k_iterations) |
| Set the iterations setting of the sensor in kilo iteration per measurement. | |
| bool | getIterationsSetting (std::uint16_t &k_iterations) |
| Get the iterations setting of the sensor in kilo iteration per measurement. | |
| bool | setResultFormat (TMF8829_ResultFormat format) |
| Set the result format of the sensor. | |
| bool | getResultFormat (TMF8829_ResultFormat &format) |
| Get the result format of the sensor. | |
| bool | setResultFullNoise (bool full_noise) |
| Enable or disable full noise data in measurement results. | |
| bool | getResultFullNoise (bool &full_noise) |
| Get whether full noise data is included in measurement results. | |
| bool | setResultXtalk (bool xtalk) |
| Enable or disable crosstalk data in measurement results. | |
| bool | getResultXtalk (bool &xtalk) |
| Get whether crosstalk data is included in measurement results. | |
| bool | setResultNoiseStrength (bool noise_strength) |
| Enable or disable noise strength data in measurement results. | |
| bool | getResultNoiseStrength (bool &noise_strength) |
| Get whether noise strength data is included in measurement results. | |
| bool | setResultSignalStrength (bool signal_strength) |
| Enable or disable signal strength data in measurement results. | |
| bool | getResultSignalStrength (bool &signal_strength) |
| Get whether signal strength data is included in measurement results. | |
| bool | setResultNrOfPeaks (std::uint8_t nr_of_peaks) |
| Set the maximum number of peaks reported per pixel in measurement results. | |
| bool | getResultNrOfPeaks (std::uint8_t &nr_of_peaks) |
| Get the maximum number of peaks reported per pixel in measurement results. | |
| bool | configure () override |
| Re-apply runtime configuration after a board reset. | |
| Public Member Functions inherited from eduart::sensorring::device::DepthSensor | |
| DepthSensor (DeviceID id, com::ComInterface *interface, com::ComEndpoint target, DepthSensorConfig config) | |
| Construct a DepthSensor with Device params, field-of-view and pixel resolution. | |
| const measurement::DepthMeasurement & | getLatestMeasurement () const |
| Get the most recent measurement. | |
| subscription::Subscription | subscribe (std::function< void(const measurement::DepthMeasurement &)> callback) |
| Subscribe to depth measurements from this sensor. | |
| virtual void | publishMeasurement () |
| Build a DepthMeasurement from internal state and publish to all subscribers. | |
| Public Member Functions inherited from eduart::sensorring::device::Sensor | |
| Sensor (DeviceID id, com::ComInterface *interface, com::ComEndpoint target) | |
| Construct the sensor with identity and communication link. | |
| std::future< bool > | measure (std::uint8_t sequence_number) |
| std::future< bool > | fetch () |
| std::future< bool > | beginMeasurementWait () |
| Begin an asynchronous wait for the next measurement trigger. | |
| void | setMeasurementReady (bool success) |
| Satisfy the pending measurement-wait future. | |
| std::future< bool > | beginDataAvailableWait () |
| Begin an asynchronous wait for new data to become available. | |
| void | setDataAvailableReady (bool success) |
| Satisfy the pending data-available-wait future. | |
| void | resetSensorState () |
| Reset the device to its initialised state, clearing all error flags. | |
| void | clearDataFlag () |
| Clear the data-available flag so the device can accept the next measurement cycle. | |
| Public Member Functions inherited from eduart::sensorring::device::Device | |
| Device (DeviceID id, com::ComInterface *interface, com::ComEndpoint target) | |
| Construct the device with identity and communication link. | |
| DeviceID | getDeviceID () const |
| Return the full device identifier (type + index). | |
| unsigned int | getHwIdx () const |
| Return the zero-based hardware board index on its bus (used for CAN addressing and protocol bitmasks). | |
| void | setDeviceIndex (unsigned int index) |
| Reassign the logical device index (DeviceID.index) without changing the hardware index. | |
| void | setBoardContext (const board::SensorBoardParams *board_params) |
| Initialize board-level context pointer (non-owning). | |
| const board::SensorBoardParams * | getBoardContext () const |
| Return the board-level context pointer (non-owning). | |
| void | setPoseOffset (const math::Pose &offset) |
| Store a pose offset relative to the board centre. | |
| math::Pose | getPoseOffset () const |
| Return the stored pose offset relative to the board centre. | |
| math::Pose | getGlobalPose () const |
| Compute and return the global pose in the ring coordinate frame. | |
| Public Member Functions inherited from eduart::sensorring::ActionDispatcher | |
| void | setQueue (ActionQueue *queue) |
| void | clearQueue () |
| bool | isManaged () const |
| void | execute (Action action) |
| void | execute (std::string_view key, Action action) |
Protected Member Functions | |
| bool | sendMeasurementRequest (std::uint8_t sequence_number) override |
| bool | sendMeasurementTransmissionRequest () override |
| Protected Member Functions inherited from eduart::sensorring::device::DepthSensor | |
| void | updateResolution (double fov_x_deg, double fov_y_deg, unsigned int res_x, unsigned int res_y) |
| Update the sensor's FOV and resolution, and recalculate the lookup tables. | |
| virtual void | createLookupTable (DepthSensorConfig config, std::vector< double > &lut_x, std::vector< double > &lut_y, std::vector< double > &lut_z) |
| Create lookup tables for x and y angles based on FOV and resolution. | |
| void | processRawMeasurement (measurement::PointCloud &pcl) |
| Calculate the x,y,z coordinates from the raw distance measurements. | |
| Protected Member Functions inherited from eduart::sensorring::device::Sensor | |
| virtual void | onResetSensorState () |
| virtual void | onClearDataFlag () |
| Protected Member Functions inherited from eduart::sensorring::device::Device | |
| virtual void | comCallback (const com::ComEndpoint source, std::uint8_t command, const std::vector< std::uint8_t > &data)=0 |
Friends | |
| class | TMF8829_DeviceImpl |
Additional Inherited Members | |
| Public Types inherited from eduart::sensorring::device::DepthSensor | |
| using | MeasurementType = measurement::DepthMeasurement |
| Measurement type produced by this sensor category. | |
| Static Public Member Functions inherited from eduart::sensorring::ActionDispatcher | |
| static void | globalExecute (Action action) |
| Protected Attributes inherited from eduart::sensorring::device::DepthSensor | |
| DepthSensorConfig | _config |
| std::vector< double > | _lut_x |
| std::vector< double > | _lut_y |
| std::vector< double > | _lut_z |
| measurement::DepthMeasurement | _latest_measurement |
| subscription::Publisher< const measurement::DepthMeasurement & > | _depth_publisher |
| Protected Attributes inherited from eduart::sensorring::device::Sensor | |
| DeviceState | _state |
| std::mutex | _state_mutex |
| std::mutex | _promise_mutex |
| std::optional< std::promise< bool > > | _data_available_promise |
| std::optional< std::promise< bool > > | _measurement_promise |
| Protected Attributes inherited from eduart::sensorring::device::Device | |
| DeviceID | _id |
| unsigned int | _hw_idx |
| com::ComInterface * | _interface |
| const board::SensorBoardParams * | _board_params = nullptr |
| math::Pose | _offset |
| subscription::Subscription | _com_subscription |
Device wrapper for a TMF8829 Time-of-Flight sensor on the sensorring bus.
| eduart::sensorring::device::TMF8829_Device::TMF8829_Device | ( | TMF8829_Params | params, |
| com::ComInterfaceID | interface, | ||
| unsigned int | idx ) |
Construct a new TMF8829 device instance.
| [in] | params | Sensor configuration parameters. |
| [in] | interface | Communication interface used to talk to the device. |
| [in] | idx | Index of the sensor on the bus. |
|
overridevirtual |
Re-apply runtime configuration after a board reset.
Reimplemented from eduart::sensorring::device::Device.
| bool eduart::sensorring::device::TMF8829_Device::getIterationsSetting | ( | std::uint16_t & | k_iterations | ) |
Get the iterations setting of the sensor in kilo iteration per measurement.
| [out] | k_iterations | Reference to store the current iterations setting. Refer to the TMF8829 datasheet for more details about this setting. |
|
overridevirtual |
Get the sensor parameters used to configure this device.
Implements eduart::sensorring::device::DepthSensor.
| bool eduart::sensorring::device::TMF8829_Device::getResolutionMode | ( | ResolutionMode & | mode | ) |
Get the resolution mode of the sensor.
| [out] | mode | Reference to store the current resolution mode. |
| bool eduart::sensorring::device::TMF8829_Device::getResultFormat | ( | TMF8829_ResultFormat & | format | ) |
Get the result format of the sensor.
| [out] | format | Reference to store the current result format. |
| bool eduart::sensorring::device::TMF8829_Device::getResultFullNoise | ( | bool & | full_noise | ) |
Get whether full noise data is included in measurement results.
| [out] | full_noise | Reference to store the current full noise flag. |
| bool eduart::sensorring::device::TMF8829_Device::getResultNoiseStrength | ( | bool & | noise_strength | ) |
Get whether noise strength data is included in measurement results.
| [out] | noise_strength | Reference to store the current noise strength flag. |
| bool eduart::sensorring::device::TMF8829_Device::getResultNrOfPeaks | ( | std::uint8_t & | nr_of_peaks | ) |
Get the maximum number of peaks reported per pixel in measurement results.
| [out] | nr_of_peaks | Reference to store the current maximum number of peaks. |
| bool eduart::sensorring::device::TMF8829_Device::getResultSignalStrength | ( | bool & | signal_strength | ) |
Get whether signal strength data is included in measurement results.
| [out] | signal_strength | Reference to store the current signal strength flag. |
| bool eduart::sensorring::device::TMF8829_Device::getResultXtalk | ( | bool & | xtalk | ) |
Get whether crosstalk data is included in measurement results.
| [out] | xtalk | Reference to store the current crosstalk flag. |
|
overrideprotectedvirtual |
Implements eduart::sensorring::device::Sensor.
|
overrideprotectedvirtual |
Implements eduart::sensorring::device::Sensor.
| bool eduart::sensorring::device::TMF8829_Device::setIterationsSetting | ( | std::uint16_t | k_iterations | ) |
Set the iterations setting of the sensor in kilo iteration per measurement.
| [in] | k_iterations | Iterations setting to set. Refer to the TMF8829 datasheet for more details about this setting. |
| bool eduart::sensorring::device::TMF8829_Device::setResolutionMode | ( | ResolutionMode | mode | ) |
Set the resolution mode of the sensor.
| [in] | mode | Resolution mode to set. |
| bool eduart::sensorring::device::TMF8829_Device::setResultFormat | ( | TMF8829_ResultFormat | format | ) |
Set the result format of the sensor.
| [in] | format | Result format to set. |
| bool eduart::sensorring::device::TMF8829_Device::setResultFullNoise | ( | bool | full_noise | ) |
Enable or disable full noise data in measurement results.
| [in] | full_noise | Set to true to include full noise data in results. |
| bool eduart::sensorring::device::TMF8829_Device::setResultNoiseStrength | ( | bool | noise_strength | ) |
Enable or disable noise strength data in measurement results.
| [in] | noise_strength | Set to true to include noise strength in results. |
| bool eduart::sensorring::device::TMF8829_Device::setResultNrOfPeaks | ( | std::uint8_t | nr_of_peaks | ) |
Set the maximum number of peaks reported per pixel in measurement results.
| [in] | nr_of_peaks | Maximum number of peaks to report. |
| bool eduart::sensorring::device::TMF8829_Device::setResultSignalStrength | ( | bool | signal_strength | ) |
Enable or disable signal strength data in measurement results.
| [in] | signal_strength | Set to true to include signal strength in results. |
| bool eduart::sensorring::device::TMF8829_Device::setResultXtalk | ( | bool | xtalk | ) |
Enable or disable crosstalk data in measurement results.
| [in] | xtalk | Set to true to include crosstalk data in results. |