Public Member Functions | Private Member Functions | Private Attributes | List of all members
psen_scan::Scanner Class Reference

Class for Modeling a PSENscan safety laser scanner. More...

#include <scanner.h>

Inheritance diagram for psen_scan::Scanner:
Inheritance graph
[legend]

Public Member Functions

LaserScan getCompleteScan ()
 Reads from UDP Interface until complete laserscan object can be formed. More...
 
 Scanner (const std::string &scanner_ip, const uint32_t &host_ip, const uint32_t &host_udp_port, const std::string &password, const PSENscanInternalAngle &angle_start, const PSENscanInternalAngle &angle_end, std::unique_ptr< ScannerCommunicationInterface > communication_interface)
 Construct a new Scanner:: Scanner object. More...
 
void start ()
 Send start signal to Laserscanner. More...
 
void stop ()
 Send stop signal to Laserscanner. More...
 
- Public Member Functions inherited from psen_scan::vScanner
virtual ~vScanner ()=default
 

Private Member Functions

MonitoringFrame fetchMonitoringFrame (std::chrono::steady_clock::duration timeout)
 Gets one MonitoringFrame from Laserscanner. More...
 
bool isDiagnosticInformationOk (const DiagnosticInformation &diag_info)
 Checks if DiagnosticInformation Bitfield contains no errors. More...
 
bool parseFields (const MonitoringFrame &monitoring_frame)
 Parses a MonitoringFrame to check whether all fields are as expected. More...
 

Private Attributes

PSENscanInternalAngle angle_end_
 
PSENscanInternalAngle angle_start_
 
std::unique_ptr< ScannerCommunicationInterfacecommunication_interface_
 
MonitoringFrame previous_monitoring_frame_
 
std::string scanner_ip_
 
StartMonitoringFrame start_monitoring_frame_
 
StopMonitoringFrame stop_monitoring_frame_
 

Detailed Description

Class for Modeling a PSENscan safety laser scanner.

Definition at line 42 of file scanner.h.

Constructor & Destructor Documentation

◆ Scanner()

psen_scan::Scanner::Scanner ( const std::string &  scanner_ip,
const uint32_t &  host_ip,
const uint32_t &  host_udp_port,
const std::string &  password,
const PSENscanInternalAngle angle_start,
const PSENscanInternalAngle angle_end,
std::unique_ptr< ScannerCommunicationInterface communication_interface 
)

Construct a new Scanner:: Scanner object.

Parameters
scanner_ipIP-Adress of Laserscanner
host_ipIP-Adress of host machine
host_udp_portUDP Port on which packets from Laserscanner should be received
passwordPassword for Laserscanner
angle_startStart angle of Laserscanner measurements in tenths of degree
angle_endEnd angle of Laserscanner measurements in tenths of degree
communication_interfacePointer to the communication interface

Definition at line 53 of file scanner.cpp.

Member Function Documentation

◆ fetchMonitoringFrame()

MonitoringFrame psen_scan::Scanner::fetchMonitoringFrame ( std::chrono::steady_clock::duration  timeout)
private

Gets one MonitoringFrame from Laserscanner.

Returns
MonitoringFrame
Exceptions
FetchMonitoringFrameException

Definition at line 127 of file scanner.cpp.

◆ getCompleteScan()

LaserScan psen_scan::Scanner::getCompleteScan ( )
virtual

Reads from UDP Interface until complete laserscan object can be formed.

Returns
LaserScan Complete laserscan object
Exceptions
CoherentMonitoringFramesException

Implements psen_scan::vScanner.

Definition at line 306 of file scanner.cpp.

◆ isDiagnosticInformationOk()

bool psen_scan::Scanner::isDiagnosticInformationOk ( const DiagnosticInformation diag_info)
private

Checks if DiagnosticInformation Bitfield contains no errors.

Parameters
diag_infoDiagnosticInformation Bitfield to check
Returns
true DiagnosticInformation Bitfield contains no errors
false DiagnosticInformation Bitfield contains atleast one error
Exceptions
DiagnosticInformationException

Definition at line 193 of file scanner.cpp.

◆ parseFields()

bool psen_scan::Scanner::parseFields ( const MonitoringFrame monitoring_frame)
private

Parses a MonitoringFrame to check whether all fields are as expected.

Parameters
monitoring_frameMonitoringFrame to check
Returns
true Fields are ok
false At least one field is not ok
Exceptions
ParseMonitoringFrameException

Definition at line 159 of file scanner.cpp.

◆ start()

void psen_scan::Scanner::start ( )
virtual

Send start signal to Laserscanner.

Implements psen_scan::vScanner.

Definition at line 106 of file scanner.cpp.

◆ stop()

void psen_scan::Scanner::stop ( )
virtual

Send stop signal to Laserscanner.

Implements psen_scan::vScanner.

Definition at line 115 of file scanner.cpp.

Member Data Documentation

◆ angle_end_

PSENscanInternalAngle psen_scan::Scanner::angle_end_
private

End angle of Laserscanner measurements

Definition at line 62 of file scanner.h.

◆ angle_start_

PSENscanInternalAngle psen_scan::Scanner::angle_start_
private

Start angle of Laserscanner measurements

Definition at line 61 of file scanner.h.

◆ communication_interface_

std::unique_ptr<ScannerCommunicationInterface> psen_scan::Scanner::communication_interface_
private

Definition at line 64 of file scanner.h.

◆ previous_monitoring_frame_

MonitoringFrame psen_scan::Scanner::previous_monitoring_frame_
private

Buffer for incoming Laserscanner data

Definition at line 63 of file scanner.h.

◆ scanner_ip_

std::string psen_scan::Scanner::scanner_ip_
private

IP-Adress of Laserscanner

Definition at line 58 of file scanner.h.

◆ start_monitoring_frame_

StartMonitoringFrame psen_scan::Scanner::start_monitoring_frame_
private

Start Monitoring Command Frame

Definition at line 59 of file scanner.h.

◆ stop_monitoring_frame_

StopMonitoringFrame psen_scan::Scanner::stop_monitoring_frame_
private

Stop Monitoring Command Frame

Definition at line 60 of file scanner.h.


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


psen_scan
Author(s):
autogenerated on Mon Feb 28 2022 23:16:20