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

网站wap版在线做分析图的网站

网站wap版,在线做分析图的网站,企业邮箱的登录方式,高校 网站建设实施方案【从0开始自动驾驶】用python做一个简单的自动驾驶仿真可视化界面 废话几句废话不多说#xff0c;直接上源码目录结构init.pysimulator.pysimple_simulator_app.pyvehicle_config.json 废话几句 自动驾驶开发离不开仿真软件成品仿真软件种类多https://zhuanlan.zhihu.com/p/3… 【从0开始自动驾驶】用python做一个简单的自动驾驶仿真可视化界面 废话几句废话不多说直接上源码目录结构init.pysimulator.pysimple_simulator_app.pyvehicle_config.json 废话几句 自动驾驶开发离不开仿真软件成品仿真软件种类多https://zhuanlan.zhihu.com/p/321771761#:~:text%E5%8D%95%E5%B0%B1%E8%87%AA%E5%8A%A8%E9%A9%BE%E9%A9%B6%E4%BB%BF%E7%9C%9F,%E5%90%84%E8%87%AA%E7%9A%84%E5%8F%AF%E5%8F%96%E4%B9%8B%E5%A4%84%E3%80%82问题在于 软件大多为WINDOWS环境不一定满足开发环境需求软件大多收费受版权影响软件较为复杂普通开发任务无需复杂仿真软件 那么 以最简单的方式从0开始搭建一个可视化仿真软件直接使用python matplot库进行可视化后段采用简单车辆运动学控制可视化界面 废话不多说直接上源码 目录结构 src simple_simulator_app.pyconfig vehicle_config.json lib init.pysimulator.py init.py import json import copydef import_veh_cfg(veh_cfg_path):with open(veh_cfg_path, r, encodingutf-8) as load_f:veh_cfg_ori json.load(load_f)return veh_cfg_oridef init_veh_cfg(veh_cfg_path):veh_cfg_ori import_veh_cfg(veh_cfg_path)# print(veh_cfg_ori)veh_cfg copy.deepcopy(veh_cfg_ori)return veh_cfg simulator.py 使用class编写的仿真器输入为车辆x、y、yaw进行可视化后段接入运动学等函数可随意进行扩展 import numpy import matplotlib.pyplot as pltclass simulator:def init_simulator(self, veh_cfg):plt.ion()self.veh_cfg veh_cfgdef draws(self, x, y, yaw, xmin, xmax, ymin, ymax):self.veh_x xself.veh_y yself.veh_yaw yaw # 角度plt.clf() # 清除之前画的图plt.xlim(xmin, xmax)plt.ylim(ymin, ymax)plt.title(simulator)plt.xlabel(X/m)plt.ylabel(Y/m)ax plt.gca()ax.set_aspect(1) # 保持纵横比self.draw_veh()plt.pause(0.001)def draws_close(self):plt.ioff()def draw_veh(self): # yaw以x轴为0逆时针为正plt.plot(self.veh_x, self.veh_y, o, colorr)self.ca_veh_points()plt.plot(self.veh_x_points, self.veh_y_points, colorr)def ca_veh_points(self): # 计算车辆包络框的所有点half_veh_width self.veh_cfg[width] / 2self.veh_yaw_rad numpy.deg2rad(self.veh_yaw)self.veh_x_points [self.veh_x (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.cos(self.veh_yaw_rad) half_veh_width * numpy.sin(self.veh_yaw_rad),self.veh_x (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.cos(self.veh_yaw_rad)- half_veh_width * numpy.sin(self.veh_yaw_rad),self.veh_x- (self.veh_cfg[rear_overhang]) * numpy.cos(self.veh_yaw_rad)- half_veh_width * numpy.sin(self.veh_yaw_rad),self.veh_x- (self.veh_cfg[rear_overhang]) * numpy.cos(self.veh_yaw_rad) half_veh_width * numpy.sin(self.veh_yaw_rad),self.veh_x (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.cos(self.veh_yaw_rad) half_veh_width * numpy.sin(self.veh_yaw_rad),]self.veh_y_points [self.veh_y (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.sin(self.veh_yaw_rad)- half_veh_width * numpy.cos(self.veh_yaw_rad),self.veh_y (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.sin(self.veh_yaw_rad) half_veh_width * numpy.cos(self.veh_yaw_rad),self.veh_y- (self.veh_cfg[rear_overhang]) * numpy.sin(self.veh_yaw_rad) half_veh_width * numpy.cos(self.veh_yaw_rad),self.veh_y- (self.veh_cfg[rear_overhang]) * numpy.sin(self.veh_yaw_rad)- half_veh_width * numpy.cos(self.veh_yaw_rad),self.veh_y (self.veh_cfg[length] - self.veh_cfg[rear_overhang])* numpy.sin(self.veh_yaw_rad)- half_veh_width * numpy.cos(self.veh_yaw_rad),] simple_simulator_app.py 主函数入口 import timefrom lib.init import * from lib.simulator import *if __name__ __main__:veh_cfg_path r./config/vehicle_config.jsonveh_cfg init_veh_cfg(veh_cfg_path)simulator_ simulator()simulator_.init_simulator(veh_cfg)for i in range(0, 20):simulator_.draws(i, 15 i * 0.3, 30 i, 0, 30, 0, 30) # veh_x, veh_y, veh_yaw, xmin, xmax, ymin, ymaxtime.sleep(0.1)plt.pause(1000) # 暂停几秒看一看结果 vehicle_config.json -车辆配置文件 {vehicle_type: test,front_wheel_base: 1.3,rear_wheel_base: 1.3,width: 1.9,length: 4,rear_overhang: 0.4,max_steer_wheel_angle: 35.0,steer_ratio: 17.5 }
http://www.w-s-a.com/news/949751/

相关文章:

  • 网站建设管理人员济宁网站建设top
  • 桂林网站建设桂林网站的元素有哪些
  • 广东网站开发推荐网页制作个人简历模板教程
  • e建网保定百度seo公司
  • 网站建设中html代码网络培训课堂app
  • 无锡做网站seo自己做的网站如何上传网上
  • 园林景观网站模板小白怎么做跨境电商
  • 找第三方做网站 需要注意企业网站带数据库
  • 北京南站到北京站flash网站制作单选框和复选框ui组件
  • 网站建设核电集团网站设计案例
  • 宝塔做的网站能不能访问上海的广告公司网站建设
  • 网站会员系统方案新能源网站建设哪家好
  • 全球网站域名域名被墙查询
  • 做期货看资讯什么网站好哈尔滨网站设计联系方式
  • 建站宝盒免费下载上海网论坛网址
  • 国内最有趣的25个网站推广流程
  • 红河做网站抖音小程序怎么挂到抖音上
  • 高度重视机关门户网站建设外包
  • 网站里面送礼物要钱怎么做代码网站开发怎么对接客户
  • 泰州网站制作策划如何做网站需求
  • 门户网站优化报价软件技术公司
  • 怎样换网站logo公司名字大全集免费
  • 为网站网站做推广各类最牛网站建设
  • 网站用自己的电脑做服务器佛山做网站制作公司
  • 一个网站如何做cdn加速器如何上传网站数据库
  • 汝州住房和城乡建设局新网站营销网站定位
  • yy直播官网seo引擎优化是什
  • 做影视网站违法莫品牌营销是什么
  • 全网最稳最低价自助下单网站wordpress电影网站主题
  • 域名更换网站温州建设工程网站