micro-ROS / micro-ROS_moveit2_demo

Provides a demo of micro-ROS and MoveIt2 based on ST Disco L475 IOT01 board IMU sensors.
22 stars 4 forks source link

Colcon Build Fail with latest version of Moveit2 #9

Open Kelly-Coffey opened 3 years ago

Kelly-Coffey commented 3 years ago

Issue template

Steps to reproduce the issue

Reproduce the steps for the MoveIt 2 + micro-ROS demo https://github.com/micro-ROS/micro-ROS_moveit2_demo

Expected behavior

After confirming Moveit is properly installed upon installing the micro-ROS_moveit2_demo from git I would expect the build to succeed.

Actual behavior

Colcon build fails with....

ubu@ubu:~/microros_Zephyr_ws$ colcon build --event-handlers desktop_notification- status- --packages-select microros_moveit2_demo --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
Starting >>> microros_moveit2_demo
[Processing: microros_moveit2_demo]
--- stderr: microros_moveit2_demo
CMake Warning at /home/ubu/ws_moveit2/install/moveit_servo/share/moveit_servo/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
  Package 'moveit_servo' exports library 'export_moveit_servo' which couldn't
  be found
Call Stack (most recent call first):
  /home/ubu/ws_moveit2/install/moveit_servo/share/moveit_servo/cmake/moveit_servoConfig.cmake:41 (include)
  CMakeLists.txt:26 (find_package)

/home/ubu/microros_Zephyr_ws/micro-ROS_moveit2_demo/src/microros_moveit2servo_demo.cpp:47:10: fatal error: moveit_servo/servo_parameters.cpp: No such file or directory
   47 | #include <moveit_servo/servo_parameters.cpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/microros_moveit2servo_demo.dir/build.make:63: CMakeFiles/microros_moveit2servo_demo.dir/src/microros_moveit2servo_demo.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/microros_moveit2servo_demo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/ubu/microros_Zephyr_ws/micro-ROS_moveit2_demo/src/microros_moveit2_demo.cpp: In lambda function:
/home/ubu/microros_Zephyr_ws/micro-ROS_moveit2_demo/src/microros_moveit2_demo.cpp:34:74: warning: unused parameter ‘msg’ [-Wunused-parameter]
   34 |     auto trigger_callback = [this](const std_msgs::msg::Empty::SharedPtr msg) -> void
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
make: *** [Makefile:141: all] Error 2
---
Failed   <<< microros_moveit2_demo [35.4s, exited with code 2]

Summary: 0 packages finished [35.6s]
  1 package failed: microros_moveit2_demo
  1 package had stderr output: microros_moveit2_demo

Thank you Kelly

Kelly-Coffey commented 3 years ago

Once I hard code all the missing includes I get to the same build issue as described in issue #4

pablogs9 commented 3 years ago

Could you open a PR with the missing headers?

Kelly-Coffey commented 3 years ago

The changes are in two repos. Let me know if you want me to create PRs for both, I can.

,,, From micro-ROS/micro-ROS_moveit2_demo The file changes are in src/microros_moveit2servo_demo.cpp /*****/ /* Title : servo_cpp_interface_demo.cpp

// ROS

include <rclcpp/rclcpp.hpp>

include <tf2_msgs/msg/tf_message.hpp>

include <std_msgs/msg/empty.hpp>

// Servo //#include <moveit_servo/servo_parameters.cpp>

include </home/ubu/ws_moveit2/src/moveit2/moveit_ros/moveit_servo/src/servo_parameters.cpp>

//#include <moveit_servo/servo.h>

include </home/ubu/ws_moveit2/install/moveit_servo/include/moveit_servo/servo.h>

include <moveit/planning_scene_monitor/planning_scene_monitor.h>

... Using a ROS 2 Foxy installation install MoveIt2 The file changes are in /home/ubu/ws_moveit2/src/moveit2/moveit_ros/moveit_servo/src/servo_parameters.cpp

*****/

/ Author : Adam Pettinger Desc : Declares, loads, and checks ServoParameters for Servo Title : servo_parameters.cpp Project : moveit_servo Created : 07/02/2020 /

include

include <rclcpp/rclcpp.hpp>

//#include <moveit_servo/servo_parameters.h>

include </home/ubu/ws_moveit2/install/moveit_servo/include/moveit_servo/servo_parameters.h>

pablogs9 commented 3 years ago

yes please open a PR with the fix

Kelly-Coffey commented 3 years ago

OK, I will get it done this weekend.

Kelly-Coffey commented 3 years ago

I have create the PR for this repo. I have not created the PR for the ros-planning/moveit2 yet but everything is staged at https://github.com/Kelly-Coffey/moveit2 Thanks

Kelly-Coffey commented 3 years ago

I just checked and it looks like MoveIt2 fixed their build as this build issue (missing header files) does not occur any longer. I am going to close. I'll close the PR I created too.

Kelly-Coffey commented 3 years ago

I see you have merged by hard code to headers so of course it works on my system. Reopening.

pablogs9 commented 3 years ago

I have been trying to solve this, but the executable cannot find the moveit_servo includes. I have the moveit_servo included as ament_target_dependencies. @Kelly-Coffey do you have any idea?

Kelly-Coffey commented 3 years ago

I don't know either. I will work on identifying what could be the issue. I am a novice with Moveit2. I will let you know once I have exhausted all my debugging ideas. I am planning to use Moveit2 to send ros commands to my MicroROS node, so I need to spend the time learning Moveit2.

pablogs9 commented 3 years ago

Cool, thanks a lot.

Kelly-Coffey commented 3 years ago

After "commit Fix EXPORT install in CMake" (https://github.com/ros-planning/moveit2/pull/372)
I am able to the reproduce error of not found moveit_servor include files. Prior to this commit the executable can find the include files during the build.

I don't know what exactly is broken, but the following amentexport... commands ament_export_include_directories(include) ament_export_libraries(${SERVO_LIB_NAME}) ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})

were move from the bottom of up to the install section in /home/.../ws_moveit2/src/moveit2/moveit_ros/moveit_servo/CMakeLists.txt

once I put them back at the bottom (an left the same command in the install section) the include files are found my the executable.

henningkayser commented 3 years ago

@Kelly-Coffey I've just noticed this issue by coincidence. Could you confirm if https://github.com/ros-planning/moveit2/pull/448 fixes your problem?