agile_autonomy
agile_autonomy copied to clipboard
Open3d not found while building catkin workspace
Environment: Ubuntu 20.04, ROS Noetic, CMake 3.16.3
I have installed ROS according to instructions from the official website (http://wiki.ros.org/noetic/Installation/Ubuntu) and followed your instructions line-by-line. However, the following error occurred when I tried catkin build
step.
Edit: tried to update cmake to 3.21 and build Open3D from sources, but it didn't help.
Would appreciate any help.
denis@denis-HP-ENVY-Laptop-15-ep0xxx:~/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros$ catkin build
---------------------------------------------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/noetic
Workspace: /home/denis/agile_autonomy_ws/catkin_aa
---------------------------------------------------------------------------------------------
Build Space: [exists] /home/denis/agile_autonomy_ws/catkin_aa/build
Devel Space: [exists] /home/denis/agile_autonomy_ws/catkin_aa/devel
Install Space: [unused] /home/denis/agile_autonomy_ws/catkin_aa/install
Log Space: [exists] /home/denis/agile_autonomy_ws/catkin_aa/logs
Source Space: [exists] /home/denis/agile_autonomy_ws/catkin_aa/src
DESTDIR: [unused] None
---------------------------------------------------------------------------------------------
Devel Space Layout: merged
Install Space Layout: None
---------------------------------------------------------------------------------------------
Additional CMake Args: -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-fdiagnostics-color
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
---------------------------------------------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
---------------------------------------------------------------------------------------------
Workspace configuration appears valid.
---------------------------------------------------------------------------------------------
[build] Found '71' packages in 0.0 seconds.
[build] Package table is up to date.
Starting >>> catkin_boost_python_buildtool
Starting >>> catkin_simple
Starting >>> decomp_util
Starting >>> mav_msgs
Starting >>> mav_state_machine_msgs
Starting >>> mav_system_msgs
Starting >>> motion_primitive_library
Starting >>> open3d_conversions
Finished <<< catkin_boost_python_buildtool [ 0.1 seconds ]
Finished <<< mav_state_machine_msgs [ 0.4 seconds ]
Starting >>> rotors_comm
Finished <<< catkin_simple [ 0.2 seconds ]
Finished <<< mav_system_msgs [ 0.5 seconds ]
Finished <<< mav_msgs [ 0.7 seconds ]
Starting >>> assimp_catkin
Starting >>> catkin_boost_python_buildtool_test
__________________________________________________________________________________________________________________________________________________________________________________________________________
Errors << open3d_conversions:make /home/denis/agile_autonomy_ws/catkin_aa/logs/open3d_conversions/build.make.006.log
In file included from /home/denis/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/src/open3d_conversions.cpp:15:0:
/home/denis/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/include/open3d_conversions/open3d_conversions.h:19:10: fatal error: Open3D/Open3D.h: No such file or directory
#include <Open3D/Open3D.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/open3d_conversions.dir/build.make:63: CMakeFiles/open3d_conversions.dir/src/open3d_conversions.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:305: CMakeFiles/open3d_conversions.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /home/denis/agile_autonomy_ws/catkin_aa/build/open3d_conversions; catkin build --get-env open3d_conversions | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -
I think that for your version of open3d you need to rename the include file of open3d to #include "open3d/Open3D.h"
. An example is here: https://github.com/isl-org/open3d-cmake-find-package/blob/master/Draw.cpp#L29.
Hope it helps!
I think that for your version of open3d you need to rename the include file of open3d to
#include "open3d/Open3D.h"
. An example is here: https://github.com/isl-org/open3d-cmake-find-package/blob/master/Draw.cpp#L29.Hope it helps!
Thank you for your answer!
It did work, but then I got stuck in the following error while building planning_ros_utils:
Errors << planning_ros_utils:make /home/denis/agile_autonomy_ws/catkin_aa/logs/planning_ros_utils/build.make.002.log
/home/denis/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp: In constructor ‘planning_rviz_plugins::MapDisplay::MapDisplay()’:
/home/denis/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp:39:52: error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’
update_nh_.setCallbackQueue(point_cloud_common_->getCallbackQueue());
^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/planning_rviz_plugins.dir/build.make:160: CMakeFiles/planning_rviz_plugins.dir/src/planning_rviz_plugins/map_display.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:360: CMakeFiles/planning_rviz_plugins.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Which version of rviz do you use and how can I install it?
$ rviz --v
$ [ INFO] [1634925235.339356078]: rviz version 1.13.3
$ [ INFO] [1634925235.339459957]: compiled against Qt version 5.9.5
$ [ INFO] [1634925235.339489131]: compiled against OGRE version 1.9.0 (Ghadamon)
This is a pretty old version, but with minimal changes it could also work with newest versions.
$ rviz --v $ [ INFO] [1634925235.339356078]: rviz version 1.13.3 $ [ INFO] [1634925235.339459957]: compiled against Qt version 5.9.5 $ [ INFO] [1634925235.339489131]: compiled against OGRE version 1.9.0 (Ghadamon)
This is a pretty old version, but with minimal changes it could also work with newest versions.
This is also what I am facing. So, I download the rviz-1.13.3 from their github, and put it in a new workspace without any changes. But it still has some errors. So,can u explain how to make changes to the rviz-1.13.3? Thanks a lot!
/home/xs/agile_autonomy_ws/Rviz/src/rviz-1.13.3/src/rviz/default_plugin/interactive_marker_display.cpp:120:103: error: no matching function for call to ‘interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::__cxx11::string)’
eractive_markers::InteractiveMarkerClient( *tf, fixed_frame_.toStdString() ) );
^
In file included from /home/xs/agile_autonomy_ws/Rviz/src/rviz-1.13.3/src/rviz/default_plugin/interactive_marker_display.h:43:0,
from /home/xs/agile_autonomy_ws/Rviz/src/rviz-1.13.3/src/rviz/default_plugin/interactive_marker_display.cpp:40:
/opt/ros/noetic/include/interactive_markers/interactive_marker_client.h:90:3: note: candidate: interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf2_ros::Buffer&, const string&, const string&)
InteractiveMarkerClient(tf2_ros::Buffer &tf,
^~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/noetic/include/interactive_markers/interactive_marker_client.h:90:3: note: no known conversion for argument 1 from ‘tf::Transformer’ to ‘tf2_ros::Buffer&’
[ 75%] Building CXX object rviz-1.13.3/src/rviz/default_plugin/CMakeFiles/rviz_default_plugin.dir/map_display.cpp.o
[ 75%] Building CXX object rviz-1.13.3/src/rviz/default_plugin/CMakeFiles/rviz_default_plugin.dir/marker_array_display.cpp.o
make[2]: *** [rviz-1.13.3/src/rviz/default_plugin/CMakeFiles/rviz_default_plugin.dir/build.make:245:rviz-1.13.3/src/rviz/default_plugin/CMakeFiles/rviz_default_plugin.dir/interactive_marker_display.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[1]: *** [CMakeFiles/Makefile2:2702:rviz-1.13.3/src/rviz/default_plugin/CMakeFiles/rviz_default_plugin.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
Invoking "make -j8 -l8" failed
@kelia maybe can have more insights on this
I think that for your version of open3d you need to rename the include file of open3d to
#include "open3d/Open3D.h"
. An example is here: https://github.com/isl-org/open3d-cmake-find-package/blob/master/Draw.cpp#L29.Hope it helps!
I have been stuck at the same error for 2 full days now but changing to #include "open3d/Open3D.h" has not solved the issue for me. I have tried
- downloading all the dependencies listed in Open3D page,
- changing Open3D installation directories
- renaming #include "open3d/Open3D.h.in" none of this have worked thus far.
- replacing open3d_conversions with the files found here : https://github.com/ros-perception/perception_open3d
This is the error log I keep getting:
Errors << open3d_conversions:make /home/csoter01/agile_autonomy_ws/catkin_aa/logs/open3d_conversions/build.make.010.log In file included from /home/csoter01/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/src/open3d_conversions.cpp:15:0: /home/csoter01/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/include/open3d_conversions/open3d_conversions.h:19:10: fatal error: open3d/Open3D.h.in: No such file or directory #include <open3d/Open3D.h.in> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/open3d_conversions.dir/build.make:63: CMakeFiles/open3d_conversions.dir/src/open3d_conversions.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:305: CMakeFiles/open3d_conversions.dir/all] Error 2 make: *** [Makefile:141: all] Error 2
I think that for your version of open3d you need to rename the include file of open3d to
#include "open3d/Open3D.h"
. An example is here: https://github.com/isl-org/open3d-cmake-find-package/blob/master/Draw.cpp#L29. Hope it helps!I have been stuck at the same error for 2 full days now but changing to #include "open3d/Open3D.h" has not solved the issue for me. I have tried
- downloading all the dependencies listed in Open3D page,
- changing Open3D installation directories
- renaming #include "open3d/Open3D.h.in" none of this have worked thus far.
- replacing open3d_conversions with the files found here : https://github.com/ros-perception/perception_open3d
This is the error log I keep getting:
Errors << open3d_conversions:make /home/csoter01/agile_autonomy_ws/catkin_aa/logs/open3d_conversions/build.make.010.log In file included from /home/csoter01/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/src/open3d_conversions.cpp:15:0: /home/csoter01/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/open3d_conversions/include/open3d_conversions/open3d_conversions.h:19:10: fatal error: open3d/Open3D.h.in: No such file or directory #include <open3d/Open3D.h.in> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/open3d_conversions.dir/build.make:63: CMakeFiles/open3d_conversions.dir/src/open3d_conversions.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:305: CMakeFiles/open3d_conversions.dir/all] Error 2 make: *** [Makefile:141: all] Error 2
I have been stuck at the same error and it's all settled now.
- please make sure you have installed open3d by building it from source.If so you will see open3d directory in path "/usr/local/bin/cmake/open3d"
- otherwise, building open3d from source http://www.open3d.org/docs/release/compilation.html
- renaming #include "open3d/Open3D.h"
$ rviz --v $ [ INFO] [1634925235.339356078]: rviz version 1.13.3 $ [ INFO] [1634925235.339459957]: compiled against Qt version 5.9.5 $ [ INFO] [1634925235.339489131]: compiled against OGRE version 1.9.0 (Ghadamon)
This is a pretty old version, but with minimal changes it could also work with newest versions.
@antonilo @kelia still having problems with rviz, I would appreciate it if you will clarify what do you mean by "minimal changes". Any instructions on how to safely downgrade rviz to 1.13.3 will be also very helpful.
Update: I also encountered this error when catkin tried to build traj_sampler
Errors << traj_sampler:make /home/denis/agile_autonomy_ws/catkin_aa/logs/traj_sampler/build.make.002.log
In file included from /home/denis/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/src/kdtree.cpp:1:0:
/home/denis/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/include/traj_sampler/kdtree.h:5:10: fatal error: Open3D/Geometry/KDTreeFlann.h: No such file or directory
#include <Open3D/Geometry/KDTreeFlann.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/kdtree.dir/build.make:63: CMakeFiles/kdtree.dir/src/kdtree.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1462: CMakeFiles/kdtree.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
I have Open3D 0.9.0 installed in /usr/local/bin/cmake/, and Open3D/Geometry/KDTreeFlann.h actually exists in /usr/local/bin/cmake/include, so I guess the problem is with CMake not seeing correct Open3D path. Do you have any ideas on how to fix this?
Update 2: Solved traj_sampler issue by changing path to my Open3D installation in CMakeLists.txt of traj_sampler.
However, rviz issue is still present
$ rviz --v $ [ INFO] [1634925235.339356078]: rviz version 1.13.3 $ [ INFO] [1634925235.339459957]: compiled against Qt version 5.9.5 $ [ INFO] [1634925235.339489131]: compiled against OGRE version 1.9.0 (Ghadamon)
This is a pretty old version, but with minimal changes it could also work with newest versions.
@antonilo @kelia still having problems with rviz, I would appreciate it if you will clarify what do you mean by "minimal changes". Any instructions on how to safely downgrade rviz to 1.13.3 will be also very helpful.
Update: I also encountered this error when catkin tried to build traj_sampler
Errors << traj_sampler:make /home/denis/agile_autonomy_ws/catkin_aa/logs/traj_sampler/build.make.002.log In file included from /home/denis/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/src/kdtree.cpp:1:0: /home/denis/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/include/traj_sampler/kdtree.h:5:10: fatal error: Open3D/Geometry/KDTreeFlann.h: No such file or directory #include <Open3D/Geometry/KDTreeFlann.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/kdtree.dir/build.make:63: CMakeFiles/kdtree.dir/src/kdtree.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1462: CMakeFiles/kdtree.dir/all] Error 2 make: *** [Makefile:141: all] Error 2
I have Open3D 0.9.0 installed in /usr/local/bin/cmake/, and Open3D/Geometry/KDTreeFlann.h actually exists in /usr/local/bin/cmake/include, so I guess the problem is with CMake not seeing correct Open3D path. Do you have any ideas on how to fix this?
Update 2: Solved traj_sampler issue by changing path to my Open3D installation in CMakeLists.txt of traj_sampler.
However, rviz issue is still present
Rename #include <Open3D/Geometry/KDTreeFlann.h> to "open/geometry//KDTreeFlann.h" maybe ok. Please check the Open3d installed path to find the include files such as "/usr/local/bin/cmake/open3d". You need to rename all the include file of open3d according to your installed path. Rviz issue is tricky.
Rename #include <Open3D/Geometry/KDTreeFlann.h> to "open/geometry//KDTreeFlann.h" maybe ok. Please check the Open3d installed path to find the include files such as "/usr/local/bin/cmake/open3d". You need to rename all the include file of open3d according to your installed path. Rviz issue is tricky.
How did you solve rviz issue? You already had version 1.13?
Rename #include <Open3D/Geometry/KDTreeFlann.h> to "open/geometry//KDTreeFlann.h" maybe ok. Please check the Open3d installed path to find the include files such as "/usr/local/bin/cmake/open3d". You need to rename all the include file of open3d according to your installed path. Rviz issue is tricky.
How did you solve rviz issue? You already had version 1.13?
NO~~~. We are in the same boat. I even try to use ubuntu 18.04 & ROS Melodic , but fail too.
I had some issues with octomap and solved it through here https://darienmt.com/autonomous-flight/2018/11/15/installing-ethz-rotors.html . maybe some issues can be fixed from here and others by downloading some packages you dont have from apt search ros-rviz
for rviz check if you have the latest version of OGRE and qt5: sudo apt install qt5-default sudo apt-get install ogre-2.2
for traj_sampler You correctly said Rename #include <Open3D/Geometry/KDTreeFlann.h> to "open3d/geometry//KDTreeFlann.h" but also change the other 2 include to #include <open3d/geometry/PointCloud.h> #include <open3d/io/PointCloudIO.h>
I had some issues with octomap and solved it through here https://darienmt.com/autonomous-flight/2018/11/15/installing-ethz-rotors.html . maybe some issues can be fixed from here and others by downloading some packages you dont have from apt search ros-rviz
for rviz check if you have the latest version of OGRE and qt5: sudo apt install qt5-default sudo apt-get install ogre-2.2
for traj_sampler You correctly said Rename #include <Open3D/Geometry/KDTreeFlann.h> to "open3d/geometry//KDTreeFlann.h" but also change the other 2 include to #include <open3d/geometry/PointCloud.h> #include <open3d/io/PointCloudIO.h>
I already solved traj_sampler issue by changing path to my Open3D installation in CMakeLists.txt of traj_sampler. No more actions were required. The only remaining problem is rviz. Would be much easier if ros maintainers stored older versions of packages in their apt repo...
By the way, did anyone try to build rviz from sources?
I tried building rviz from source just like open3d:
- git clone https://github.com/ros-visualization/rviz
- in this directory there is a link with some dependencies http://tango.freedesktop.org/releases/ (icon-naming-utils and tango-item-theme) using apt search insert-package-name find and install the latest versions
- follow steps 3-5 just like here http://www.open3d.org/docs/release/compilation.html#config
- if you face some errors of this type https://forum.openwrt.org/t/python3-pip3-aarch64-help/74685 around 86% it might be because g++ and gcc compilers are of version 7 instead of >8. Follow this guide to install a newer gcc and g++ version and use those for compiling instead https://linuxconfig.org/how-to-switch-between-multiple-gcc-and-g-compiler-versions-on-ubuntu-20-04-lts-focal-fossa
- if you successfully manage to build and make install rviz then you should see it in your /include folder (mine is not there yet, I am working on it)
In addition, going through the PointCloudCommon documentation it seems that getCallbackQueue() depends on callback_queue_interface.h which is not present in the project http://docs.ros.org/en/jade/api/rviz/html/c++/classrviz_1_1PointCloudCommon.html
I dont know if any of these are the solution I just thought I share what I found so far
I also have a problem with rviz and take an error as below.
Errors << planning_ros_utils:make /home/yfaktas/agile_autonomy_ws/catkin_aa/logs/planning_ros_utils/build.make.002.log /home/yfaktas/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp: In constructor ‘planning_rviz_plugins::MapDisplay::MapDisplay()’: /home/yfaktas/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp:39:52: error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’ update_nh_.setCallbackQueue(point_cloud_common_->getCallbackQueue());
make[2]: *** [CMakeFiles/planning_rviz_plugins.dir/src/planning_rviz_plugins/map_display.cpp.o] Error 1 make[1]: *** [CMakeFiles/planning_rviz_plugins.dir/all] Error 2
Is there anyone solved this problem ?
If your issues persist, I would recommend commenting away that part. It is anyway only used for visualizing the point cloud while executing the code. It is not a key part of the project.
@den250400 I'm facing the same issue on noetic. Did you manage to solve it? error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’
Failed << example_control:make [ Exited with code 2 ]
Failed <<< example_control [ 1.5 seconds ]
______________________________________________________________________________________________________________________________________________________________________
Errors << planning_ros_utils:make /home/rajendra/agile_autonomy_ws/catkin_aa/logs/planning_ros_utils/build.make.009.log
/home/rajendra/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp: In constructor ‘planning_rviz_plugins::MapDisplay::MapDisplay()’:
/home/rajendra/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp:39:52: error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’
39 | update_nh_.setCallbackQueue(point_cloud_common_->getCallbackQueue());
| ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/planning_rviz_plugins.dir/build.make:160: CMakeFiles/planning_rviz_plugins.dir/src/planning_rviz_plugins/map_display.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:381: CMakeFiles/planning_rviz_plugins.dir/all] Error 2
make: *** [Makefile:160: all] Error 2
cd /home/rajendra/agile_autonomy_ws/catkin_aa/build/planning_ros_utils; catkin build --get-env planning_ros_utils | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -
@den250400 I'm facing the same issue on noetic. Did you manage to solve it? error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’
Failed << example_control:make [ Exited with code 2 ] Failed <<< example_control [ 1.5 seconds ] ______________________________________________________________________________________________________________________________________________________________________ Errors << planning_ros_utils:make /home/rajendra/agile_autonomy_ws/catkin_aa/logs/planning_ros_utils/build.make.009.log /home/rajendra/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp: In constructor ‘planning_rviz_plugins::MapDisplay::MapDisplay()’: /home/rajendra/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp:39:52: error: ‘class rviz::PointCloudCommon’ has no member named ‘getCallbackQueue’ 39 | update_nh_.setCallbackQueue(point_cloud_common_->getCallbackQueue()); | ^~~~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/planning_rviz_plugins.dir/build.make:160: CMakeFiles/planning_rviz_plugins.dir/src/planning_rviz_plugins/map_display.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:381: CMakeFiles/planning_rviz_plugins.dir/all] Error 2 make: *** [Makefile:160: all] Error 2 cd /home/rajendra/agile_autonomy_ws/catkin_aa/build/planning_ros_utils; catkin build --get-env planning_ros_utils | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -
Just like @antonilo said, I commented away the line with getCallbackQueue, and the build succeeded
After commenting away line with getCallbackQueue and solving a few minor problems, I have managed to launch the simulation environment and test_trajectory.py
In order to help those who struggle to build this project, I tried my best to distill all my actions into this installation manual. It is supposed to work even on freshly-installed Ubuntu 20.04. However, I know that there might be flaws in this guide, so feel free to report them.
sudo apt-get update
sudo apt-get install git cmake g++
# Install NVidia drivers, CUDA 11.2 and cuDNN
# This can be quite painful, but this tutorial helped me a lot https://yakhyo.medium.com/cuda-11-2-installation-on-ubuntu-20-04-e83f7561ccc1
# Be careful with version compatibility of CUDA and nvidia driver!
# Install Open3D v0.9.0
git clone --recursive https://github.com/intel-isl/Open3D
git checkout v0.9.0
git submodule update --init --recursive
./util/scripts/install-deps-ubuntu.sh
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/bin/cmake ..
make -j$(nproc)
sudo make install
# Install catkin
sudo apt-get install ros-noetic-catkin python3-catkin-tools
# Install ROS Noetic
# Don't forget to configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse."
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl # if you haven't already installed curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-noetic-desktop-full
source /opt/ros/noetic/setup.bash
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
# Install agile autonomy
# At that moment, you must create an ssh key and bind it to your github. Otherwise, clone and submodule update commands will fail. Check https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent for details
sudo apt-get install g++-7 gcc-7 # agile autonomy requires old compilers for some reason
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
export ROS_VERSION=noetic
mkdir agile_autonomy_ws
cd agile_autonomy_ws
export CATKIN_WS=./catkin_aa
mkdir -p $CATKIN_WS/src
cd $CATKIN_WS
catkin init
catkin config --extend /opt/ros/$ROS_VERSION
catkin config --merge-devel
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-fdiagnostics-color -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
cd src
git clone [email protected]:uzh-rpg/agile_autonomy.git
sudo apt install python3-vcstool
vcs-import < agile_autonomy/dependencies.yaml
cd rpg_mpl_ros
git submodule update --init --recursive
# Install extra dependencies (might need more depending on your OS)
sudo apt-get install -y libqglviewer-dev-qt5
# Install external libraries for rpg_flightmare
sudo apt install -y libzmqpp-dev libeigen3-dev libglfw3-dev libglm-dev
# Install dependencies for rpg_flightmare renderer
sudo apt install -y libvulkan1 vulkan-utils gdb
# Install other dependencies not listed in original installation guide
sudo apt-get install libsdl-dev libsdl-image1.2-dev ros-noetic-octomap ros-noetic-octomap-msgs ros-noetic-octomap-ros
# Add environment variables (Careful! Modify path according to your local setup)
echo 'export RPGQ_PARAM_DIR=/home/denis/agile_autonomy/catkin_aa/src/rpg_flightmare' >> ~/.bashrc
# IMPORTANT: Before building the project, manually change several files in this project as described below in "File modifications" section
# Open another terminal window and build the project
sudo catkin build
# Setup the project
cd ..
. ../devel/setup.bash
# Create your learning environment
# You will also need to install Anaconda (You may install the latest version - it looks like you don't necessarily need Anaconda==v4.8.3 to run this project)
roscd planner_learning
conda create --name tf_24 python=3.7
conda activate tf_24
conda install tensorflow-gpu
pip install rospkg==1.2.3,pyquaternion,open3d,opencv-python
File modifications:
-
catkin_aa/src/rpg_mpl_ros/open3d_conversions/CMakeLists.txt replace line 13 with
find_package(Open3D HINTS /usr/local/bin/cmake/)
-
catkin_aa/src/rpg_mpl_ros/planning_ros_utils/src/planning_rviz_plugins/map_display.cpp Comment out line 39
-
catkin_aa/src/agile_autonomy/data_generation/traj_sampler/CMakeLists.txt replace line 12 with
find_package(Open3D HINTS /usr/local/bin/cmake/)
Hope it helps!
@den250400, You are a lifesaver! Thank you for providing the detailed instructions.
@den250400 thank you for the instructions! I was able to get 60/70 packages built when running catkin build
but encountered this error when building traj_sampler:
Errors << traj_sampler:make /home/improbable/agile_autonomy_ws/catkin_aa/logs/traj_sampler/build.make.007.log
In file included from /home/improbable/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/src/kdtree.cpp:1:0:
/home/improbable/agile_autonomy_ws/catkin_aa/src/agile_autonomy/data_generation/traj_sampler/include/traj_sampler/kdtree.h:5:10: fatal error: Open3D/Geometry/KDTreeFlann.h: No such file or directory
#include <Open3D/Geometry/KDTreeFlann.h>
I have changed the line at the traj_sampler CMakelists.txt to the one you suggested. I also tried changing Open3D
to open3d
in the include statement but that didn't work. Have you encountered something similar?
@yukaryote I too had got this error, and I fixed by changing
#include <Open3D/Geometry/KDTreeFlann.h>
to
#include "open3d/geometry/KDTreeFlann.h"
All of the Open3D-related issues occurred due to different versions and installed positions; the authors use Open3D v0.9.0. and installed the package in the default folder such as "/usr/local/lib/cmake", the "include" path is "/usr/local/include/Open3D". When you are installing open3d, try:
cmake ..
make -j$(nproc)
sudo make install
Then you don't need to modify the files of Open3D
linzgood@linzgood-ThinkPad-P15v-Gen-1:~/agile_autonomy_ws/catkin_aa$ sudo catkin build
[sudo] password for linzgood:
-------------------------------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/noetic
Workspace: /home/linzgood/agile_autonomy_ws/catkin_aa
-------------------------------------------------------------------------------
Build Space: [exists] /home/linzgood/agile_autonomy_ws/catkin_aa/build
Devel Space: [exists] /home/linzgood/agile_autonomy_ws/catkin_aa/devel
Install Space: [unused] /home/linzgood/agile_autonomy_ws/catkin_aa/install
Log Space: [exists] /home/linzgood/agile_autonomy_ws/catkin_aa/logs
Source Space: [exists] /home/linzgood/agile_autonomy_ws/catkin_aa/src
DESTDIR: [unused] None
-------------------------------------------------------------------------------
Devel Space Layout: merged
Install Space Layout: None
-------------------------------------------------------------------------------
Additional CMake Args: -DCMAKE_BUILD_TYPE=Release
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
-------------------------------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
-------------------------------------------------------------------------------
Workspace configuration appears valid.
-------------------------------------------------------------------------------
[build] Found '73' packages in 0.0 seconds.
[build] Package table is up to date.
Starting >>> catkin_boost_python_buildtool
Starting >>> catkin_simple
Starting >>> decomp_util
Starting >>> mav_msgs
Starting >>> mav_state_machine_msgs
Starting >>> mav_system_msgs
Starting >>> motion_primitive_library
Starting >>> open3d_conversions
Starting >>> rotors_comm
Starting >>> rotors_description
Starting >>> rotors_evaluation
Starting >>> rqt_rotors
Finished <<< catkin_boost_python_buildtool [ 0.1 seconds ]
Finished <<< mav_state_machine_msgs [ 0.3 seconds ]
Finished <<< rotors_evaluation [ 0.1 seconds ]
Finished <<< mav_system_msgs [ 0.3 seconds ]
Finished <<< catkin_simple [ 0.1 seconds ]
Starting >>> assimp_catkin
Starting >>> catkin_boost_python_buildtool_test
Starting >>> decomp_ros_msgs
Starting >>> eigen_catkin
Starting >>> flightrender
Finished <<< rqt_rotors [ 0.1 seconds ]
Starting >>> gflags_catkin
Finished <<< rotors_description [ 0.1 seconds ]
Finished <<< eigen_catkin [ 0.1 seconds ]
Finished <<< open3d_conversions [ 0.5 seconds ]
Finished <<< rotors_comm [ 0.5 seconds ]
Finished <<< flightrender [ 0.1 seconds ]
Finished <<< decomp_ros_msgs [ 0.4 seconds ]
Starting >>> minimum_jerk_trajectories
Starting >>> numpy_eigen
Starting >>> planning_ros_msgs
Starting >>> quad_launch_files
Starting >>> quadrotor_msgs
Finished <<< mav_msgs [ 0.5 seconds ]
Starting >>> mav_planning_msgs
Starting >>> rotors_control
Finished <<< catkin_boost_python_buildtool_test [ 0.2 seconds ]
Starting >>> rotors_hil_interface
Finished <<< assimp_catkin [ 0.2 seconds ]
Starting >>> rotors_joy_interface
Finished <<< gflags_catkin [ 0.1 seconds ]
Starting >>> glog_catkin
Finished <<< motion_primitive_library [ 0.6 seconds ]
Starting >>> rpg_common_py
Finished <<< decomp_util [ 0.4 seconds ]
Starting >>> decomp_ros_utils
Finished <<< numpy_eigen [ 0.2 seconds ]
Starting >>> mpl_external_planner
Finished <<< quad_launch_files [ 0.1 seconds ]
Finished <<< minimum_jerk_trajectories [ 0.4 seconds ]
Finished <<< rotors_hil_interface [ 0.2 seconds ]
Finished <<< quadrotor_msgs [ 0.6 seconds ]
Finished <<< glog_catkin [ 0.2 seconds ]
Finished <<< planning_ros_msgs [ 0.8 seconds ]
Finished <<< rpg_common_py [ 0.2 seconds ]
Starting >>> eigen_checks
Starting >>> planning_ros_utils
Starting >>> agile_autonomy_msgs
Starting >>> quadrotor_common
Finished <<< rotors_joy_interface [ 0.5 seconds ]
Finished <<< mav_planning_msgs [ 0.8 seconds ]
Finished <<< rotors_control [ 0.8 seconds ]
Finished <<< agile_autonomy_msgs [ 0.5 seconds ]
Starting >>> mav_comm
Finished <<< decomp_ros_utils [ 0.8 seconds ]
Finished <<< eigen_checks [ 0.2 seconds ]
Starting >>> decomp_test_node
Finished <<< mav_comm [ 0.2 seconds ]
Finished <<< quadrotor_common [ 0.6 seconds ]
Starting >>> minkindr
Finished <<< mpl_external_planner [ 0.8 seconds ]
Finished <<< minkindr [ 0.2 seconds ]
Finished <<< decomp_test_node [ 0.5 seconds ]
Starting >>> minkindr_conversions
Starting >>> minkindr_python
Starting >>> polynomial_trajectories
Starting >>> position_controller
Starting >>> rotors_gazebo_plugins
Starting >>> rpg_common
Starting >>> rpg_single_board_io
Starting >>> rpgq_msgs
Starting >>> rqt_quad_gui
Starting >>> sbus_bridge
Starting >>> state_predictor
Finished <<< planning_ros_utils [ 0.9 seconds ]
Starting >>> trajectory_visualizer
Finished <<< minkindr_conversions [ 0.1 seconds ]
Finished <<< rpgq_msgs [ 0.5 seconds ]
Finished <<< rqt_quad_gui [ 0.2 seconds ]
Finished <<< position_controller [ 0.7 seconds ]
Finished <<< minkindr_python [ 0.2 seconds ]
Finished <<< state_predictor [ 0.6 seconds ]
Finished <<< polynomial_trajectories [ 0.6 seconds ]
Finished <<< rpg_single_board_io [ 0.3 seconds ]
Finished <<< sbus_bridge [ 0.5 seconds ]
Finished <<< rpg_common [ 0.4 seconds ]
Finished <<< rotors_gazebo_plugins [ 1.0 seconds ]
Starting >>> rotors_gazebo
Starting >>> rpg_common_ros
Starting >>> rpg_rotors_interface
Starting >>> rpgq_common
Starting >>> manual_flight_assistant
Starting >>> trajectory_generation_helper
Starting >>> vbat_thrust_calibration
Finished <<< trajectory_visualizer [ 0.4 seconds ]
Finished <<< manual_flight_assistant [ 0.4 seconds ]
Finished <<< rpgq_common [ 0.3 seconds ]
Finished <<< rotors_gazebo [ 0.5 seconds ]
Finished <<< vbat_thrust_calibration [ 0.2 seconds ]
Starting >>> rotors_simulator
Starting >>> rpgq_command_bridge
Starting >>> rpgq_components
Finished <<< rpg_common_ros [ 0.7 seconds ]
Finished <<< trajectory_generation_helper [ 0.4 seconds ]
Finished <<< rotors_simulator [ 0.2 seconds ]
Starting >>> autopilot
Finished <<< rpg_rotors_interface [ 0.4 seconds ]
Finished <<< rpgq_components [ 0.2 seconds ]
Finished <<< rpgq_command_bridge [ 0.2 seconds ]
Starting >>> rpgq_simulator
Finished <<< autopilot [ 0.3 seconds ]
Starting >>> agile_autonomy_utils
Starting >>> planner_learning
Starting >>> rpg_mpc
Starting >>> rpg_quadrotor_integration_test
Finished <<< rpgq_simulator [ 0.3 seconds ]
Starting >>> example_pcd
Starting >>> example_vision
Starting >>> example_vison
Starting >>> example_control
Finished <<< rpg_quadrotor_integration_test [ 0.2 seconds ]
Finished <<< planner_learning [ 0.1 seconds ]
Finished <<< rpg_mpc [ 0.4 seconds ]
Finished <<< agile_autonomy_utils [ 0.3 seconds ]
Finished <<< example_pcd [ 0.3 seconds ]
Starting >>> mpl_test_node
Finished <<< example_vision [ 0.3 seconds ]
Finished <<< example_vison [ 0.3 seconds ]
Starting >>> agile_autonomy
Starting >>> traj_sampler
Finished <<< example_control [ 0.5 seconds ]
Finished <<< agile_autonomy [ 0.4 seconds ]
_________________________________________________________________________________________________________________________________________________________________________________________________________
Errors << mpl_test_node:cmake /home/linzgood/agile_autonomy_ws/catkin_aa/logs/mpl_test_node/build.cmake.035.log
CMake Warning (dev) at CMakeLists.txt:1 (project):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
CMAKE_PROJECT_VERSION
CMAKE_PROJECT_VERSION_MAJOR
CMAKE_PROJECT_VERSION_MINOR
CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at /home/linzgood/agile_autonomy_ws/catkin_aa/devel/share/open3d_conversions/cmake/open3d_conversionsConfig.cmake:173 (message):
Project 'mpl_test_node' tried to find library 'Open3D'. The library is
neither a target nor built/installed properly. Did you compile project
'open3d_conversions'? Did you find_package() it before the subdirectory
containing its code is included?
Call Stack (most recent call first):
CMakeLists.txt:27 (find_package)
cd /home/linzgood/agile_autonomy_ws/catkin_aa/build/mpl_test_node; catkin build --get-env mpl_test_node | catkin env -si /usr/bin/cmake /home/linzgood/agile_autonomy_ws/catkin_aa/src/rpg_mpl_ros/mpl_test_node --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/linzgood/agile_autonomy_ws/catkin_aa/devel -DCMAKE_INSTALL_PREFIX=/home/linzgood/agile_autonomy_ws/catkin_aa/install -DCMAKE_BUILD_TYPE=Release; cd -
.........................................................................................................................................................................................................
Failed << mpl_test_node:cmake [ Exited with code 1 ]
Failed <<< mpl_test_node [ 0.7 seconds ]
Finished <<< traj_sampler [ 0.4 seconds ]
[build] Summary: 72 of 73 packages succeeded.
[build] Ignored: None.
[build] Warnings: None.
[build] Abandoned: None.
[build] Failed: 1 packages failed.
[build] Runtime: 8.7 seconds total.
linzgood@linzgood-ThinkPad-P15v-Gen-1:~/agile_autonomy_ws/catkin_aa$
@linzgood have you sloved this problem?I have got the same problem
@den250400
thank you guy, but one last question, the best way to solve the rviz issue is commenting away that line, a little bit sad...
@den250400
thank you guy, but one last question, the best way to solve the rviz issue is commenting away that line, a little bit sad...
Yep, the only solution we found was to comment away the line with rviz. What's really sad is that ROS repositories store only the latest version of their packages, so you can't just sudo apt-get install ros-noetic-rviz=1.13.3
. You can try to build rviz from sources by cloning its repo and cheking out to v1.13.3, but rviz maintainers haven't provided any instructions on how to do it.
@linzgood @Howardcl: I am running into this following Den's approach. Were you able to figure out how to go past that error?
CMake Error at /home/linzgood/agile_autonomy_ws/catkin_aa/devel/share/open3d_conversions/cmake/open3d_conversionsConfig.cmake:173 (message): Project 'mpl_test_node' tried to find library 'Open3D'. The library is neither a target nor built/installed properly. Did you compile project 'open3d_conversions'? Did you find_package() it before the subdirectory containing its code is included? Call Stack (most recent call first): CMakeLists.txt:27 (find_package)
@den250400
thank you guy, but one last question, the best way to solve the rviz issue is commenting away that line, a little bit sad...
Yep, the only solution we found was to comment away the line with rviz. What's really sad is that ROS repositories store only the latest version of their packages, so you can't just
sudo apt-get install ros-noetic-rviz=1.13.3
. You can try to build rviz from sources by cloning its repo and cheking out to v1.13.3, but rviz maintainers haven't provided any instructions on how to do it.
Actually, I tried to fix this problem by editing that line of code to adapt to the latest version of rviz and it's cpp API, but I found that the official document of ros related package API is too brief... and I must search and read more tutorials to edit the code, so it would be a good idea to comment away it at this time..
@SoheilSalehian @linzgood @Howardcl we are on the same boat... I backlisted mpl_test_node and all other 70 packages were built successfully, but I still fail to find the reason.