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
14 stars 33 forks source link

print error when using sicknano #8

Closed rdtfyg closed 2 years ago

rdtfyg commented 3 years ago

my sicknano running for hours without any error, but after printing the error below, my callbackfunction can't receive laser data anymore and I must restart the program. here is the two times issues log: one log is : 15:03:22 0257 info 797E # Command Method Acknowledged. 21:11:48 0850 error 79D7 # vector::_M_default_append

another log is : 08:59:41 0334 warning 6E35 # Skipping data, sizes do not match, actual size is smaller then expected size! If this occurs please report with a stacktrace if the driver crashes at some other place. 08:59:41 0334 warning 6E35 # Expected minimum size: 34175 08:59:41 0334 warning 6E35 # Actual size: 7315 08:59:41 0334 warning 6E35 # Skipping all data for this message. 08:59:41 0501 error 6E35 # std::bad_alloc

I failed to find where the log shows that " vector::_M_default_append" and "std::bad_alloc" so what happend to the ladar

here is my code: // Sensor IP and Port sick::types::ip_address_t sensor_ip = boost::asio::ip::address_v4::from_string(_laser_address); sick::types::port_t tcp_port{ _tcp_port };

// Prepare the CommSettings for Sensor streaming data
sick::datastructure::CommSettings comm_settings;
comm_settings.host_ip = boost::asio::ip::address_v4::from_string(_host_address);
comm_settings.host_udp_port = _upd_port;
// Start async receiving and processing of sensor data
// Create a sensor instance
sick::AsyncSickSafetyScanner safety_scanner_ts(sensor_ip, tcp_port, comm_settings, sick_callbackfuc);
safety_scanner_ts.run();
lenpuc commented 3 years ago

Hi, it appears that a non allocated memory address might be called. Could you build the driver with debug information and run it afterwards again.

cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j8
make install

Then best use gdb to run the program. If you then can provide a stacktrace from gdb I can determine where the driver crashes and try to fix this.

lenpuc commented 2 years ago

Closing this due to inactivity