Open
Description
I am trying to install according to the "Actual Robot" section, and I needed to run the following command to resolve the rosdep
error.
sudo apt install ros-foxy-xacro ros-foxy-camera-info-manager ros-foxy-usb-cam \
ros-foxy-transmission-interface ros-foxy-realtime-tools ros-foxy-joint-trajectory-controller \
ros-foxy-joint-state-publisher-gui ros-foxy-urg-node ros-foxy-joint-state-broadcaster \
ros-foxy-depth-image-proc ros-foxy-controller-manager
After that, I then executed colcon build
, but got the following error
--- stderr: openni2_camera
CMake Error at CMakeLists.txt:73 (rosidl_get_typesupport_target):
Unknown CMake command "rosidl_get_typesupport_target".
It seems that rosidl_get_typesupport_target is not available in ROS Foxy.
I changed the relevant part of CMakeLists.txt as follows.
# rosidl_get_typesupport_target(cpp_typesupport_target
# ${PROJECT_NAME} "rosidl_typesupport_cpp")
# target_link_libraries(openni2_camera_lib "${cpp_typesupport_target}")
rosidl_target_interfaces(openni2_camera_lib
${PROJECT_NAME} "rosidl_typesupport_cpp")
After the above correction, I faced the following error
--- stderr: openni2_camera
/home/masutani/hsr_ros2_ws/openni2_camera/openni2_camera/src/openni2_device_manager.cpp: In member function 'virtual void openni2_wrapper::OpenNI2DeviceListener::onDeviceConnected(const openni::DeviceInfo*)':
/home/masutani/hsr_ros2_ws/openni2_camera/openni2_camera/src/openni2_device_manager.cpp:109:21: error: missing template arguments before 'l'
109 | std::lock_guard l(device_mutex_);
| ^
omitting the rest
Argument deduction of C++ class templates can be used only since C++17.
So I changed CMakeLists.txt as follows
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
Then the build was complete.
Are the above solutions correct? How did other people deal with these problems?
Furthermore, openni2_camera is not developed by HSR project. What should we do?
Metadata
Metadata
Assignees
Labels
No labels