SICKAG / sick_safetyscanners

ROS 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
61 stars 59 forks source link

Probem reading data from MicroScan 3 using C++ API on Linux #123

Closed geofftreen closed 1 year ago

geofftreen commented 1 year ago

I have followed the directions and am able to connect and communicate with the sensor. I can send a findSensor API command, and I can see the MicroScan 3 blink multicolor lights in response. However, when I attempt to upload sensor settings (triggered by a SyncSickSafetyScanner object creation or calling changeSensorSettings directly), I get an error ("Command Method Not Accepted"). Here is my code:

std::string sensor_ip_str = "192.168.1.186" ;
sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(sensor_ip_str);
sick::types::port_t tcp_port {2122};

// Prepare the CommSettings for Sensor streaming data
sick::datastructure::CommSettings comm_settings;
std::string host_ip_str = "192.168.1.100" ;
comm_settings.host_ip = boost::asio::ip::address_v4::from_string(host_ip_str);
comm_settings.host_udp_port = 0;
comm_settings.e_interface_type = sick::datastructure::E_ETHERNET_IP;

cout << "Creating a safety scanner" << endl ;
// Create a sensor instance
auto safety_scanner = std::make_unique<sick::SyncSickSafetyScanner>(sensor_ip, tcp_port, comm_settings);

Furthermore, calls to receive data packets time out with nothing received. In fact, the error I'm seeing seems similar to this unsolved issue raised on the Github repo: https://github.com/SICKAG/sick_safetyscanners/issues/23.

I am working in Linux using Ubuntu 20.04. I am able to run Safety Designer in Windows and see the scan data.

Thanks in advance.

lenpuc commented 1 year ago

Hi, thanks for raising the issue, are you using the ros driver? or are you using the CPP driver (https://github.com/SICKAG/sick_safetyscanners_base) instead?

If you are using the ROS driver, could you try setting the parameter in the launch file? The return you are getting sounds like the settings you are passing to the sensor are rejected by your sensor itself. What is the sensor model you are using?

lenpuc commented 1 year ago

Closing, since its probably in the wrong repo. If this is still an issue, please reopen in the correct repo