首页 > 编程语言 >AirSim 自动驾驶仿真 (2-3) python控制无人机 win10

AirSim 自动驾驶仿真 (2-3) python控制无人机 win10

时间:2023-01-16 04:55:05浏览次数:61  
标签:python NED system 运动学 Unreal win10 AirSim

1首先搭建好环境

参考

 

2 python控制

https://blog.csdn.net/Zhaoxi_Li/article/details/108002544

官方代码位置

 

自己pythonj教程

https://www.cnblogs.com/gooutlook/p/15851233.html

 

3开启环境

无人机模式运行

 

 

4运行python代码

原厂目录下运行没问题

自己的脚本要添加airssim路径 否警报错

 手动添加airsim遍历路径

import sys
#sys.path.append("/home/dongdong/3Code/Airsim/AirSim/PythonClient") #ubnutu
sys.path.append("E:/v0_Project/V2_labray/v4_Airsim/v0_AirsimAPI/Airsim171/PythonClient")#win10

#import setup_path  #导入库路径 被代替

 启动

 

 

 更多其他控制

https://www.cnblogs.com/gooutlook/p/15851233.html

 

其他

4.4 天气API

默认天气效果是关闭的,如果想启用天气效果,首先调用函数simEnableWeather(True)

各种天气效果可以使用simSetWeatherParameter方法来实现,输入是一个参数结构体WeatherParameter,例如:

client.simSetWeatherParameter(airsim.WeatherParameter.Rain, 0.25);

 第二个参数取值范围是0-1,第一个参数有如下属性。 

class WeatherParameter:
    Rain = 0
    Roadwetness = 1
    Snow = 2
    RoadSnow = 3
    MapleLeaf = 4
    RoadLeaf = 5
    Dust = 6
    Fog = 7

  

注意 RoadwetnessRoadSnow 和 RoadLeaf 效果需要自己添加 材质 。

具体细节可以参考对应示例文件

 

4.6 坐标系统
All AirSim API uses NED coordinate system, i.e., +X is North, +Y is East and +Z is Down. All units are in SI system. Please note that this is different from coordinate system used internally by Unreal Engine. In Unreal Engine, +Z is up instead of down and length unit is in centimeters instead of meters. AirSim APIs takes care of the appropriate conversions. The starting point of the vehicle is always coordinates (0, 0, 0) in NED system. Thus when converting from Unreal coordinates to NED, we first subtract the starting offset and then scale by 100 for cm to m conversion. The vehicle is spawned in Unreal environment where the Player Start component is placed. There is a setting called OriginGeopoint in settings.json which assigns geographic longitude, longitude and altitude to the Player Start component.

(1) getMultirotorState
调用一次则返回一次无人机状态。该状态包括碰撞(collision)、估计运动学(estimated kinematics)(即通过融合传感器计算的运动学)和时间戳(timestamp)(从纪元开始的纳秒)。运动学包含6个量:位置(position)、方向(orientation)、线速度和角速度、线加速度和角加速度。请注意,simple_slight目前不支持状态估计器,这意味着对于simple_flight飞行,估计和地面真实运动学值是相同的。然而,除了角加速度,估计的运动学可用于PX4。所有的量都在NED坐标系中,除了角速度和加速度在body框架中之外,在世界坐标系中使用国际单位制。
————————————————

标签:python,NED,system,运动学,Unreal,win10,AirSim
From: https://www.cnblogs.com/gooutlook/p/17054605.html

相关文章

  • python django学生选课系统
    pythondjango学生选课系统后端:Pythondjango数据库:MySQL前端:htmlcssjs实现功能:登录、注册、查看自己信息、修改自己信息等学生:看课、选课、查学分老师:创建课程、......
  • python利用subprocess执行shell命令
    subprocess以及常用的封装函数运行python的时候,我们都是在创建并运行一个进程。像Linux进程那样,一个进程可以fork一个子进程,并让这个子进程exec另外一个程序。在Python中,......
  • Python django 公寓管理系统
    Pythondjango公寓管理系统django公寓租房系统django酒店订购系统django公寓订购系统技术:Pythondjango数据库:MySQL前端:htmlcssjs涉及到的功能:登录、注册、......
  • Python django 会议室管理系统
    Pythondjango会议室管理系统django会议室申请系统django会议室系统技术:Pythondjango数据库:MySQL涉及功能:登录、注册、登出、管理员登录、管理用户信息等添加会......
  • Python django 图书馆管理系统
    Pythondjango图书馆管理系统技术:Python  django数据库:sqlite3(或MySQL)前段:html css  js 功能:注册,注销,改密码,添加图书,添加图书照片,查看图书,普通用户只能查看......
  • python之pyserial模块
    pyserial模块封装了对串口的访问,兼容各种平台(Windows、Linux、MACOS等)。其支持的特性如下:所有平台基于类的接口相同端口可以通过python来设置支持不同数据长度、停止......
  • python创建6个随机数
    代码块red_balls=[xforxinrange(1,34)]selected_balls=sample(red_balls,6)selected_balls.sort()selected_balls.append(randint(1,16))......
  • python读取pcap流量
    fromscapy.allimport*packet0=rdpcap('G:/testcic/input/ubuntu_chrome_discord_7.pcap')importos#读取dir_path目录下的文件dir_path=r'G:/testcic/input/'fil......
  • Python爬虫-第四章-1-多线程多进程并发爬取Ⅰ
    多线程多进程用的方式#DemoDescribe:多线程写法fromthreadingimportThread#线程frommultiprocessingimportProcess#进程#start--------1,多线程调用的方式一......
  • Python爬虫-第四章-1-多线程多进程并发爬取Ⅱ
    线程池使用案例:一次性开辟一些线程,用户直接给线程池提交任务,线程任务的调度交给线程池#DemoDescribe:线程池和进程池fromconcurrent.futuresimportThreadPoolExecutor,......