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

#include <VisionaryControl.h>

Public Types

enum  ProtocolType { INVALID_PROTOCOL = -1, COLA_A = 2111, COLA_B = 2112, COLA_2 = 2122 }
 The numbers used for the protocols are the port numbers. More...
 

Public Member Functions

bool burstAcquisition (uint16_t burstLen)
 Start streaming a burst of data by calling the "PLAYBURST" method on the device. Works only when acquisition is stopped. More...
 
void close ()
 
uint16_t GetBlobPort ()
 Get blob port address. More...
 
bool getDataStreamConfig ()
 Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig. More...
 
std::string getDeviceIdent ()
 Get device information by calling the "DeviceIdent" method on the device. More...
 
bool login (IAuthentication::UserLevel userLevel, const std::string &password)
 
bool logout ()
 Logout from the device. More...
 
bool open (ProtocolType type, const std::string &hostname, uint32_t sessionTimeout_ms=kSessionTimeout_ms, bool autoReconnect=true, uint32_t connectTimeout_ms=kSessionTimeout_ms)
 
CoLaCommand sendCommand (const CoLaCommand &command)
 Send a CoLaBCommand to the device and waits for the result. More...
 
bool startAcquisition ()
 Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition is stopped. More...
 
bool stepAcquisition ()
 Trigger a single image on the device. Works only when acquisition is stopped. More...
 
bool stopAcquisition ()
 Stops the data stream. Works always, also when acquisition is already stopped before. More...
 
 VisionaryControl ()
 
 ~VisionaryControl ()
 

Static Public Attributes

static constexpr uint32_t kSessionTimeout_ms = 5000
 Default session timeout. More...
 

Private Member Functions

CoLaCommand receiveCoLaCommand ()
 
std::string receiveCoLaResponse ()
 

Private Attributes

bool m_autoReconnect
 
uint32_t m_connectTimeout_ms
 
std::string m_hostname
 
std::unique_ptr< IAuthenticationm_pAuthentication
 
std::unique_ptr< ControlSessionm_pControlSession
 
std::unique_ptr< IProtocolHandlerm_pProtocolHandler
 
ProtocolType m_protocolType
 
std::unique_ptr< TcpSocketm_pTransport
 
uint32_t m_sessionTimeout_ms
 

Detailed Description

Definition at line 19 of file VisionaryControl.h.

Member Enumeration Documentation

◆ ProtocolType

The numbers used for the protocols are the port numbers.

Enumerator
INVALID_PROTOCOL 
COLA_A 
COLA_B 
COLA_2 

Definition at line 23 of file VisionaryControl.h.

Constructor & Destructor Documentation

◆ VisionaryControl()

visionary::VisionaryControl::VisionaryControl ( )

Definition at line 22 of file VisionaryControl.cpp.

◆ ~VisionaryControl()

visionary::VisionaryControl::~VisionaryControl ( )
default

Member Function Documentation

◆ burstAcquisition()

bool visionary::VisionaryControl::burstAcquisition ( uint16_t  burstLen)

Start streaming a burst of data by calling the "PLAYBURST" method on the device. Works only when acquisition is stopped.

Returns
True if successful, false otherwise.

Definition at line 158 of file VisionaryControl.cpp.

◆ close()

void visionary::VisionaryControl::close ( )

Close a connection

Closes the control 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 110 of file VisionaryControl.cpp.

◆ GetBlobPort()

uint16_t visionary::VisionaryControl::GetBlobPort ( )

Get blob port address.

Returns
Blob port, typically 2114.

Definition at line 223 of file VisionaryControl.cpp.

◆ getDataStreamConfig()

bool visionary::VisionaryControl::getDataStreamConfig ( )

Tells the device that there is a streaming channel by invoking a method named GetBlobClientConfig.

Returns
True if successful, false otherwise.

Definition at line 193 of file VisionaryControl.cpp.

◆ getDeviceIdent()

std::string visionary::VisionaryControl::getDeviceIdent ( )

Get device information by calling the "DeviceIdent" method on the device.

Returns
True if successful, false otherwise.

Definition at line 143 of file VisionaryControl.cpp.

◆ login()

bool visionary::VisionaryControl::login ( IAuthentication::UserLevel  userLevel,
const std::string &  password 
)

