





```
sudo vi /etc/udev/rules.d/DJIDevice.rules

SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"

sudo usermod -a -G dialout $USER




echo "deb https://mirrors.bfsu.edu.cn/ros/ubuntu/ focal main" >> /etc/apt/sources.list.d/ros-latest.list

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

echo "SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"" >> /etc/udev/rules.d/DJIDevice.rules






```



```
sudo usermod -a -G dialout $USER

echo "deb https://mirrors.bfsu.edu.cn/ros/ubuntu/ bionic main" >> /etc/apt/sources.list.d/ros-latest.list

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

echo "SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666"" >> /etc/udev/rules.d/DJIDevice.rules

sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.bfsu.edu.cn@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.bfsu.edu.cn@g" /etc/apt/sources.list

sudo apt update
sudo apt install ros-melodic-desktop-full
sudo apt install libsdl2-dev ros-melodic-nmea-comms libcrypto++-dev
sudo apt install libexosip2-dev

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

```

## 允许root 登录
编辑sshd_config
sudo vim /etc/ssh/sshd_config
找到PermitRootLogin   取消注释 然后改为yes
重启ssh 服务
service sshd restart

```
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

```


## frp 配置

service 文件编写
sudo vi /etc/systemed/system/frpc.service

```shell

[Unit]
# 服务名称，可自定义
Description = frpcs server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
Restart=on-failure
RestartSec=5s
# 启动frps的命令，需修改为您的frps的安装路径
ExecStart = /root/ah/frp_0.45.0_linux_arm64/frpc -c /root/ah/frp_0.45.0_linux_arm64/frpc.ini
ExecReload= /root/ah/frp_0.45.0_linux_arm64/frpc reload -c /root/ah/frp_0.45.0_linux_arm64/frpc.ini

[Install]
WantedBy = multi-user.target
```
开机自启

```shell
sudo systemctl daemon-reload # 刷新配置 
sudo systemctl start frpc # 启动clash.service 
sudo systemctl enable frpc # 设置开机启动 
sudo systemctl status frpc
```



## crontab 开机自启

```shell

@reboot sleep 2;bash shell.sh
```
## ubuntu 文件系统修复

```shell
fsck -y /dev/sda1     # /dev/sda1 要修复的硬盘路径
```




### ros代码开机自启


```shell
sudo apt-get install ros-melodic-robot-upstart   #安装依赖
rosrun robot_upstart install dji_osdk_ros/launch/dji_vehicle_node.launch   #设置ros服务
sudo systemctl daemon-reload && sudo systemctl start dji  #启动ros 服务
rosrun robot_upstart uninstall dji  #删除开机自启服务

```