SICKAG / sick_safetyscanners_base

CPP (C++) Driver for SICK safety laser scanners
https://www.sick.com/de/en/opto-electronic-protective-devices/safety-laser-scanners/c/g187225
Apache License 2.0
12 stars 32 forks source link

'Synchronous Client' example in README.md appears to be broken #5

Closed scotthea-amazon closed 3 years ago

scotthea-amazon commented 3 years ago

Hello,

I have tried building the 'Synchronous Client' example from README.md. I ran into a couple of minor errors that I was able to address, but the following line fails to compile because the constructor has been deleted: auto safety_scanner = sick::SyncSickSafetyScanner(sensor_ip, tcp_port, comm_settings); Can someone explain how the 'Synchronous Client' case is supposed to work with the constructor deleted?

puck-fzi commented 3 years ago

Hi, thanks for bringing this to my attention. Yes the copy constructor was deleted on purpose. Possible ways to create an instance would be (with the first being the preferred way):

auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);
sick::SyncSickSafetyScanner safety_scanner(sensor_ip, tcp_port, comm_settings);

I'll adjust the readme for the examples.

puck-fzi commented 3 years ago

Readme is updated

scotthea-amazon commented 3 years ago

Thank you for the quick update! It was very helpful.