Closed fennma67764 closed 1 year ago
bump
bump
I'm not familiar with this code base or the finer points of C++ , but changing make_def.inc line 129 to read:
CWARN = -Wall -Wno-narrowing
seems to fix the issue (tested against master branch at 2022-11-13 commit babe753f39f16f4c6a6dec2c33b4ed541ca0e502)
I was able to compile after adding -Wno-narrowing
to add_compile_options(-Wall -Wextra -Wpedantic -Wno-narrowing)
and changing declare_parameters
to new ROS Humble spec. After compilation, the library still does not connect to the RPLidar, so I had to stick using https://github.com/babakhani/rplidar_ros2/tree/master
I solved it by changing the return type of the wait function to int in rplidar_ros/sdk/src/hal/event.h because unsigned long has a conflict with EVENT_TIMEOUT type which is of Event enum and is equal to -1, therefore, we should remove the unsigned and also there is no need to define it as long too and int is adequate for our need. I created a PR to fix this : #101
2 problems of data types : src/sl_lidar_driver.cpp:556:34: error: narrowing conversion of ‘rp::hal::Event::EVENT_TIMEOUT’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing] is solved by adding an explicit cast in the file sl_lidar_driver.cpp line 556 :
case (long unsigned int)rp::hal::Event::EVENT_TIMEOUT: case (long unsigned int)rp::hal::Event::EVENT_OK:
src/arch/linux/net_socket.cpp:170:15: error: ordered comparison of pointer with integer zero (‘const char*’ and ‘int’) is solved by adding an explicit cast in the file net_socket.cpp line 170 :
return (ans<=(const char *)0)?RESULT_OPERATION_FAIL:RESULT_OK;
A PR that fixes this has been merged. #101
catkin build and catkin_make lead to the following Error Message:
What is the issue here?