栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Ubuntu镜像系统配置

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Ubuntu镜像系统配置

Ubuntu镜像系统配置
  • pip3指令安装
    • 更换Ubuntu国内的软件源
    • 安装pip3
  • 释放串口
  • 安装系统范围的依赖项
  • 设置虚拟环境
  • 安装 Donkeycar Python 代码
  • 修复 CSIC 相机上的粉红色调
  • 从模板创建 Donkeycar
  • 草帽设置
    • Robo HAT MM1 设置
  • 相机设置
  • 保持最新状态

pip3指令安装 更换Ubuntu国内的软件源

Ubuntu系统自带的源都是国外的网址,国内用户在使用的时候网速比较慢。一个软件的下载是十分缓慢的,甚至在安装一些软件或者库的时候,是不能成功下载的,所以非常建议大家更换国内的源,这里建议大家使用阿里源,步骤如下:
备份原来的源:输入命令

sudo cp /etc/apt/sources.list /etc/apt/sources_init.list

更换源:输入命令sudo vi /etc/apt/sources.list,使用vi打开文档,将下边的阿里源复制进去,然后点击保存关闭

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 

如果你的Ubuntu安装了图形化操作界面,那么可以使用命令sudo gedit /etc/apt/sources.list,这样你就可以使用geit软件来修改文档,

更新源:sudo apt-get update
更新软件:更新源之后,sudo apt-get upgrade

安装pip3

输入命令sudo apt-get install python3-pip
输入pip3 -V查看pip3的版本,如果正常显示pip3的版本,说明已经成功安装

释放串口
sudo usermod -aG dialout 
sudo systemctl disable nvgetty
安装系统范围的依赖项
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install -y python3-dev python3-pip
sudo apt-get install -y libxslt1-dev libxml2-dev libffi-dev libcurl4-openssl-dev libssl-dev libpng-dev libopenblas-dev
sudo apt-get install -y git nano
sudo apt-get install -y openmpi-doc openmpi-bin libopenmpi-dev libopenblas-dev
设置虚拟环境
pip3 install -U pip testresources setuptools
pip3 install -U futures==3.1.1 protobuf==3.12.2 pybind11==2.5.0
pip3 install -U cython==0.29.21 pyserial
pip3 install -U future==0.18.2 mock==4.0.2 h5py==2.10.0 keras_preprocessing==1.1.2 keras_applications==1.0.8 gast==0.3.3
pip3 install -U absl-py==0.9.0 py-cpuinfo==7.0.0 psutil==5.7.2 portpicker==1.3.1 six requests==2.24.0 astor==0.8.1 termcolor==1.1.0 wrapt==1.12.1 google-pasta==0.2.0
pip3 install -U gdown

# This will install tensorflow as a system package
pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow==2.3.1
安装 Donkeycar Python 代码

从 Github 获取最新的驴车。

git clone https://github.com/autorope/donkeycar
cd donkeycar
git checkout master
pip3 install -e .[nano]
修复 CSIC 相机上的粉红色调

(如果出现此类问题,可以采用下方解决方案)

wget https://www.dropbox.com/s/u80hr1o8n9hqeaj/camera_overrides.isp
sudo cp camera_overrides.isp /var/nvidia/nvcam/settings/
sudo chmod 664 /var/nvidia/nvcam/settings/camera_overrides.isp
sudo chown root:root /var/nvidia/nvcam/settings/camera_overrides.isp
从模板创建 Donkeycar

使用以下命令创建一组文件来控制您的 Donkey:
donkey createcar --path ~/mycar
配置选项
查看新创建的目录中的myconfig.py

cd ~/mycar
nano myconfig.py

每行都有一个注释标记。注释文本显示默认值。如果要进行编辑以覆盖默认值,请通过删除 # 和选项第一个字符之前的任何空格来取消注释该行。
例子:
# STEERING_LEFT_PWM = 460
变成:
STEERING_LEFT_PWM = 500

草帽设置

如果您有阔边帽板HAVE_SOMBRERO = True,请在myconfig.py 中进行设置。

Robo HAT MM1 设置

如果您有 Robo HAT MM1 板HAVE_ROBOHAT = True,请在myconfig.py 中进行设置。还要根据您的设置设置以下变量.

#ROBOHAT MM1
HAVE_ROBOHAT = True            # set to true when using the Robo HAT MM1 from Robotics Masters.  This will change to RC Control.
MM1_STEERING_MID = 1500         # Adjust this value if your car cannot run in a straight line
MM1_MAX_FORWARD = 2000          # Max throttle to go fowrward. The bigger the faster
MM1_STOPPED_PWM = 1500
MM1_MAX_REVERSE = 1000          # Max throttle to go reverse. The smaller the faster
MM1_SHOW_STEERING_VALUE = False
# Serial port 
# -- Default Pi: '/dev/ttyS0'
# -- Jetson Nano: '/dev/ttyTHS1'
# -- Google coral: '/dev/ttymxc0'
# -- Windows: 'COM3', Arduino: '/dev/ttyACM0'
# -- MacOS/Linux:please use 'ls /dev/tty.*' to find the correct serial port for mm1 
#  eg.'/dev/tty.usbmodemXXXXXX' and replace the port accordingly
MM1_SERIAL_PORT = '/dev/ttyTHS1' # Serial Port for reading and sending MM1 data (raspberry pi default)

# adjust controller type as Robohat MM1
CONTROLLER_TYPE='MM1'
# adjust drive train for web interface
DRIVE_TRAIN_TYPE = 'MM1'

相机设置

当使用基于 Sony IMX219 的相机,并且您使用的是默认汽车模板时,您需要编辑myconfg.py以具有:CAMERA_TYPE = "CSIC". 对于垂直翻转图像CSIC_CAM_GSTREAMER_FLIP_PARM = 6,如果您必须将相机安装在旋转位置,这会很有帮助。集IMAGE_W = 224和也IMAGE_H = 224。

保持最新状态
cd /donkeycar
git pull
donkey createcar --path ~/mycar --overwrite
``
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/339082.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号