youbot起驅動問題 No EtherCAT connection:No socket connection on eth0:No EtherCAT slaves found:

總結起來如下:主要是驅動、權限、網口配置、bashrc文件配置,網線等這幾個方面,可靠連接,軟件和硬件爲基礎,結合起來才能夠起作用

           一、驅動

驅動的話現在主要是youbot_driver_ros_interface這個包,但是它依賴與youbot_driver和youbot_description這兩個

sudo apt-get install ros-indigo-youbot-driver-ros-interface ros-indigo-youbot-description
1、youbot_driver: 個人理解是就是KUKA公司youbot這款機器人的底層函數也可叫做API 也可叫youbot的原生驅動,如何在你的ubuntu裝這個youbot_driver,請參考官網 http://www.youbot-store.com/wiki/index.php/Youbot_driver

這種方式是裝在系統的/opt/ros/indigo/share下的,推薦這種方式。

2、youbot_driver_ros_interface:個人理解就是ROS去調用youbot_driver的一個封裝過程,便於我們用ROS的那一套去控制youbot,這個可以叫做youbot在ROS中的驅動,這個是建立在youbot的原生驅動驅動上的,這個在roubot_driver裝好後,就可以裝了,如何裝?請參考官網:http://www.youbot-store.com/wiki/index.php/ROS_Wrapper

二、權限

安裝完畢以後,還需要給普通用戶賦予網絡通信的權限,不然無論怎麼換網口,改變ethecat的配置都會can not find slave on eth*的。
sudo setcap cap_net_raw+ep /opt/ros/indigo/lib/youbot_driver_ros_interface/youbot_driver_ros_interface
在youbot的官網也有提到這個http://www.youbot-store.com/wiki/index.php/ROS_Wrapper

sudo ldconfig /opt/ros/indigo/lib

三、網口設置

在終端中輸入ifconfig 就可以看到的網口編號,看看你的第一個編號是多少,然後修改youbot-ethercat.cfg這個文件,這個文件在youbot_driver文件夾中的config文件夾中,我的路徑是 /opt/ros/indigo/share/youbot_driver/config,我的youbot-ethercat.cfg文件內容如下:

[EtherCAT]
EthernetDevice = eth0
EtherCATUpdateRate_[usec] = 1000
EtherCATTimeout_[usec] = 500      #timeout value in us for tx frame to return to rx
MaximumNumberOfEtherCATErrors = 100
MailboxTimeout_[usec] = 200
BaseJointControllerName = TMCM-174
BaseJointControllerNameAlternative = TMCM-1632
ManipulatorJointControllerName = TMCM-KR-841

ManipulatorJointControllerNameAlternative = TMCM-1610

bashrc文件配置

打開bashrc文件:  $ gedit ~/.bashrc
我的最後幾行這是這樣的:
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/opt/ros/indigo/share:/opt/ros/indigo/stacks:~/catkin_ws/src
export YOUBOT_CONFIG_FOLDER_LOCATION=/opt/ros/indigo/share/youbot_driver/config/

source ~/catkin_ws/devel/setup.bash
source /opt/ros/indigo/setup.bash   
這兩個source要注意順序,一般放在最後的才起作用,我的情況是,我的youbot驅動都放在系統的opt中的,而我的程序包放在本地的catkin_ws文件下的。
所以當我要啓動驅動時,要把下面這句放在最後
source /opt/ros/indigo/setup.bash  
當我要跑程序,編譯我的包時,我得把下面這句放在最後,不然它就找不到我的包
source ~/catkin_ws/devel/setup.bash
如果那位大神能有什麼解決辦法,可以給我留言

、youbot機器人上面怎麼插網線的

我的機器人網線連接:EtherCAT1連接我的電腦,EtherCAT0連接的底座

網線怎麼插,該插哪個口,請參考官網:http://www.youbot-store.com/wiki/index.php/Controlling_youBot_from_external_PC

六、官網的解決方案:點擊

  1. http://www.youbot-store.com/wiki/index.php/Technical_Support_Software

最後提醒:當用外部電腦通過網線控制youbot時,最好不要開啓youbot自帶的PC



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章