Ver código fonte

使用串口时新增udev规则命名imu板被识别到的串口名为/dev/mini_imu

adam_zhuo 2 anos atrás
pai
commit
3037583dfd
2 arquivos alterados com 9 adições e 2 exclusões
  1. 7 0
      initdev_mini_imu.sh
  2. 2 2
      serial_6dof_imu/cfg/param.yaml

+ 7 - 0
initdev_mini_imu.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+echo 'KERNEL=="ttyUSB*", SUBSYSTEMS=="usb",ATTRS{idVendor}=="1a86",ATTRS{idProduct}=="7523",SYMLINK+="mini_imu"' >  /etc/udev/rules.d/mini_imu_board.rules # Mini_Imu
+
+service udev reload
+sleep 2
+service udev restart
+

+ 2 - 2
serial_6dof_imu/cfg/param.yaml

@@ -18,7 +18,7 @@
 # History:
 #   20211122:init this file.
 ###########################################################
-imu_dev: /dev/ttyUSB0
+imu_dev: /dev/mini_imu
 pub_topic_hz: 100
 
 imu_link_name: base_imu_link
@@ -31,4 +31,4 @@ yaw_zero_topic: yaw_zero_topic
 
 yaw_zero_service: /serial_imu_service/setYawZero_service
 get_yaw_data_srv: /serial_imu_service/getYawData_service
-set_iic_addr_srv: /serial_imu_service/setIICAddr_service
+set_iic_addr_srv: /serial_imu_service/setIICAddr_service