This is the implementation of the Scanner API defined by IScanner. More...
#include <scanner_v2.h>
Public Member Functions | |
ScannerV2 (const ScannerConfiguration &scanner_config, const LaserScanCallback &laser_scan_callback) | |
std::future< void > | start () override |
An exception is set in the returned future if the scanner start was not successful. More... | |
std::future< void > | stop () override |
An exception is set in the returned future if the scanner stop was not successful. More... | |
~ScannerV2 () override | |
Public Member Functions inherited from psen_scan_v2_standalone::IScanner | |
IScanner (const ScannerConfiguration &scanner_config, const LaserScanCallback &laser_scan_callback) | |
virtual | ~IScanner ()=default |
Private Types | |
using | OptionalPromise = boost::optional< std::promise< void > > |
Private Member Functions | |
void | scannerStartedCallback () |
void | scannerStartErrorCallback (const std::string &error_msg) |
void | scannerStopErrorCallback (const std::string &error_msg) |
void | scannerStoppedCallback () |
template<class T > | |
void | triggerEvent () |
template<class T > | |
void | triggerEventWithParam (const T &event) |
Private Attributes | |
std::mutex | member_mutex_ |
This Mutex protects ALL members of the Scanner against concurrent access. So far there exist at least the following threads, potentially causing concurrent access to the members: More... | |
OptionalPromise | scanner_has_started_ { boost::none } |
OptionalPromise | scanner_has_stopped_ { boost::none } |
std::unique_ptr< ScannerStateMachine > | sm_ |
Additional Inherited Members | |
Public Types inherited from psen_scan_v2_standalone::IScanner | |
using | LaserScanCallback = std::function< void(const LaserScan &)> |
Represents the user-provided callback for processing incoming scan data. More... | |
Protected Member Functions inherited from psen_scan_v2_standalone::IScanner | |
const ScannerConfiguration & | config () const |
const ScannerConfiguration & | getConfig () const |
const LaserScanCallback & | getLaserScanCallback () const |
const LaserScanCallback & | laserScanCallback () const |
This is the implementation of the Scanner API defined by IScanner.
The class ScannerV2 is responsible for the initialization of:
It uses the passed ScannerConfiguration for all configurable parts of this process.
The class creates two UdpClientImpl, a WatchdogFactory and passes them together with the LaserScanCallback to the scanner_protocol::ScannerStateMachine via scanner_protocol::StateMachineArgs.
Definition at line 60 of file scanner_v2.h.
|
private |
Definition at line 86 of file scanner_v2.h.
psen_scan_v2_standalone::ScannerV2::ScannerV2 | ( | const ScannerConfiguration & | scanner_config, |
const LaserScanCallback & | laser_scan_callback | ||
) |
Definition at line 41 of file scanner_v2.cpp.
|
override |
Definition at line 64 of file scanner_v2.cpp.
|
private |
Definition at line 111 of file scanner_v2.cpp.
|
private |
Definition at line 128 of file scanner_v2.cpp.
|
private |
Definition at line 135 of file scanner_v2.cpp.
|
private |
Definition at line 121 of file scanner_v2.cpp.
|
overridevirtual |
An exception is set in the returned future if the scanner start was not successful.
Implements psen_scan_v2_standalone::IScanner.
Definition at line 72 of file scanner_v2.cpp.
|
overridevirtual |
An exception is set in the returned future if the scanner stop was not successful.
Implements psen_scan_v2_standalone::IScanner.
Definition at line 90 of file scanner_v2.cpp.
|
private |
Definition at line 110 of file scanner_v2.h.
|
private |
Definition at line 103 of file scanner_v2.h.
|
private |
This Mutex protects ALL members of the Scanner against concurrent access. So far there exist at least the following threads, potentially causing concurrent access to the members:
Definition at line 97 of file scanner_v2.h.
|
private |
Definition at line 89 of file scanner_v2.h.
|
private |
Definition at line 90 of file scanner_v2.h.
|
private |
Definition at line 99 of file scanner_v2.h.