ROS知识【12】:用户的功能包覆盖系统功能包
一、前言
功能包覆蓋,指工作空間原有功能包;現(xiàn)在將新版本導(dǎo)入后,覆蓋原有功能包;其實(shí)不是物理上覆蓋,是用路徑覆蓋的。本篇以ros-tutorlists的導(dǎo)入為例,介紹實(shí)現(xiàn)方法。
二 安裝教程包
2.1 生成基本ros工作空間
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_init_workspace?
2.1 用apt安裝到系統(tǒng)默認(rèn)的工作空間內(nèi)
sudo apt install ros-melodic-ros-tutorials
2.2 用rospack查看被安裝的教程
rospack find roscpp-tutorials
可以通過(guò)package.xml找到當(dāng)前的ros-tutorials教程地址(下邊用)
注意:這里/opt/ros/melodic/share路徑下,就是ros系統(tǒng)默認(rèn)工作空間。
三、在github下載ros_tutorials
3.1 找出github的ros-tutorials路徑
rospack find roscpp-tutorials? ? ? ? ? ? ? ??/opt/ros/melodic/share/ roscpp-tutorials
roscd? roscpp-tutorials查看當(dāng)前包github來(lái)源信息:
cat package.xml3.2 下載新的roscpp-tutorials包
????????進(jìn)入自建工作空間;從github上克倫功能包roscpp-tutorials到本地
cd ~/catkin_ws/src git clone https://github.com/ros/ros_tutorials.git下載完成,將github的ros-tutorials下載在本地!
四、編譯工作空間catkin_ws
????????然后編譯catkin_ws工作空間并設(shè)置環(huán)境變量;注意:如果不編譯,系統(tǒng)將無(wú)法找到該功能包,必須編譯后才能有效,切記!
????????編譯三部曲:
cd ~/catkin_ws catkin_make soutce ./devel/setup.bash????????再次查找?roscpp-tutorials包:??????
rospack find roscpp-tutorials????????此時(shí),已經(jīng)是catkin_ws下的roscpp-tutorials了,這就是因?yàn)椤緎outce ./devel/setup.bash】的覆蓋作用引起的。參考下圖:
五、編譯eclipse工程
參考資料? ? ?????????使用ros系統(tǒng),需要用到許多數(shù)據(jù)包,有些時(shí)候你需要使用的ROS數(shù)據(jù)包并沒(méi)有Debian包的形式,這時(shí)你需要從數(shù)據(jù)源安裝它。代碼開發(fā)人員通常使用的有三種主流的版本控制系統(tǒng):SVN,Git和Mercurial。下面介紹一下如何使用Git來(lái)下載你需要的代碼資源。 git clone https://github.com/ros/ros_tutorials.git |
總結(jié)
以上是生活随笔為你收集整理的ROS知识【12】:用户的功能包覆盖系统功能包的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ROS知识【11-1】:建立用户自己的工
- 下一篇: Windows10怎么在当前目录,打开c