ROS实际问题解决方法

时间:2023-03-08 22:36:47
ROS实际问题解决方法

1.建立软链接

在路径cd /etc/udev/rules.d中,建立例如50-rfid.rules的文件,它会根据文件名之前的50 51等判断优先级,50的优先级就大于51

如:  KERNEL=="ttyUSB*",SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="f1d95271",MODE:="0777", GROUP:="dialout", SYMLINK+="rfid"

它是一个ttyUSB的设备,设备号可能是0 1 2 后面厂商号设备号,一般不同的厂商号设备号都不同,但很多的U转串的厂商号设备号一样,找软件该.后面序列号,随便改一个.它建立软链接后的名字是rfid.以上.

解释如下:The files in this directory are read by udev(7) and used when events are performed by the kernel.  The udev daemon watches this directory  with inotify so that changes to these files are automatically picked up, for this reason they must be files and not symlinks to another location as in the case in Debian.
PS:如何查看serial number?

cd /dev
dmesg |tail

会显示如:

/dev  dmesg |tail
[29853.633958] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[29853.633969] cp210x -:1.0: device disconnected
[29853.903252] usb -: new full-speed USB device number using xhci_hcd
[29853.921143] usb -: New USB device found, idVendor=10c4, idProduct=ea60
[29853.921153] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[29853.921158] usb -: Product: CP2102 USB to UART Bridge Controller
[29853.921162] usb -: Manufacturer: Silicon Labs
[29853.921165] usb -: SerialNumber: 9528f1d
[29853.922558] cp210x -:1.0: cp210x converter detected
[29853.924222] usb -: cp210x converter now attached to ttyUSB0

看SerialNumber后面9528f1d即为ATTRS{serial}=="f1d95271"这里要替换的序列号.

因为不规范的设备,厂商号设备号都写的一样没办法区分

2.建立工作空间

不论是第几个工作空间,只要名字不一样,都可以

ROS实际问题解决方法
source /opt/ros/indigo/setup.sh
mkdir -p ~/angie/src
cd ~/angie/src
catkin_init_workspace
cd ~/angie
catkin_make
source ~/angie/devel/setup.bash
ROS实际问题解决方法

angie可以随意替换,就是工作空间名字啦

这样的两个工作空间是一个版本的,使用不同版本,参见ROSWIKI

3.boost:foreach函数  作用是遍历每一个元素

blog.csdn.net/jiangfriend/article/details/1713619 我当时参考的资料

4.shell的find和grep使用的方法,请抽空笔记整理

www.cnblogs.com/skynet/archive/2010/12/25/1916873.html

5.C++继承与派生

www.cnblogs.com/fzhe/archive/2012/12/25/2832250.html