当前位置:网站首页>ROS bridge notes (01) - APT installation, source code compilation and installation, installation dependency, and operation display
ROS bridge notes (01) - APT installation, source code compilation and installation, installation dependency, and operation display
2022-06-30 02:05:00 【wohu1104】
Official website :https://carla.readthedocs.io/projects/ros-bridge/en/latest/ros_installation_ros1/
1. Installation premise
Ubuntu 18.04ROSalready installedCARLA 0.9.8+already installed
have access to apt install ( Support only Ubuntu 18.04), Or use the source code to compile and install , Recommended source code compilation and installation .
2. apt install
2.1 Add image source
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9
sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"
2.2 install ROS bridge
- Install the latest version
sudo apt-get update # Update the Debian package index
sudo apt-get install carla-ros-bridge # Install the latest ROS bridge version, or update the current installation
- Install the specified version
apt-cache madison carla-ros-bridge # List the available versions of the ROS bridge
sudo apt-get install carla-ros-bridge=0.9.10-1 # In this case, "0.9.10" refers to the ROS bridge version, and "1" to the Debian revision
After successful installation , Can be in /opt Directory to see the installed files .
3. Source code compilation and installation
3.1 Create a workspace
mkdir -p ~/carla-ros-bridge/catkin_ws/src
3.2 clone ROS Bridge Libraries and submodules
cd ~/carla-ros-bridge
git clone --recurse-submodules https://github.com/carla-simulator/ros-bridge.git catkin_ws/src/ros-bridge
3.3 Import ROS environment variable
source /opt/ros/melodic/setup.bash
Be careful : Installed here by default ROS Version is melodic
3.4 Installation dependency
cd catkin_ws
rosdep update
rosdep install --from-paths src --ignore-src -r
3.5 Compilation and installation
catkin build
# perhaps
catkin_make
4. function
4.1 start-up CARLA
according to CARLA The installation is different , Select the corresponding command to start CARLA:
# Package version in carla root folder
./CarlaUE4.sh
# Debian installation in `opt/carla-simulator/`
./CarlaUE4.sh
# Build from source version in carla root folder
make launch
4.2 Creating a virtual environment
install miniconda , Access address :https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
conda After the environment is installed , establish Python A virtual environment
conda create -n py27 python=2.7
conda create -n py37 python=3.7
Here you can choose to install different versions , Be careful :
ros-bridgeNeed to install topython2.7In the environment of .
Use the following command to view the virtual environment that the current environment already has
conda info -e
Optional commands :
conda config --set auto_activate_base false
conda config --set report_errors false
Activate 、 To activate a version of the environment
conda activate py27
conda deactivate
be based on Python2.7 Environmental Science , To configure ROS Bridge Needed Python Dependency Library
conda create -n py27 python=2.7
conda activate py27
Set permanently in the virtual environment pip Source
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Install dependency library
pip install opencv-python==4.2.0.32
pip install networkx
pip install rospkg
pip install rospy
pip install simple_pid
pip install transforms3d
pip install networkx
pip install enum
pip install pygame
4.3 take CARLA The path is added to Python In the environment variables
export CARLA_ROOT=<path-to-carla>
export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-<carla_version_and_arch>.egg:$CARLA_ROOT/PythonAPI/carla
among :
<path-to-carla>byCARLAInstallation path for ;<carla_version_and_arch>byCARLACorrespondingPythonVersion pack ;
Created in the previous step Python2.7 Execute the following commands in the virtual environment :
(py27) [email protected]:~/tool$ export PYTHONPATH=$PYTHONPATH:/home/wohu/tool/CARLA_0.9.13/PythonAPI/carla/dist/carla-0.9.13-py2.7-linux-x86_64.egg:/home/wohu/tool/CARLA_0.9.13/PythonAPI/carla
(py27) [email protected]:~/tool$ python -c 'import carla;print("Success")'
Success
(py27) [email protected]:~/tool$
explain Python The related dependent libraries are installed normally .
4.4 Import ROS bridge environment variable
According to different installation methods , Select the corresponding command to import ros bridge environment variable
# For debian installation of ROS bridge. Change the command according to your installed version of ROS.
source /opt/carla-ros-bridge/<melodic/noetic>/setup.bash
# For GitHub repository installation of ROS bridge
source ./carla-ros-bridge/catkin_ws/devel/setup.bash
Each run ROS bridge You need to execute the above commands , You can also add the above command to ~/.bashrc in .
4.5 function ROS Bridge
Choose either of the following two commands , You can't do it at the same time .
# Option 1: start the ros bridge
roslaunch carla_ros_bridge carla_ros_bridge.launch

# Option 2: start the ros bridge together with an example ego vehicle
roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch

边栏推荐
- Varnish foundation overview 2
- Cookie encryption 12
- [naturallanguageprocessing] [multimodality] ofa: unified architecture, tasks and modes through a simple sequence to sequence learning framework
- DMX configuration
- (1)基础学习——图解pin、pad、port、IO、net 的区别
- Circular right shift of array elements in C language
- CTF入门学习(Web方向)
- Tools and life services
- [pytorch actual combat] generate confrontation network Gan: generate cartoon character avatars
- 一次 Keepalived 高可用的事故,让我重学了一遍它!
猜你喜欢

001_ layout

【MySQL 05】SUSE 12 SP5 安装MySQL后第一次修改mysql密码

Cookie encryption 9

002_ container

一次 Keepalived 高可用的事故,让我重学了一遍它!

What should be paid attention to in the design and production of the Urban Planning Museum
![[MySQL 06] backup and restore MySQL database in Linux + docker container environment](/img/4e/8662d15ff84b2436d02948019540d3.png)
[MySQL 06] backup and restore MySQL database in Linux + docker container environment

DTW learning (dynamic time warping) -- Thought and code implementation

widget使用setImageViewBitmap方法设置bug分析

DTW学习(dynamic time warping)——思想、代码实现
随机推荐
8 — router
OpenCV和Image之间的转换(亲测有效)
Varnish foundation overview 6
JS reverse case -rus5 logic learning
Circular right shift of array elements in C language
Cookie encryption 13
What to remember about the penalty for deduction of points in Item 1
MySQL monitoring 2
Que se passe - t - il si un faux divorce devient un vrai divorce?
003_ color
Cookie encryption 15 login encryption
Using grpcui to test asp Net core grpc service
208. implement trie (prefix tree) - attach detailed notes
012_ switch
搞透AQS原理(流程圖及同步隊列圖解)
Encapsulate a complete version of the uniapp image and video upload component, which can be used immediately, switch between images and videos, customize the upload button style, delete the button sty
想转行,但不知道自己要做什么工作比较好?
[mrctf2020]ezpop-1 | PHP serialization
Sorting out the usage of transforms in pytoch
Where can I find a pre training model for pytoch model training?