Open Starrah opened 1 year ago
(您好,我看到您是在noetic版本上运行的[rs_to_velodyne],由于我也是在noetic版本上进行的,但我在编译的过程中有些问题(警告),我截取了部分如下:) Hello, I noticed that you are running [rs_to_velodyne] on the noetic version. As I was also running on the noetic version, there were some issues (warnings) during the compilation process. I have taken a screenshot as follows: usr/include/pcl-1.10/pcl/pcl_macros.h:92:9: note: declared here
92 | using uint8_t [[deprecated("use std::uint8_t instead of pcl::uint8_t")]] = std::uint8_t;
| ^~~
/opt/ros/noetic/include/ros/console.h:575:35: note: in expansion of macro ‘ROS_LOG_COND’
575 | #define ROS_LOG(level, name, ...) ROS_LOG_COND(true, level, name, VA_ARGS)
| ^~~~
/opt/ros/noetic/include/rosconsole/macros_generated.h:214:24: note: in expansion of macro ‘ROS_LOG’
214 | #define ROS_ERROR(...) ROS_LOG(::ros::console::levels::Error, ROSCONSOLE_DEFAULT_NAME, VA_ARGS)
| ^~~
/home/car/workspace_rslidar/src/rs_to_velodyne-master/src/rs_to_velodyne.cpp:213:13: note: in expansion of macro ‘ROS_ERROR’
(请问有什么方法能解决吗) Is there any way to solve it
The code failed to compile on ROS Noetic (Ubuntu 20.04). The error is about PCL, seems like below:
This is because the C++ standard version specified in
CMakeLists.txt
is C++11, which is too low to compile on Noetic's g++ compiler. https://github.com/HViktorTsoi/rs_to_velodyne/blob/564dbbbce2a8fd61f5ecc0d51dac8185d2381d94/CMakeLists.txt#L4Upgrade the C++ standard version to C++14 can solve the problem. Just change the line above into:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -O3")
In my machine (ROS Noetic, Ubuntu 20.04, amd64), this can resolve the problem. (Note that you should clean the build (
rm -rf build/ devel/
) between making the change and runningcatkin_make
again.)However, I don't know whether this change will make the code fail to compile on earlier ROS distributions (Kinetic 16.04, etc). So I'm hesitating raising a PR, instead just raise this issue as a reminder to Noetic users. If we make sure this will not introduce bug on earlier distributions, we may consider merge the change into master.
Besides, I also suggest @HViktorTsoi to add some reminder sentences on the README.md, linking to this issue, to remind other Noetic users.