前提说明:虚拟机、ubuntu-18.04.1

1、操作流程:

1)参考教程链接1,第一步输入roscore指令查看ROS的版本、节点、端号等内容时出现“Command 'roscore' not found, but can be installed with: sudo apt install python-roslaunch”,按提示输入指令“sudo apt install python-roslaunch”,此时出现““Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?”的问题”

 2)参考教程链接2和3,把apt进程全部杀死,再次输入“roscore”指令,按提示输入指令“sudo apt install python-roslaunch”即可。操作过程如下图所示:

 下图表示正在下载中

此时再输入roscore指令,可以查到版本等信息

 细节展示:

通过下面的命令来生成所有含有 apt 的进程列表:

ps -A | grep apt

 通过下面的命令来杀死进程:

sudo kill -9 进程ID号

可以查看系统内存在的内核版本列表:

sudo dpkg --get-selections |grep linux
sudo dpkg --get-selections

查看当前Ubuntu系统使用的内核版本:

uname -a

3)根据教程链接1,再打开一个新的终端(Termial),输入指令“rosrun turtlesim turtlesim_node”,看看是否能弹出一个小乌龟窗口,但提示not found:

 按照提示输入指令“sudo apt install robash"后,再次输入指令“rosrun turtlesim turtlesim_node”,但是显示Command not found

4)参考教程链接6,rosrun(运行对应节点)

用法:rosrun + 结点,例如: rosrun turtlesim。其中,turtlesim是ros安装好后带的学习用的功能包,输入完代码以后双击tab键可以显示出其所有节点。按理说输入 rosrun turtlesim turtlesim_node即可显示小乌龟仿真器页面。

但是  rosrun turtlesim双击Tab键后,按照提示输入指令sudo apt install rospack-tools。

安装完毕后,再次双击或回车 rosrun turtlesim,均没有反应。

5)

2、参考链接

1)测试ROS是否安装成功https://blog.csdn.net/weixin_45532870/article/details/125621819

2)解决 “Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?”的问题https://blog.csdn.net/w5688414/article/details/82254845

3)技术|修复 Ubuntu 中“Unable to lock the administration directory (/var/lib/dpkg/)”的 (linux.cn)

4)虚拟机VMware安装教程https://blog.csdn.net/m0_55879913/article/details/127298691

5)在虚拟机中安装ubuntu-18.04.1-desktop-amd64https://mp.weixin.qq.com/s/vuaPF25PUVywgAA0tEvr8w

6)ROS命令行工具使用讲解https://blog.csdn.net/qq_52533790/article/details/121461938

7)解决roslaunch按Tab键没反应问题https://blog.csdn.net/weixin_43262513/article/details/88061692

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