SICKAG / sick_scan_xd

Based on the sick_scan drivers for ROS1, sick_scan_xd merges sick_scan, sick_scan2 and sick_scan_base repositories. The driver supports both Linux (native, ROS1, ROS2) and Windows (native and ROS2).
Apache License 2.0
89 stars 81 forks source link

[Error]: ## ERROR parseLaunchfileSetParameter(): Tag-Value setting not valid. #355

Open maurizioscolasipi opened 1 week ago

maurizioscolasipi commented 1 week ago

Good morning, I have a problem opening Sick LMS4000 laser: SickScanApiInitByCli return 0, but I think there's a problem parsing the xml file. (The xml file is ok because I tested it using the original example and it works well). I attach the solution. Could you help me? Thank you Maurizio

cpp.zip

rostest commented 1 week ago

Thanks for your feedback! We could reproduce that error. The arguments provided by argv is allocated on the stack and immediately freed after SickScanApiInitByCli, but still used for parsing in the background. We will correct this behaviour by creating a deep copy of the argv arguments and provide an update.

In the meantime, please replace argv in your file laserSick.cpp line 141 by a static variable: static char* argv[2]; This way the memory in argv remains intact until the lidar is completely initialized.

maurizioscolasipi commented 6 days ago

ok, using "static char* argv[2]" it works! Thank you