【carla】ubuntu20.04 编译carla-ros-bridge 安装过程、报错及其解决方法
下载后进行catkin_make会报错3个错误。
·
文章目录
- 一、安装过程
- 二、报错及其解决方法
-
- 1.错误1:python库 empy 库找不到
- 2. 错误2:ackermann_msgs找不到
- 3. 错误3:derived-object找不到
- 4.错误4:CMake Error at grid_map/grid_map_octomap/CMakeLists.txt:13 (find_package):
- 5.错误5:Could not find the required component 'derived_object_msgs'.:
- 6.错误6 Could not find a package configuration file provided by "costmap_2d" with any of the following names:
- 7.错误7:ould not find a package configuration file provided by "TBB"
- 运行时错误2:ImportError: /usr/lib/x86_64-linux-gnu/libp11-kit.so.0: undefined symbol: ffi_type_pointer, version LIBFFI_BASE_7.0
- 运行时错误3:ModuleNotFoundError: No module named 'transforms3d'
下载后进行catkin_make会报错3个错误
一、安装过程
- Create a catkin workspace:
mkdir -p ~/carla-ros-bridge/catkin_ws/src
- Clone the ROS Bridge repository and submodules:
cd ~/carla-ros-bridge
git clone --recurse-submodules https://github.com/carla-simulator/ros-bridge.git catkin_ws/src/ros-bridge
- Set up the ROS environment according to the ROS version you have installed:
source /opt/ros/noetic/setup.bash
- Install the required ros-dependencies:
cd catkin_ws
wget http://fishros.com/install -O fishros && . fishros
安装rosdepc,然后运行:
rosdep update
rosdep install --from-paths src --ignore-src -r
7.创建虚拟环境
conda create -n carla python=3.7
8.安装pip依赖
pip install carla
pip install transforms3d
pip install pyyaml
pip install numpy
pip install opencv-python
pip install pygame
二、报错及其解决方法
1.错误1:python库 empy 库找不到
方法1:在conda环境中安装empy:conda install -c conda-forge empy
参考链接
方法2:这是编译时终端处于anaconda的虚拟环境base中,缺少相关依赖,所以编译的时候,需要指定一下python路径。
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
或者,也可以conda deactivate
直接退出后直接编译,效果和上面命令一致。
参考链接
2. 错误2:ackermann_msgs找不到
这个是因为缺少这个包,使用下面的命令进行安装:
sudo apt-get install ros-noetic-ackermann-msgs 20.04
sudo apt-get install ros-melodic-ackermann-msgs 18.04
3. 错误3:derived-object找不到
这个是因为缺少这个包,使用下面的命令进行安装:
在该网站下载ros-noetic-derived-object-msgs_3.3.0-1buster.20220926.181427_amd64.deb
并进行安装:
sudo dpkg -i ros-noetic-derived-object-msgs_3.3.0-1buster.20220926.181427_amd64.deb
参考链接:ubuntu20.04 carla仿真环境及ros-bridge搭建
4.错误4:CMake Error at grid_map/grid_map_octomap/CMakeLists.txt:13 (find_package):
查询文心一言之后提示,通过安装解决。
sudo apt-get install liboctomap-dev
CMake Error at grid_map/grid_map_octomap/CMakeLists.txt:13 (find_package):
By not providing "Findoctomap.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "octomap", but
CMake did not find one.
Could not find a package configuration file provided by "octomap" with any
of the following names:
octomapConfig.cmake
octomap-config.cmake
Add the installation prefix of "octomap" to CMAKE_PREFIX_PATH or set
"octomap_DIR" to a directory containing one of the above files. If
"octomap" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
5.错误5:Could not find the required component ‘derived_object_msgs’.:
通过运行以下指令:
sudo apt-get install ros-melodic-derived-object-msgs
-- Could NOT find derived_object_msgs (missing: derived_object_msgs_DIR)
-- Could not find the required component 'derived_object_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
"derived_object_msgs" with any of the following names:
derived_object_msgsConfig.cmake
derived_object_msgs-config.cmake
Add the installation prefix of "derived_object_msgs" to CMAKE_PREFIX_PATH
or set "derived_object_msgs_DIR" to a directory containing one of the above
files. If "derived_object_msgs" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
ros-bridge/carla_ros_bridge/CMakeLists.txt:9 (find_package)
-- Configuring incomplete, errors occurred!
See also "/media/gk/data3_8/lbw/CARLA_ONLINE/carla-ros-bridge/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/media/gk/data3_8/lbw/CARLA_ONLINE/carla-ros-bridge/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
## 运行时错误1: CARLA python module version 0.9.12 required. Found: 0.9.14
这是由于python中的carla安装版本不对。需要重新安装:
```clike
pip install carla==0.9.12
6.错误6 Could not find a package configuration file provided by “costmap_2d” with any of the following names:
解决方法:
sudo apt-get install ros-melodic-costmap-2d
7.错误7:ould not find a package configuration file provided by “TBB”
CMake Error at grid_map/grid_map_filters/CMakeLists.txt:35 (find_package):
By not providing "FindTBB.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "TBB", but
CMake did not find one.
Could not find a package configuration file provided by "TBB" (requested
version 2020.1) with any of the following names:
TBBConfig.cmake
tbb-config.cmake
Add the installation prefix of "TBB" to CMAKE_PREFIX_PATH or set "TBB_DIR"
to a directory containing one of the above files. If "TBB" provides a
separate development package or SDK, be sure it has been installed.
运行时错误2:ImportError: /usr/lib/x86_64-linux-gnu/libp11-kit.so.0: undefined symbol: ffi_type_pointer, version LIBFFI_BASE_7.0
这个错误是由于python3.8版本问题导致的。解决方法是由这个链接提供的。
首先cd到conda的carla环境的lib文件夹下:
cd /home/"$USER"/anaconda3/envs/carla/lib
然后备份一下libffi.so.7文件
mv libffi.so.7 libffi.so.7.bak
然后重新建立链接:
sudo ln -s /lib/x86_64-linux-gnu/libffi.so.7.1.0 libffi.so.7
sudo ldconfig
再次运行程序,相关问题就解决了。
运行时错误3:ModuleNotFoundError: No module named ‘transforms3d’
此时可能是在编译carla-ros-bridge时,没有使用现在的python环境。解决方法就是使得carla-ros-bridge的编译环境和运行环境保持一致。
可以在运行环境下重新编译carla-ros-bridge。重新编译前需要删除build 和devel文件夹。
更多推荐
所有评论(0)