Login to the device.

Parameters
[in]userLevelThe user level to login as.
[in]passwordPassword for the selected user level.
Returns
error code, 0 on success

Definition at line 133 of file VisionaryControl.cpp.

◆ logout()

bool visionary::VisionaryControl::logout ( )

Logout from the device.

Returns
True if logout was successful, false otherwise.

Definition at line 138 of file VisionaryControl.cpp.

◆ open()

bool visionary::VisionaryControl::open ( ProtocolType  type,
const std::string &  hostname,
uint32_t  sessionTimeout_ms = kSessionTimeout_ms,
bool  autoReconnect = true,
uint32_t  connectTimeout_ms = kSessionTimeout_ms 
)

Opens a connection to a Visionary sensor

Parameters
[in]typeprotocol type the sensor understands (CoLa-A, CoLa-B or CoLa-2). This information is found in the sensor documentation.
[in]hostnamename or IP address of the Visionary sensor.
[in]sessionTimeout_msTimeout for Session (only used for Cola2)
[in]autoReconnectAuto reconnect when connection was lost
[in]connectTimeout_msTimeout for Connection
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 29 of file VisionaryControl.cpp.

◆ receiveCoLaCommand()

CoLaCommand visionary::VisionaryControl::receiveCoLaCommand ( )
private

◆ receiveCoLaResponse()

std::string visionary::VisionaryControl::receiveCoLaResponse ( )
private

◆ sendCommand()

CoLaCommand visionary::VisionaryControl::sendCommand ( const CoLaCommand command)

Send a CoLaBCommand to the device and waits for the result.

Parameters
commandCommand to send
Returns
The response.

Definition at line 201 of file VisionaryControl.cpp.

◆ startAcquisition()

bool visionary::VisionaryControl::startAcquisition ( )

Start streaming the data by calling the "PLAYSTART" method on the device. Works only when acquisition is stopped.

Returns
True if successful, false otherwise.

Definition at line 168 of file VisionaryControl.cpp.

◆ stepAcquisition()

bool visionary::VisionaryControl::stepAcquisition ( )

Trigger a single image on the device. Works only when acquisition is stopped.

Returns
True if successful, false otherwise.

Definition at line 177 of file VisionaryControl.cpp.

◆ stopAcquisition()

bool visionary::VisionaryControl::stopAcquisition ( )

Stops the data stream. Works always, also when acquisition is already stopped before.

Definition at line 185 of file VisionaryControl.cpp.

Member Data Documentation

◆ kSessionTimeout_ms

constexpr uint32_t visionary::VisionaryControl::kSessionTimeout_ms = 5000
staticconstexpr

Default session timeout.

Definition at line 32 of file VisionaryControl.h.

◆ m_autoReconnect

bool visionary::VisionaryControl::m_autoReconnect
private

Definition at line 134 of file VisionaryControl.h.

◆ m_connectTimeout_ms

uint32_t visionary::VisionaryControl::m_connectTimeout_ms
private

Definition at line 133 of file VisionaryControl.h.

◆ m_hostname

std::string visionary::VisionaryControl::m_hostname
private

Definition at line 131 of file VisionaryControl.h.

◆ m_pAuthentication

std::unique_ptr<IAuthentication> visionary::VisionaryControl::m_pAuthentication
private

Definition at line 127 of file VisionaryControl.h.

◆ m_pControlSession

std::unique_ptr<ControlSession> visionary::VisionaryControl::m_pControlSession
private

Definition at line 128 of file VisionaryControl.h.

◆ m_pProtocolHandler

std::unique_ptr<IProtocolHandler> visionary::VisionaryControl::m_pProtocolHandler
private

Definition at line 126 of file VisionaryControl.h.

◆ m_protocolType

ProtocolType visionary::VisionaryControl::m_protocolType
private

Definition at line 130 of file VisionaryControl.h.

◆ m_pTransport

std::unique_ptr<TcpSocket> visionary::VisionaryControl::m_pTransport
private

Definition at line 125 of file VisionaryControl.h.

◆ m_sessionTimeout_ms

uint32_t visionary::VisionaryControl::m_sessionTimeout_ms
private

Definition at line 132 of file VisionaryControl.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