OKVIS_ROS installation error mix
Table of Content
System Info
Ubuntu20.04, ROS Noetic, cuda11.1.
ROS
PY_em
– Could NOT find PY_em (missing: PY_EM)
Full Error message:
-- Could NOT find PY_em (missing: PY_EM)
CMake Error at /opt/ros/melodic/share/catkin/cmake/empy.cmake:29 (message):
Unable to find either executable 'empy' or Python module 'em'... try
installing the package 'python-empy'
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/all.cmake:163 (include)
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:56 (find_package)
Analysis: catkin finds the python in anaconda, we need to point catkin to the system python.
Solution:
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
rospkg
ModuleNotFoundError :No module named ‘rospkg’
Analysis: Happens when running roscreate-pkg
. This could because you are running the file with the wrong python interpreter.
Solutions:
- change teh shebang in the python files. For noetic or later, use
#!/usr/bin/env python3
; for melodic or earlier, use#!/usr/bin/env python2
. - run
pip install rospkg
.
gazebo
Can’t open /usr/share/gazebo//setup.sh
Analysis: The problem is in the scripts located in /opt/ros/indigo/lib/gazebo_ros
. There are several scripts (i.e. gzclient, gzserver, etc.) which are executed when you perform a rosrun
command. When trying to run gazebo, ROS needs to source the gazebo setup.sh
script to make sure that the proper gazebo paths are defined. This is the line in the ROS scripts which has a problem: setup_path=$(pkg-config --variable=prefix gazebo)/share/gazebo/
The problem is that pkg-config
should find the path to gazebo, but it doesn’t seem to work. Since it doesn’t find gazebo, the script just continues execution using “/share/gazebo/” as the path. Also, it looks like there is an extra slash at the end.
Solution: A simple workaround: change setup_path=/usr/share/gazebo
in gzclient
and gzserver
.
Make OKVIS
Bullet
No package ‘bullet’ found.
Full error message:
-- Checking for module 'bullet>=2.82'
-- No package 'bullet' found
-- Checking for module 'bullet2.82>=2.82'
-- No package 'bullet2.82' found
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:102 (message):
Error: Bullet > 2.82 not found, please install libbullet2.82-dev.
Call Stack (most recent call first):
CMakeLists.txt:11 (find_package)
Solution:
- find
bullet.pc
withsudo find / -name "bullet.pc"
; - Add the directory to
PKG_CONFIG_PATH
withexport PKG_CONFIG_PATH=$PKF_CONFIG_PATH:<folder_containing_bullet.pc>
.
OGRE
Could not find a configuration file for package ogre.
Full Error Message:
CMake Error at CMakeLists.txt:46 (find_package):
By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OGRE", but
CMake did not find one.
Could not find a package configuration file provided by "OGRE" with any of
the following names:
OGREConfig.cmake
ogre-config.cmake
Add the installation prefix of "OGRE" to CMAKE_PREFIX_PATH or set
"OGRE_DIR" to a directory containing one of the above files. If "OGRE"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
Analysis: CMake failed to look at the right path.
Solution: add set(CMAKE_MODULE_PATH "/usr/share/OGRE/cmake/modules/;${CMAKE_MODULE_PATH}")
to the CMakeLists.txt
image_geometry and others
Could not find a configuration file for package image_geometry.
Full Error Message:
CMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
Could not find a configuration file for package image_geometry.
Set image_geometry_DIR to the directory containing a CMake configuration
file for image_geometry. The file will have one of the following names:
image_geometryConfig.cmake
image_geometry-config.cmake
Call Stack (most recent call first):
viso2-hydro/viso2_ros/CMakeLists.txt:4 (find_package)
Analysis: packages not installed.
Solution: run sudo apt install ros-noetic-image-geometry
ceres-solver
cc1plus: some warnings are being treated as errors
Full Error Message:
xxxxxx/ceres/schur_eliminator.h:267:10:
struct Chunk {
^~~~~
cc1plus: some warnings are being treated as errors
internal/ceres/CMakeFiles/ceres.dir/build.make:2558: recipe for target 'internal/ceres/CMakeFiles/ceres.dir/generated/schur_eliminator_2_2_2.cc.o' failed
Analysis: Problem tag when downloading ceres1.9.0
Solution: change the tag from 7c57de5080c9f5a4f067e2d20b5f33bad5b1ade6
to 451e71c6b7c127ebfd29f0eb658543d512629a4e
. Then, cd
to /catkin_ws/build/okvis_ros/okvis/ceres/src/ceres-external
, modify CMakeLists.txt:ln 643, delete the -Werror
flag.
Eigen
fatal error: Eigen/Dense: no such file or directory
Analysis: Eigen is installed in the folder named eigen3
, not Eigen
, creating soft links solves the problem.
Solution:: do the following command
cd /usr/local/incllude
sudo ln -sf eigen3/Eigen Eigen
sudo ln -sf eigen3/unsupported unsupported
ros+eigen
CMake Error at xxx.
Full Error Message:
CMake Error at /opt/ros/melodic/share/pcl_ros/cmake/pcl_rosConfig.cmake:113(message):
project 'pcl_ros' specifies '/usr/include/eigen3' as an include dir,which is not found.
it does neither exist as an absolute directory nor in……'
Analysis: mismatch between the self-installed (from source) Eigen (/usr/local/include/eigen3
)and the path pre-defined in ROS packages (/usr/include/eigen3
).
Solutions:
- change the correspoinding *.cmake file, change
/usr/include/eigen3;
to/usr/local/include/eigen3
. TEDIOUS, lots of files need to be changed. - Since eigen3 folder only stores the headers, directly copy
/usr/local/include/eigen3
to/usr/include/eigen3
.
pcl
error: #error PCL requires C++14 or above
Solution: change C++ standard in cmake file. In /okvis_ros/CMakeList.txt
, add
set(CMAKE_CSS_STANDARD 14)
set(CMAKE_CSS_STANDARD_REQUIRED ON)
right after the project line.
dataset_convertor.cpp
Solution: change all ofstream
to std::ofstream
.
OpenCV
libgtk error
Full Error Message:
error: (-2:Unspecified error) the function is not implemented. Rebuild the library with Windows, GTK+2.x or Carbon support. If you are on Unbunto or Debian, install libgtk2.0-dev and pkg-config, then re-runn camke or configuration script in function 'cvNamedWindow'
Analysis: opencv failed to find the libgtk+-2.0 library.
Solution:
- Install libgtk with
sudo apt install libgtk2.0-dev
- Find the path to the libgtk package, Set up
PKG_CONFIG_PATH
in.bashrc
file. AddPKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig
. - Re-build opencv with flag
-D WITH_GTK=ON
. e.g.cmake -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.13/modules -D WITH_CUDA=ON -D WITH_CUDNN=OFF -D BUILD_opencv_cudacodec=OFF -D OPENCV_ENABLE_NONFREE=ON -DBUILD_JAVA=OFF -DBUILD_opencv_java_bindings_generator=OFF -D BUILD_PYTHON=OFF -D BUILD_opencv_python_bindings_generator=OFF -D WITH_QT=ON -D ENABLE_CXX11=ON -D BUILD_TIFF=ON -D WITH_GTK=ON ..
gtstream
fatal error: gst/gst.h: no such file or directory
Analysis: anacodna package conflicts.
Solution: move anaconda to Trash
, complete installation, and move it back.