菜单

TK1初学软件教程-安装Turtlebot(十一)

2018年5月18日 - TK1初学软件教程

TK1初学软件教程-安装Turtlebot

说明:

准备:

安装uvcvideo驱动

安装USB驱动

安装Turtlebot:

mkdir ~/ROS
cd ~/ROS
touch installTurtlebot.sh
vim installTurtlebot.sh
sudo apt-get install ros-indigo-turtlebot ros-indigo-turtlebot-apps ros-indigo-turtlebot-interactions  ros-indigo-kobuki-ftdi ros-indigo-rocon-remocon ros-indigo-rocon-qt-library ros-indigo-ar-track-alvar-msgs
chmod +x installTurtlebot.sh
./installTurtlebot.sh
mkdir -p ~/turtlebot_ws/src/
cd ~/turtlebot_ws/src/
git clone https://github.com/turtlebot/turtlebot_simulator.git
cd ..
catkin_make
source /home/ubuntu/turtlebot_ws/devel/setup.bash

全源码安装

测试:

ls /dev/kobuki
roslaunch turtlebot_bringup minimal.launch 
rqt -s kobuki_dashboard
roslaunch turtlebot_teleop keyboard_teleop.launch

Hack OpenCV:

/opt/ros/<ros-version>/lib/pkgconfig/cv_bridge.pc
/opt/ros/<ros-version>/lib/pkgconfig/image_geometry.pc
/opt/ros/<ros-version>/share/cv_bridge/cmake/cv_bridgeConfig.cmake
/opt/ros/<ros-version>/share/image_geometry/cmake/image_geometryConfig.cmake
$ mkdir ~/hacksopencv
$ sudo cp /opt/ros/indigo/lib/pkgconfig/cv_bridge.pc ~/hacksopencv/cv_bridge.pc-bak
$ sudo cp /opt/ros/indigo/lib/pkgconfig/image_geometry.pc ~/hacksopencv/image_geometry.pc-bak
$ sudo cp /opt/ros/indigo/share/cv_bridge/cmake/cv_bridgeConfig.cmake ~/hacksopencv/cv_bridgeConfig.cmake-bak
$ sudo cp /opt/ros/indigo/share/image_geometry/cmake/image_geometryConfig.cmake ~/hacksopencv/image_geometryConfig.cmake-bak
sed -i 's/原字符串/替换字符串/g' filename
sed -i 's/\/usr\/lib\/arm-linux-gnueabihf\/libopencv_ocl.so.2.4.8//g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 
sed -i 's/\/usr\/lib\/arm-linux-gnueabihf/\/usr\/lib/g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 
sed -i 's/2.4.8/2.4.13/g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 
#!/bin/bash
#author: ncnynl 
#Website:ncnynl.com

#New category
mkdir ~/hacksopencv    

#backup files
sudo cp /opt/ros/indigo/lib/pkgconfig/cv_bridge.pc ~/hacksopencv/cv_bridge.pc-bak
sudo cp /opt/ros/indigo/lib/pkgconfig/cv_bridge.pc ~/hacksopencv/cv_bridge.pc

sudo cp /opt/ros/indigo/lib/pkgconfig/image_geometry.pc ~/hacksopencv/image_geometry.pc-bak
sudo cp /opt/ros/indigo/lib/pkgconfig/image_geometry.pc ~/hacksopencv/image_geometry.pc

sudo cp /opt/ros/indigo/share/cv_bridge/cmake/cv_bridgeConfig.cmake 
~/hacksopencv/cv_bridgeConfig.cmake-bak
sudo cp /opt/ros/indigo/share/cv_bridge/cmake/cv_bridgeConfig.cmake 
~/hacksopencv/cv_bridgeConfig.cmake

sudo cp /opt/ros/indigo/share/image_geometry/cmake/image_geometryConfig.cmake  ~/hacksopencv/image_geometryConfig.cmake-bak

sudo cp /opt/ros/indigo/share/image_geometry/cmake/image_geometryConfig.cmake  ~/hacksopencv/image_geometryConfig.cmake

#handle
cd ~/hacksopencv

#remove each instance “/usr/lib/arm-linux-gnueabihf/libopencv_ocl.so.2.4.8;“
sed -i 's/\/usr\/lib\/arm-linux-gnueabihf\/libopencv_ocl.so.2.4.8//g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 


#replace each instance of “/usr/lib/arm-linux-gnueabihf/” with “/usr/lib“
sed -i 's/\/usr\/lib\/arm-linux-gnueabihf/\/usr\/lib/g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 

#replace each instance of “2.4.8” with “2.4.12” (or the current version of OpenCV in opencv4tegra package)
sed -i 's/2.4.8/2.4.13/g' cv_bridge.pc image_geometry.pc cv_bridgeConfig.cmake  image_geometryConfig.cmake 

#cp back 
#sudo cp ~/hacksopencv/cv_bridge.pc /opt/ros/indigo/lib/pkgconfig/cv_bridge.pc 
#sudo cp ~/hacksopencv/image_geometry.pc /opt/ros/indigo/lib/pkgconfig/image_geometry.pc 
#sudo cp ~/hacksopencv/cv_bridgeConfig.cmake /opt/ros/indigo/share/cv_bridge/cmake/cv_bridgeConfig.cmake 
#sudo cp ~/hacksopencv/image_geometryConfig.cmake /opt/ros/indigo/share/image_geometry/cmake/image_geometryConfig.cmake  
chmod +x hacksopencv.sh 
sudo ./hacksopencv.sh 

问题:

[rospack] Warning: error while crawling /home/xxx: boost::filesystem::status: Permission denied: "/home/xxx/.gvfs"
~$ sudo umount /home/congleetea/.gvfs
~$ rm -rf .gvfs/

参考:

发表评论