Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
visionary::VisionaryDataStream Class Reference

#include <VisionaryDataStream.h>

Public Types

using ByteBuffer = std::vector< std::uint8_t >
 

Public Member Functions

void close ()
 
std::shared_ptr< VisionaryDatagetDataHandler ()
 
bool getNextFrame ()
 
bool isConnected () const
 
bool open (const std::string &hostname, std::uint16_t port, std::uint32_t timeoutMs=5000u)
 
bool open (std::unique_ptr< ITransport > &pTransport)
 
void setDataHandler (std::shared_ptr< VisionaryData > dataHandler)
 
bool syncCoLa () const
 
 VisionaryDataStream (std::shared_ptr< VisionaryData > dataHandler)
 
 ~VisionaryDataStream ()
 

Private Member Functions

bool parseSegmentBinaryData (const ByteBuffer::iterator itBuf, std::size_t bufferSize)
 

Private Attributes

std::shared_ptr< VisionaryDatam_dataHandler
 
std::unique_ptr< ITransportm_pTransport
 

Detailed Description

Definition at line 14 of file VisionaryDataStream.h.

Member Typedef Documentation

◆ ByteBuffer

using visionary::VisionaryDataStream::ByteBuffer = std::vector<std::uint8_t>

Definition at line 17 of file VisionaryDataStream.h.

Constructor & Destructor Documentation

◆ VisionaryDataStream()

visionary::VisionaryDataStream::VisionaryDataStream ( std::shared_ptr< VisionaryData dataHandler)

Definition at line 17 of file VisionaryDataStream.cpp.

◆ ~VisionaryDataStream()

visionary::VisionaryDataStream::~VisionaryDataStream ( )

Definition at line 22 of file VisionaryDataStream.cpp.

Member Function Documentation

◆ close()

void visionary::VisionaryDataStream::close ( )

Close a connection

Closes the connection. It is allowed to call close of a connection that is not open. In this case this call is a no-op.

Definition at line 49 of file VisionaryDataStream.cpp.

◆ getDataHandler()

std::shared_ptr< VisionaryData > visionary::VisionaryDataStream::getDataHandler ( )

Gets the data handler

Return values
thedataHandler

Definition at line 208 of file VisionaryDataStream.cpp.

◆ getNextFrame()

bool visionary::VisionaryDataStream::getNextFrame ( )

Definition at line 82 of file VisionaryDataStream.cpp.

◆ isConnected()

bool visionary::VisionaryDataStream::isConnected ( ) const

Checks if connection is established

Attention
To check if the connection is estabilished data has to be sent to the camera which means this is a costly operation. Should only be used when get getNextFrame fails.
Return values
trueThe connection to the sensor is established.
falseThe connection to the sensor is lost. A reconnection by calling close + open is necessary.

Definition at line 218 of file VisionaryDataStream.cpp.

◆ open() [1/2]

bool visionary::VisionaryDataStream::open ( const std::string &  hostname,
std::uint16_t  port,
std::uint32_t  timeoutMs = 5000u 
)

Opens a connection to a Visionary sensor

Parameters
[in]hostnamename or IP address of the Visionary sensor.
[in]portcontrol command port of the sensor, usually 2112 for CoLa-B or 2122 for CoLa-2 (given in host-byte order).
[in]timeoutMscontrols the socket timeout, default 5000ms
Return values
trueThe connection to the sensor successfully was established.
falseThe connection attempt failed; the sensor is either
  • switched off or has a different IP address or name
  • not available using for PCs network settings (different subnet)
  • the protocol type or the port did not match. Please check your sensor documentation.

Definition at line 27 of file VisionaryDataStream.cpp.

◆ open() [2/2]

bool visionary::VisionaryDataStream::open ( std::unique_ptr< ITransport > &  pTransport)

Sets a socket used for the connection to a Visionary sensor The socket must already be ready to use and opened.

Parameters
[in]pTransportthe socket
Return values
trueSocket has been set

Definition at line 43 of file VisionaryDataStream.cpp.

◆ parseSegmentBinaryData()

bool visionary::VisionaryDataStream::parseSegmentBinaryData ( const ByteBuffer::iterator  itBuf,
std::size_t  bufferSize 
)
private

Definition at line 131 of file VisionaryDataStream.cpp.

◆ setDataHandler()

void visionary::VisionaryDataStream::setDataHandler ( std::shared_ptr< VisionaryData dataHandler)

Sets a new data handler

Parameters
[in]dataHandlera Datahandler.

Definition at line 213 of file VisionaryDataStream.cpp.

◆ syncCoLa()

bool visionary::VisionaryDataStream::syncCoLa ( ) const

Definition at line 58 of file VisionaryDataStream.cpp.

Member Data Documentation

◆ m_dataHandler

std::shared_ptr<VisionaryData> visionary::VisionaryDataStream::m_dataHandler
private

Definition at line 78 of file VisionaryDataStream.h.

◆ m_pTransport

std::unique_ptr<ITransport> visionary::VisionaryDataStream::m_pTransport
private

Definition at line 79 of file VisionaryDataStream.h.


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


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 04:38:18