ROS2 setup issue
Hello!
I'm following the ROS2 setup tutorial for AR4 but run into issue at step 7. Build the Workspace.
I'm running Ubuntu 24.04 on VMWare. The previous steps were successful.
However, at step 7, the terminal shows stderr: ar4_moveit_cpp_demo
CMake Error: File /home/.../example_files/package.xml does not exist
Summary showed
Failed ar4_moveit_cpp_demo package, exited with code 1
Aborted annin_ar4driver
Please let me know if there was something I could do to address this.
Thank you!
In the AR4 ROS driver repo, “example_files/” is only a reference folder (it is not a ROS package and does not contain a package.xml). The demo package must be created in your workspace src folder as a sibling of the ar4_ros_driver repo.
Please try this:
1) From your workspace, confirm what colcon thinks the packages are:
cd ~/ros2_ws
colcon list
2) If you see anything like a package rooted in “…/example_files”, either:
- move/remove that folder from your workspace src path, OR
- add a COLCON_IGNORE file so colcon skips it:
touch ~/ros2_ws/src/ar4_ros_driver/example_files/COLCON_IGNORE
3) If you want the C++ demo node, re-create it in the correct location (do NOT put it inside example_files):
cd ~/ros2_ws/src
rm -rf ar4_moveit_cpp_demo
ros2 pkg create ar4_moveit_cpp_demo --build-type ament_cmake \
--dependencies rclcpp moveit_ros_planning_interface
Then copy the example file (simple_pick_place_mgi.cpp) into:
~/ros2_ws/src/ar4_moveit_cpp_demo/src/
and replace ONLY the CMakeLists.txt in:
~/ros2_ws/src/ar4_moveit_cpp_demo/
(leave the generated package.xml in place)
4) Clean and rebuild:
cd ~/ros2_ws
rm -rf build install log
colcon build
source install/setup.bash
After that, the build should complete and the driver package should no longer abort.
Never mind! Turns out COLCON_IGNORE was missing from example_files folder . I created a blank text file and renamed it. Seems to be working so please ignore the post .
Thank you