Go to the documentation of this file.
28 #define BIND_EVENT(event_name)\
29 std::bind(&ScannerV2::triggerEvent<event_name>, this)
31 #define BIND_RAW_DATA_EVENT(event_name)\
32 [this](const data_conversion_layer::RawDataConstPtr& data, const std::size_t& num_bytes, const int64_t& timestamp){ triggerEventWithParam(event_name(data, num_bytes, timestamp)); }
36 const std::function<
void()>& timeout_callback)
38 return std::unique_ptr<util::Watchdog>(
new util::Watchdog(timeout, timeout_callback));
42 :
IScanner(scanner_config, laser_scan_callback)
49 std::bind(&
ScannerV2::scannerStartErrorCallback, this,
std::placeholders::_1),
50 std::bind(&
ScannerV2::scannerStopErrorCallback, this,
std::placeholders::_1),
79 return std::future<void>();
97 return std::future<void>();
113 PSENSCAN_INFO(
"ScannerController",
"Scanner started successfully.");
123 PSENSCAN_INFO(
"ScannerController",
"Scanner stopped successfully.");
131 scanner_has_started_.value().set_exception(std::make_exception_ptr(std::runtime_error(error_msg)));
138 scanner_has_stopped_.value().set_exception(std::make_exception_ptr(std::runtime_error(error_msg)));
void laserScanCallback(const LaserScan &scan)
const std::chrono::high_resolution_clock::duration Timeout
std::future< void > stop() override
An exception is set in the returned future if the scanner stop was not successful.
OptionalPromise scanner_has_stopped_
msm::back::state_machine< ScannerProtocolDef > ScannerStateMachine
State machine handling all events according to the scanner protocol and error handling specification.
Received Start- or Stop-Reply message from scanner device.
#define PSENSCAN_DEBUG(name,...)
User requests scanner to start.
Triggered whenever the receiving of a monitoring frame failes.
Timeout while waiting for scanner device to start.
std::unique_ptr< ScannerStateMachine > sm_
std::mutex member_mutex_
This Mutex protects ALL members of the Scanner against concurrent access. So far there exist at least...
std::unique_ptr< util::Watchdog > create(const util::Watchdog::Timeout &timeout, const TimeoutCallback &timeout_callback) override
void scannerStopErrorCallback(const std::string &error_msg)
#define BIND_RAW_DATA_EVENT(event_name)
#define PSENSCAN_INFO(name,...)
User requests scanner to stop.
This is the implementation of the Scanner API defined by IScanner.
void scannerStartErrorCallback(const std::string &error_msg)
Triggered whenever the receiving of a reply message failes.
Timeout while waiting for MonitoringFrame.
void scannerStoppedCallback()
void scannerStartedCallback()
Received monitoring frame from scanner device.
std::future< void > start() override
An exception is set in the returned future if the scanner start was not successful.
Watchdog which continuously calls the specified timeout callback.
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
std::function< void(const LaserScan &)> LaserScanCallback
Represents the user-provided callback for processing incoming scan data.
#define BIND_EVENT(event_name)
ScannerV2(const ScannerConfiguration &scanner_config, const LaserScanCallback &laser_scan_callback)
OptionalPromise scanner_has_started_
This is the API definition for external interaction with the scanner driver.
Contains the events needed to define and implement the scanner protocol.
Higher level data type storing the configuration details of the scanner like scanner IP,...
psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Jun 22 2024 02:46:12