实例介绍
Donkeycar是一个面向Python的极简和模块化自动驾驶库。它是为爱好者和学生开发的,旨在允许快速实验和轻松的社区贡献。
Donkeycar适合以下情况:
- 使RC车辆自动驾驶。
- 参加DIY Robocars等自动驾驶比赛。
- 尝试自动驾驶、地图制作、计算机视觉和神经网络。
- 记录传感器数据(图像、用户输入、传感器读数)。
- 通过网络、游戏手柄或RC控制器驾驶您的汽车。
- 利用社区贡献的驾驶数据。
- 使用现有CAD模型进行设计升级。
构建Donkey2后,您可以打开汽车并转到http://localhost:8887 进行驾驶。
修改您汽车的行为。Donkey车通过运行一系列事件来控制。
#Define a vehicle to take and record pictures 10 times per second. import time from donkeycar import Vehicle from donkeycar.parts.cv import CvCam from donkeycar.parts.tub_v2 import TubWriter V = Vehicle() IMAGE_W = 160 IMAGE_H = 120 IMAGE_DEPTH = 3 #Add a camera part cam = CvCam(image_w=IMAGE_W, image_h=IMAGE_H, image_d=IMAGE_DEPTH) V.add(cam, outputs=['image'], threaded=True) #warmup camera while cam.run() is None: time.sleep(1) #add tub part to record images tub = TubWriter(path='./dat', inputs=['image'], types=['image_array']) V.add(tub, inputs=['image'], outputs=['num_records']) #start the drive loop at 10 Hz V.start(rate_hz=10)
【实例截图】
【核心代码】
文件清单
└── donkeycar-f81750df7fb626a553e757fd792880721fc7c11e
├── arduino
│ ├── mono_encoder
│ │ └── mono_encoder.ino
│ └── quadrature_encoder
│ └── quadrature_encoder.ino
├── CONTRIBUTING.md
├── Dockerfile
├── donkeycar
│ ├── benchmarks
│ │ ├── tub.py
│ │ └── tub_v2.py
│ ├── config.py
│ ├── contrib
│ │ ├── __init__.py
│ │ └── robohat
│ │ ├── code.py
│ │ ├── code-robocarstore.py
│ │ ├── lib
│ │ │ └── adafruit_logging.mpy
│ │ └── rear_light.py
│ ├── geom.py
│ ├── gym
│ │ ├── gym_real.py
│ │ ├── __init__.py
│ │ └── remote_controller.py
│ ├── __init__.py
│ ├── la.py
│ ├── management
│ │ ├── base.py
│ │ ├── graph.py
│ │ ├── __init__.py
│ │ ├── joystick_creator.py
│ │ ├── makemovie.py
│ │ ├── tub_web
│ │ │ ├── base.html
│ │ │ ├── static
│ │ │ │ ├── bootstrap
│ │ │ │ │ └── 3.3.7
│ │ │ │ │ ├── css
│ │ │ │ │ │ └── bootstrap.min.css
│ │ │ │ │ ├── fonts
│ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ │ │ │ └── glyphicons-halflings-regular.woff2
│ │ │ │ │ └── js
│ │ │ │ │ └── bootstrap.min.js
│ │ │ │ ├── jquery-3.1.1.min.js
│ │ │ │ ├── nipple.js
│ │ │ │ ├── style.css
│ │ │ │ ├── tub.js
│ │ │ │ └── ui
│ │ │ │ └── 1.12.1
│ │ │ │ └── jquery-ui.min.js
│ │ │ ├── tub.html
│ │ │ └── tubs.html
│ │ └── ui
│ │ ├── car_screen.kv
│ │ ├── car_screen.py
│ │ ├── common.kv
│ │ ├── common.py
│ │ ├── __init__.py
│ │ ├── pilot_screen.kv
│ │ ├── pilot_screen.py
│ │ ├── rc_file_handler.py
│ │ ├── train_screen.kv
│ │ ├── train_screen.py
│ │ ├── tub_screen.kv
│ │ ├── tub_screen.py
│ │ ├── ui.kv
│ │ └── ui.py
│ ├── memory.py
│ ├── parts
│ │ ├── actuator.py
│ │ ├── behavior.py
│ │ ├── camera.py
│ │ ├── controller.py
│ │ ├── coral.py
│ │ ├── cv.py
│ │ ├── datastore.py
│ │ ├── datastore_v2.py
│ │ ├── dgym.py
│ │ ├── encoder.py
│ │ ├── explode.py
│ │ ├── fastai.py
│ │ ├── fast_stretch.py
│ │ ├── file_watcher.py
│ │ ├── fps.py
│ │ ├── gps.py
│ │ ├── graph.py
│ │ ├── image.py
│ │ ├── image_transformations.py
│ │ ├── imu.py
│ │ ├── __init__.py
│ │ ├── interpreter.py
│ │ ├── keras.py
│ │ ├── kinematics.py
│ │ ├── launch.py
│ │ ├── led_status.py
│ │ ├── leopard_imaging.py
│ │ ├── lidar.py
│ │ ├── line_follower.py
│ │ ├── logger.py
│ │ ├── network.py
│ │ ├── object_detector
│ │ │ └── stop_sign_detector.py
│ │ ├── odometer.py
│ │ ├── oled.py
│ │ ├── path.py
│ │ ├── perfmon.py
│ │ ├── pigpio_enc.py
│ │ ├── pins.py
│ │ ├── pipe.py
│ │ ├── pose.py
│ │ ├── pytorch
│ │ │ ├── ResNet18.py
│ │ │ ├── torch_data.py
│ │ │ ├── torch_train.py
│ │ │ └── torch_utils.py
│ │ ├── realsense2.py
│ │ ├── realsense435i.py
│ │ ├── robohat.py
│ │ ├── ros.py
│ │ ├── salient.py
│ │ ├── serial_controller.py
│ │ ├── serial_port.py
│ │ ├── simulation.py
│ │ ├── sombrero.py
│ │ ├── tachometer.py
│ │ ├── teensy.py
│ │ ├── telemetry.py
│ │ ├── text_writer.py
│ │ ├── tfmini.py
│ │ ├── throttle_filter.py
│ │ ├── transform.py
│ │ ├── tub_v2.py
│ │ ├── velocity.py
│ │ ├── voice_control
│ │ │ └── alexa.py
│ │ └── web_controller
│ │ ├── templates
│ │ │ ├── base_fpv.html
│ │ │ ├── base.html
│ │ │ ├── calibrate.html
│ │ │ ├── home.html
│ │ │ ├── pilots_list.html
│ │ │ ├── session.html
│ │ │ ├── session_list.html
│ │ │ ├── static
│ │ │ │ ├── bootstrap
│ │ │ │ │ └── 3.3.7
│ │ │ │ │ ├── css
│ │ │ │ │ │ └── bootstrap.min.css
│ │ │ │ │ ├── fonts
│ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf
│ │ │ │ │ │ ├── glyphicons-halflings-regular.woff
│ │ │ │ │ │ └── glyphicons-halflings-regular.woff2
│ │ │ │ │ └── js
│ │ │ │ │ └── bootstrap.min.js
│ │ │ │ ├── donkeycar-logo-sideways.png
│ │ │ │ ├── img_placeholder.jpg
│ │ │ │ ├── jquery-3.1.1.min.js
│ │ │ │ ├── main.js
│ │ │ │ ├── nipple.js
│ │ │ │ ├── style.css
│ │ │ │ └── ui
│ │ │ │ └── 1.12.1
│ │ │ │ └── jquery-ui.min.js
│ │ │ ├── vehicle.html
│ │ │ ├── vehicle_list.html
│ │ │ └── wsTest.html
│ │ └── web.py
│ ├── pipeline
│ │ ├── augmentations.py
│ │ ├── database.py
│ │ ├── __init__.py
│ │ ├── sequence.py
│ │ ├── training.py
│ │ └── types.py
│ ├── templates
│ │ ├── arduino_drive.py
│ │ ├── basic.py
│ │ ├── calibrate.py
│ │ ├── calibration_odometry.json
│ │ ├── cfg_arduino_drive.py
│ │ ├── cfg_basic.py
│ │ ├── cfg_complete.py
│ │ ├── cfg_cv_control.py
│ │ ├── cfg_path_follow.py
│ │ ├── cfg_simulator.py
│ │ ├── cfg_square.py
│ │ ├── complete.py
│ │ ├── cv_control.py
│ │ ├── just_drive.py
│ │ ├── myconfig.py
│ │ ├── path_follow.py
│ │ ├── simulator.py
│ │ ├── square.py
│ │ └── train.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── pytest.ini
│ │ ├── setup.py
│ │ ├── test_actuator.py
│ │ ├── test_catalog_v2.py
│ │ ├── test_circular_buffer.py
│ │ ├── test_controller.py
│ │ ├── test_datastore_v2.py
│ │ ├── test_keras.py
│ │ ├── test_kinematics.py
│ │ ├── test_launch.py
│ │ ├── test_lidar.py
│ │ ├── test_memory.py
│ │ ├── test_odometer.py
│ │ ├── test_parts.py
│ │ ├── test_path.py
│ │ ├── test_pipeline.py
│ │ ├── test_robohat.py
│ │ ├── test_scripts.py
│ │ ├── test_seekable_v2.py
│ │ ├── test_tachometer.py
│ │ ├── test_telemetry.py
│ │ ├── test_template.py
│ │ ├── test_torch.py
│ │ ├── test_train.py
│ │ ├── test_tub_v2.py
│ │ ├── test_tubwriter.py
│ │ ├── test_util_data.py
│ │ ├── test_vehicle.py
│ │ ├── test_web_controller.py
│ │ ├── test_web_socket.py
│ │ └── tub
│ │ └── tub.tar.gz
│ ├── utilities
│ │ ├── circular_buffer.py
│ │ ├── deprecated.py
│ │ ├── dk_platform.py
│ │ └── __init__.py
│ ├── utils.py
│ └── vehicle.py
├── LICENSE
├── Makefile
├── MANIFEST.in
├── pyproject.toml
├── README.md
├── scripts
│ ├── convert_to_tflite.py
│ ├── convert_to_tub_v2.py
│ ├── disable_js_mouse.sh
│ ├── freeze_model.py
│ ├── graph_listener.py
│ ├── hsv_picker.py
│ ├── multi_train.py
│ ├── pigpio_donkey.py
│ ├── preview_augumentations.py
│ ├── profile_coral.py
│ ├── profile.py
│ ├── remote_cam_view.py
│ ├── remote_cam_view_tcp.py
│ ├── salient_vis_listener.py
│ ├── tflite_convert.py
│ └── tflite_profile.py
└── setup.cfg
41 directories, 222 files
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论