当前位置: 首页 > news >正文

自动驾驶—CARLA仿真(0)报错记录

报错1:make_unit_vector

Traceback (most recent call last):
File “/home/zfjuan/CarLa/PythonAPI/examples/automatic_control.py”, line 873, in
main()
File “/home/zfjuan/CarLa/PythonAPI/examples/automatic_control.py”, line 866, in main
game_loop(args)
File “/home/zfjuan/CarLa/PythonAPI/examples/automatic_control.py”, line 739, in game_loop
agent = BehaviorAgent(world.player, behavior=args.behavior)
File “/home/zfjuan/CarLa/PythonAPI/carla/agents/navigation/behavior_agent.py”, line 40, ininit
super().init(vehicle, opt_dict=opt_dict, map_inst=map_inst, grp_inst=grp_inst)
File “/home/zfjuan/CarLa/PythonAPI/carla/agents/navigation/basic_agent.py”, line 100, ininit
self._global_planner = GlobalRoutePlanner(self._map, self._sampling_resolution)
File “/home/zfjuan/CarLa/PythonAPI/carla/agents/navigation/global_route_planner.py”, line 72, ininit
self._build_graph()
File “/home/zfjuan/CarLa/PythonAPI/carla/agents/navigation/global_route_planner.py”, line 204, in _build_graph
net_carla_vector = (exit_wp.transform.location - entry_wp.transform.location).make_unit_vector()
Boost.Python.ArgumentError: Python argument types in
Vector3D.make_unit_vector(Vector3D)
did not match C++ signature:
make_unit_vector(carla::geom::Vector3D {lvalue}, float)

原因分析:理论上应该是server client 版本不一致造成的,但我的确实都是0.9.16版本;
解决办法:修复 make_unit_vector 调用

修改文件:
/home/zfjuan/CarLa/PythonAPI/carla/agents/navigation/global_route_planner.py
找到报错行:

net_carla_vector=(exit_wp.transform.location-entry_wp.transform.location).make_unit_vector()

替换为(添加一个极小的 epsilon 参数):

vec=exit_wp.transform.location-entry_wp.transform.location try:net_carla_vector=vec.make_unit_vector()except TypeError:# 新版需要 epsilon 参数 net_carla_vector=vec.make_unit_vector(1e-6)

报错2:Retrying /location_info: Status 403, Message Access denied. Please check the provided API key. Retry #1, Backoff 1 seconds

✅ 错误原因
你正在运行一个 集成了 InvertedAI 服务的 CARLA 脚本(invertedai_traffic.py),该脚本需要调用 InvertedAI 的云端 API 来生成高真实感交通行为。

但你没有提供有效的 API Key,或提供的 Key 无效/已过期/无权限,导致服务器返回 HTTP 403(Forbidden)。

✅ 解决方案
步骤 1:获取 InvertedAI API Key,访问官网:注册登录,会自动生成一组Key

步骤 2:在命令行中传入 API Key
运行脚本时,必须通过 --iai-key 参数传入你的密钥:

python invertedai_traffic.py--host30.207.90.42--iai-key xxxxxxxxxxxxxxxxxxx
http://www.cnnetsun.cn/news/23490.html

相关文章:

  • FT8371A,FT8371B,FT8371C 次边同步整流芯片典型应用资料分析
  • 智慧文旅信创落地新标杆:四川省文旅厅完成MySQL 5.7平滑替换,筑牢省级管理平台自主可控底座
  • 7、Unix/Linux 网络监控与日志管理全解析
  • 11、数据备份与系统安装全攻略
  • 12、Unix/Linux 系统设置与生产准备全攻略
  • 5步掌握网页数据采集:零代码工具完全操作手册
  • 15、测试系统与“安全”系统
  • TradingAgents-CN实战指南:从零开始构建你的AI交易智能体团队
  • 18、系统与网络安全全解析
  • 检索增强生成(RAG)在Java应用中的实践指南
  • 机器学习测试神器TensorFlow Model Analysis实战
  • Monitorian:多显示器亮度调节的终极解决方案,一键掌控视觉舒适度
  • 2025 主流 GEO 优化服务商 TOP4,助力 ToB 精准选型
  • 影刀RPA×AI双剑合璧!小红书商品图片批量上传,效率提升50倍![特殊字符]
  • 从中国出发,向世界展示!AI开发者亚马逊云科技狂欢专属攻略!
  • WPF SynchronizationContext的使用
  • 影刀RPA实战:AI智能生成小红书销售日报,3分钟搞定全天数据![特殊字符]
  • Sossoldi跨平台部署完全指南:从开发到上线的财富管理应用构建
  • 终极韩语NLP指南:快速掌握KoNLPy核心功能
  • 2026年大模型技术产业化浪潮:岗位需求激增,AI大模型工程师成为高薪稀缺人才!
  • 学生党必看免费亲测降ai率工具,这些坑你别踩
  • CentOS7 交叉编译 ACE+TAO-6.5.13 安卓 arm64-v8a 静态库
  • AIGC 版权争夺战:生成内容的归属、侵权与保护难题破解
  • 如何快速使用ChromePass:完整的Chrome浏览器密码提取指南
  • Obsidian个性化定制全攻略:从基础美化到专业界面设计
  • nvm-desktop终极指南:一站式解决Node.js版本管理难题
  • 如何快速获取广州市行政区划数据:免费GIS资源完整指南
  • AI大模型应用全景指南:从传统赋能到原生创新的五大路径
  • live2d 单图转模型 单图生成模型
  • 计算机毕业设计springboot流行病信息管理系统 基于Spring Boot的流行病信息管理平台设计与实现 Spring Boot框架下的流行病信息管理系统开发