Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build problem for actual robot #5

Open
y-masutani opened this issue Feb 9, 2024 · 2 comments
Open

Build problem for actual robot #5

y-masutani opened this issue Feb 9, 2024 · 2 comments

Comments

@y-masutani
Copy link

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?

@yulat214
Copy link

yulat214 commented Feb 9, 2024

Hi. I had the same problem.

It seems that openni2_camera only supports humble and later.
I solved this by going back to the commit where openni2_camera supports foxy.

Since foxy is already EOL, I don't think openni2_camera is even going to support it.
The only solution seems to be to support HSR's Humble.

@y-masutani
Copy link
Author

Thank you for your comment.

I think it would be best to be able to install Ubuntu 22.04 and ROS Humble on HSR.

The next best solution is to fork the openni2_camera repository and provide a ready-to-build version for ROS Foxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants