日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【Carla】自定义仿真场景制作

發(fā)布時(shí)間:2023/12/15 编程问答 69 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Carla】自定义仿真场景制作 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
  • 地圖模型部分:

carla的地圖導(dǎo)入需要包含同名fbx格式地圖模型和xodr格式的矢量地圖。

在導(dǎo)入地圖模型存在多個(gè)分塊部分時(shí),將多個(gè)fbx模型文件導(dǎo)入blender,快捷鍵shift選中其中兩塊模型文件,再按快捷鍵ctrl+J完成模型合并,同理可以完成全部模型文件的整合工作,最終由blender輸出單一的模型文件。這里考慮到ue4坐標(biāo)系朝向問題,blender導(dǎo)入模型時(shí)需手動(dòng)選擇x軸朝前z軸朝上。當(dāng)合并后模型的幾何中心原點(diǎn)不重合時(shí),右鍵選擇設(shè)置原點(diǎn)幾何中心->原點(diǎn)

  • 地圖轉(zhuǎn)換:(osm2xodr)
import glob import os import systry:sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (sys.version_info.major,sys.version_info.minor,'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0]) except IndexError:passimport io import carla# Read the .osm data f = io.open("${Your_osm_path}", mode="r", encoding="utf-8") osm_data = f.read() f.close()# Define the desired settings. In this case, default values. settings = carla.Osm2OdrSettings() # Set OSM road types to export to OpenDRIVE settings.set_osm_way_types(["motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary_link", "tertiary", "tertiary_link", "unclassified", "residential"])# new config settings.use_offsets = False settings.center_map = False# Convert to .xodr xodr_data = carla.Osm2Odr.convert(osm_data, settings)# Save opendrive file f = open("${Your_xodr_path}", 'w') f.write(xodr_data) f.close()
  • carla運(yùn)行carla_ros_bridge報(bào)錯(cuò):
ImportError: dynamic module does not define module export function (PyInit__tf2)

解決方案:

# install dependencies sudo apt update sudo apt install python3-catkin-pkg-modules python3-rospkg-modules python3-empy# in your catkin_ws cd ${Your_catkin_ws_path} catkin_make source devel/setup.bash wstool init wstool set -y src/geometry2 --git https://github.com/ros/geometry2 -v ${tag} wstool up rosdep install --from-paths src --ignore-src -y -r# compile catkin_make --cmake-args \-DCMAKE_BUILD_TYPE=Release \-DPYTHON_EXECUTABLE=/usr/bin/python3 \-DPYTHON_INCLUDE_DIR=/usr/include/python3.6m \-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so

總結(jié)

以上是生活随笔為你收集整理的【Carla】自定义仿真场景制作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。