当前位置:   article > 正文

4.中文首发!!wsl2.0+Ubuntu22实现Autoware.universe与Carla仿真_wsl autoware

wsl autoware

在这里插入图片描述

接第三章内容

版本要求:
CARLA Simulator 0.9.15 release
Autoware Universe (Release 2023.10)!!!!必须
Python 3.10
ROS2 Humble
OpenPlanner.Universe
Linux 22.04

1.下载carla
#下载安装carla 0.9.13或者0.9.15
https://github.com/carla-simulator/carla/releases
#下载linux系统下,对应python版本的egg文件
https://github.com/gezp/carla_ros/releases/
#将 egg 文件添加到对应文件夹:../CARLA_0.9.15/PythonAPI/carla/dist下
  • 1
  • 2
  • 3
  • 4
  • 5
2.资源下载准备
#注意本内容分支过新可能会随时间变化,关注git作者获取最新链接
cd ~/autoware
mkdir op_carla && cd op_carla/
git clone https://github.com/hatem-darweesh/op_bridge.git -b ros2-humble
git clone https://github.com/hatem-darweesh/op_agent.git -b ros2-humble
git clone https://github.com/hatem-darweesh/scenario_runner.git

chmod -R a+x ~/autoware/op_carla

pip install py_trees
pip install networkx
pip install tabulate
pip install transforms3d
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
3.复制雷达文件
cd ~/autoware/src/param/autoware_individual_params/individual_params/config/default
mkdir carla_sensor_kit

把~/autoware/src/universe/external/open_planner/op_carla_bridge/carla_sensor_kit_launch/carla_sensor_kit_description/config
下的所有文件copy到下面目录
~/autoware/src/param/autoware_individual_params/individual_params/config/default/carla_sensor_kit
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
4.修改配置脚本文件
 打开 op_carla/op_agent/start_ros2.sh
 
 #16行替换成下面,主要是修改地图位置路径
 
 ros2 launch ${OP_AGENT_ROOT}/autoware_carla_launch/carla_simulator.launch.xml map_path:=$HOME/autoware/map_data/$map_name vehicle_model:=sample_vehicle sensor_model:=carla_sensor_kit
 
 打开op_carla/op_bridge/op_scripts/run_exploration_mode_ros2.sh
 #修改33、34行,改成zsh的脚本
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
5.修改环境变量
#打开zshrc,根据实际位置调节
export AUTOWARE_ROOT=/home/user/carla/autoware
export CARLA_ROOT=/home/user/carla/CARLA_0.9.15
export SCENARIO_RUNNER_ROOT=/home/user/carla/scenario_runner
export OP_BRIDGE_ROOT=/home/user/carla/op_bridge
export OP_AGENT_ROOT=/home/user/carla/op_agent
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/util
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/agents
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.15-py3.10-linux-x86_64.egg


#我的配置,仅供参考
alias carlaEnv='export AUTOWARE_ROOT=~/autoware && export CARLA_ROOT=/mnt/d/CARLA_0.9.13/WindowsNoEditor && export SCENARIO_RUNNER_ROOT=~/autoware/op_carla/scenario_runner && export OP_BRIDGE_ROOT=~/autoware/op_carla/op_bridge && export OP_AGENT_ROOT=~/autoware/op_carla/op_agent && export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI && export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/util && export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla && export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/agents && export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla/dist/carla-0.9.13-py3.10-linux-x86_64.egg'
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
6.执行
# 首先windows系统打开carla
 #source刷新autoware资源
 . ~/autoware/op_carla/op_bridge/op_scripts/run_exploration_mode_ros2.sh
  • 1
  • 2
  • 3

bug1

[10]    543589 segmentation fault  python3 ${OP_BRIDGE_ROOT}/op_bridge/op_bridge_ros2.py
  • 1

解决方案

 python -X faulthandler op_bridge_ros2.py
 #检查错误
pip install py_trees
pip install networkx
pip install tabulate
pip install transforms3d

#[INFO] [1703646661.523387867] [rviz2]: Stereo is NOT SUPPORTED
#更新OpenGL  其实也可以忽略,不好处理
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update && sudo apt upgrade
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

bug2

./run_exploration_mode_ros2.sh: 31: gnome-terminal: not found
  • 1

解决方法

sudo apt install gnome-terminal
  • 1
最终效果

在这里插入图片描述

总结:

可以跑,但是性能很差,两个问题:第一启动特别特别慢(应该是wsl的关系,双系统会改善很多),启动之后,矢量图覆盖在所有涂层之上,感觉是地图制作出了问题,可能是作者制作的问题?
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/110598
推荐阅读
相关标签
  

闽ICP备14008679号