接触youBot也很久了,但还是常常也遇到一些can not find slave on eth的问题,后来师弟建议我写篇博客整理下,在查阅youBot Store和网友的一些方法,总结起来如下:主要是驱动、权限、网口配置、网线等这几个方面,可靠连接,软件和硬件为基础,结合起来才能够起作用。
youBot的驱动是利用上位机,结合网线作为传输介质,同时借助于开源的SOEM(Simple Open EtherCAT Master)来进行数据传输与解析。
这个在我们编译youbot的驱动的时候可以看到相关的一些动态链接库
- 驱动
驱动的话现在主要是youbot_driver_ros_interface这个包,https://github.com/youbot/youbot_driver_ros_interface
sudo apt-get install ros-indigo-youbot-driver-ros-interface ros-indigo-youbot-description这种方式是装在系统的/opt/ros/indigo/share下的,推荐这种方式
- 权限
安装完毕以后,还需要给普通用户赋予网络通信的权限,不然无论怎么换网口,改变ethecat的配置都会can not find slave on eth*的。
sudo setcap cap_net_raw+ep /opt/ros/indigo/lib/youbot_driver_ros_interface/youbot_driver_ros_interfacesudo ldconfig /opt/ros/indigo/lib在youbot的官网也有提到这个 http://www.youbot-store.com/wiki/index.php/ROS_Wrapper
- 网口设置
网口的设置文件在我这的是~/catkin_ws/src/youbot_driver/config/youbot-ethercat.cfg,这个是我在github上clone下来的放在了本地catkin_ws下,https://github.com/youbot/youbot_driver。在~/.bashrc环境变量配置文件中加入句export YOUBOT_CONFIG_FOLDER_LOCATION=~/catkin_ws/src/youbot_driver/config指明配置文件的位置。
按照youbot_user_manual上说的,只用改EthernetDevice = eth1这行的这个条目就行,所以常常需要我们看看host宿主机的ip端口。如我这里是eth1和eth2
- 网线问题
- firmware问题
这个地方非常特别,官方做法是说改cfg,但是并不能解决问题,http://www.youbot-store.com/wiki/index.php/The_youBot_base_motor_controller_have_to_be_of_type:_174_or_1632 后来我试过这个发现可以解决问题,indigo也一样可以用点击打开链接
最后,有其他我再补充。以下是官网上的常见问题
Errors
- No EtherCAT connection / No EtherCAT slaves found!
- The youBot base motor controller have to be of type: 174 or 1632
- Execute as a root
- error while loading shared libraries
- X EtherCAT slaves found
- ROS commands like roscd or rosmake are not working properly, although ROS was installed
- l2t exception
Other problems