ROS在线练习课程正在逐步完善中,目前以ROS官网中文资料制作,可参考:

https://www.shiyanlou.com/courses/854  邀请码 U23ERF8H

安装Ubuntu+ROS对于零Linux基础的小伙伴有些困难,最近发现了一个学习Linux非常好的网站实验楼,链接如下:

****https://www.shiyanlou.com/****

非常好奇如何实现了,于是查阅了一些资料,觉得最好的如下:

1    实验楼这个网站是怎样实现的在线linux虚拟机?

2    基于 VNCServer + noVNC 构建 Docker 桌面系统

3    Docker一些资料汇总

4    https://hub.docker.com

4.1 https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc/

4.2 https://hub.docker.com/r/kaixhin/vnc-ros/

4.3 https://hub.docker.com/_/ros/

----~~~~----

ubuntu-desktop-lxde-vnc

  1. relaybot@relaybot-desktop:~$ docker search dorowu
  2. NAME DESCRIPTION STARS OFFICIAL AUTOMATED
  3. dorowu/ubuntu-desktop-lxde-vnc Ubuntu with openssh-server and NoVNC 114 [OK]
  4. dorowu/ubuntu-ssh-ttyjs Ubuntu with openssh server and tty.js enab... 8 [OK]
  5. dorowu/apt-repo-server apt-repo-server is a debian repository ser... 6 [OK]
  6. dorowu/ubuntu-lxqt-vnc 5 [OK]
  7. dorowu/qemu-iso Boot VM by QEMU/KVM with ISO and access it... 4 [OK]
  8. dorowu/lightop-ubuntu-trusty-ttyjs 2 [OK]
  9. dorowu/ntopng 1 [OK]
  10. hardock14/dorowu-docker-ubuntu-vnc-desktop dorowus images with additional software 1 [OK]
  11. dorowu/online-document.amd64 0
  12. dorowu/lightop-ubuntu-trusty-lxde 0 [OK]
  13. dorowu/qdk2 Create Docker App on QNAP NAS in QPKG format 0 [OK]
  14. dorowu/glusterfs-keepalived 0 [OK]
  15. dorowu/lightop 0 [OK]
  16. dorowu/pekaboo2qnap 0
  17. dorowu/ubuntu_amd64 0
  18. dorowu/nodejs_amd64 0
  19. dorowu/ruby_amd64 0
  20. dorowu/ubuntu_armhf 0
  21. dorowu/qiot-mongodb_amd64 0
  22. dorowu/qdk2-build 0
  23. dorowu/qiot-mongodb_armhf 0
  24. dorowu/dashing 0
  25. dorowu/supershell 0
  26. dorowu/mattermostdocker_db 0
  27. dorowu/qiot-mongo-express_amd64 0
  28. relaybot@relaybot-desktop:~$ docker pull dorowu/ubuntu-desktop-lxde-vnc
  29. Using default tag: latest
  30. latest: Pulling from dorowu/ubuntu-desktop-lxde-vnc
  31. aafe6b5e13de: Pull complete
  32. 0a2b43a72660: Pull complete
  33. 18bdd1e546d2: Pull complete
  34. 8198342c3e05: Pull complete
  35. f56970a44fd4: Pull complete
  36. da6ac41ac9c8: Pull complete
  37. 6f3a5e5efdea: Downloading [============> ] 111.4MB/441.9MB
  38. d9dd7dde4295: Download complete
  39. ab365adf65d2: Download complete
  40. 06b2cd083c64: Download complete
  41. c524c4444fb2: Download complete

kaixhin/vnc-ros

  1. relaybot@relaybot-desktop:~$ docker search ros
  2. NAME DESCRIPTION STARS OFFICIAL AUTOMATED
  3. mono Mono is an open source implementation of M... 233 [OK]
  4. ros The Robot Operating System (ROS) is an ope... 111 [OK]
  5. aerospike Aerospike the reliable, high performance... 76 [OK]
  6. cirros CirrOS is a Tiny OS that specializes in ru... 38 [OK]
  7. neurodebian NeuroDebian provides neuroscience research... 36 [OK]
  8. osrf/ros The Robot Operating System (ROS) is an ope... 28 [OK]
  9. quantumobject/docker-ros-base ROS-Base container (Robot Operating System) 5 [OK]
  10. px4io/px4-dev-ros Container with PX4 tool chain and SITL sim... 3 [OK]
  11. px4io/px4-ros-full 2 [OK]
  12. virgiletn/docker-ros Set of usefull tools for running ros throu... 1 [OK]
  13. personalrobotics/ros-openrave ROS Indigo Base + Personal Robotics OpenRAVE 1 [OK]
  14. kaixhin/vnc-ros Ubuntu Core 14.04 + LXDE desktop + Firefox... 1 [OK]
  15. shadowrobot/ubuntu-ros-indigo-build-tools DEPRECATED!!! Ubuntu 14.04 ROS Indigo imag... 0 [OK]
  16. autharl/ros ROS images 0 [OK]
  17. timn/fedora-ros Robot Operating System (ROS) on Fedora 0 [OK]
  18. harmish/ros Images of ROS (Robot Operating System) 0 [OK]
  19. jacknlliu/tiago-ros A tiago robot ros development environment. 0 [OK]
  20. kaixhin/ros Ubuntu Core 14.04 + ROS Jade Base. 0 [OK]
  21. pmallozzi/ros Ros 0 [OK]
  22. nhzio/ros-weave rancheros weave + iptables 0 [OK]
  23. ivs0/b-ros Jenkins builder for ROS 0 [OK]
  24. mjenz/ros-datacollection A container based on mjenz/ros-indigo-perc... 0 [OK]
  25. jacknlliu/ros ROS desktop-full docker images with Qt C++... 0 [OK]
  26. sigproc/ros 0 [OK]
  27. diegoferigo/ros Dockerfile for my ROS Kinetic desktop-full... 0 [OK]
  28. relaybot@relaybot-desktop:~$ docker pull ros
  29. Using default tag: latest
  30. latest: Pulling from library/ros
  31. bd97b43c27e3: Waiting
  32. 6960dc1aba18: Waiting
  33. 2b61829b0db5: Waiting
  34. 1f88dc826b14: Waiting
  35. 73b3859b1e43: Waiting
  36. 27d60414a57e: Waiting
  37. d93e52c3383b: Waiting
  38. 357b9c9b1672: Waiting
  39. e7c791091ba5: Waiting
  40. a55e61abbe79: Waiting
  41. 3bdd92756f16: Waiting
  42. a75e7cd84889: Waiting
  43. ^C
  44. relaybot@relaybot-desktop:~$ docker pull kaixhin/vnc-ros
  45. Using default tag: latest
  46. latest: Pulling from kaixhin/vnc-ros
  47. 16da43b30d89: Pull complete
  48. 1840843dafed: Pull complete
  49. 91246eb75b7d: Pull complete
  50. 7faa681b41d7: Pull complete
  51. 97b84c64d426: Pull complete
  52. f6f12794daea: Downloading [==========> ] 44.32MB/204.3MB
  53. e7841d035bd3: Download complete
  54. 440e2abbd651: Download complete
  55. 09e4cb06ebb5: Download complete
  56. 067189fe4086: Download complete
  57. 52c18283b71e: Download complete
  58. 49495db30f44: Download complete
  59. 32e45df178f9: Downloading [=> ] 20.52MB/629.6MB
  60. a138ae9132ab: Waiting
  61. 15247c05ac4a: Waiting

----~~~~----

当镜像完全下载后可以进行查看,如下:

  1. relaybot@relaybot-desktop:~$ docker images -a
  2. REPOSITORY TAG IMAGE ID CREATED SIZE
  3. dorowu/ubuntu-desktop-lxde-vnc latest ec8a8836ea5f 6 weeks ago 1.23GB
  4. kaixhin/vnc-ros latest 0948d9f58857 5 months ago 2.71GB

----ubuntu-desktop-lxde-vnc使用说明----

  1. relaybot@relaybot-desktop:~$ docker run -it --rm -p 6080:80 dorowu/ubuntu-desktop-lxde-vnc
  2. /usr/lib/python2.7/dist-packages/supervisor/options.py:297: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  3. 'Supervisord is running as root and it is searching '
  4. 2017-06-20 23:01:40,847 CRIT Supervisor running as root (no user in config file)
  5. 2017-06-20 23:01:40,847 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
  6. 2017-06-20 23:01:40,869 INFO RPC interface 'supervisor' initialized
  7. 2017-06-20 23:01:40,870 CRIT Server 'unix_http_server' running without any HTTP authentication checking
  8. 2017-06-20 23:01:40,870 INFO supervisord started with pid 19
  9. 2017-06-20 23:01:41,873 INFO spawned: 'xvfb' with pid 26
  10. 2017-06-20 23:01:41,876 INFO spawned: 'pcmanfm' with pid 27
  11. 2017-06-20 23:01:41,879 INFO spawned: 'lxpanel' with pid 28
  12. 2017-06-20 23:01:41,882 INFO spawned: 'lxsession' with pid 29
  13. 2017-06-20 23:01:41,884 INFO spawned: 'x11vnc' with pid 30
  14. 2017-06-20 23:01:41,887 INFO spawned: 'novnc' with pid 31
  15. 2017-06-20 23:01:41,971 INFO exited: lxsession (exit status 1; not expected)
  16. 2017-06-20 23:01:41,994 INFO exited: lxpanel (exit status 1; not expected)
  17. 2017-06-20 23:01:42,951 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  18. 2017-06-20 23:01:42,951 INFO success: pcmanfm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  19. 2017-06-20 23:01:42,951 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  20. 2017-06-20 23:01:42,951 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  21. 2017-06-20 23:01:42,973 INFO spawned: 'lxsession' with pid 52
  22. 2017-06-20 23:01:43,055 INFO spawned: 'lxpanel' with pid 54
  23. 2017-06-20 23:01:44,106 INFO success: lxpanel entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  24. 2017-06-20 23:01:44,106 INFO success: lxsession entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  25. 2017-06-20 23:01:58,177 INFO waiting for novnc, pcmanfm, lxpanel, xvfb, x11vnc, lxsession to die
  26. 2017-06-20 23:01:58,463 INFO stopped: novnc (terminated by SIGQUIT (core dumped))
  27. 2017-06-20 23:01:58,465 INFO stopped: x11vnc (exit status 2)
  28. 2017-06-20 23:01:58,669 INFO stopped: lxsession (terminated by SIGABRT (core dumped))
  29. 2017-06-20 23:01:59,871 INFO stopped: lxpanel (terminated by SIGQUIT (core dumped))
  30. 2017-06-20 23:02:00,056 INFO stopped: pcmanfm (terminated by SIGQUIT (core dumped))
  31. 2017-06-20 23:02:00,060 INFO stopped: xvfb (exit status 1)
  32. 2017-06-20 23:02:00,076 CRIT Supervisor running as root (no user in config file)
  33. 2017-06-20 23:02:00,076 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
  34. 2017-06-20 23:02:00,077 INFO RPC interface 'supervisor' initialized
  35. 2017-06-20 23:02:00,077 CRIT Server 'unix_http_server' running without any HTTP authentication checking
  36. 2017-06-20 23:02:00,077 INFO supervisord started with pid 19
  37. 2017-06-20 23:02:00,867 INFO spawned: 'xvfb' with pid 75
  38. 2017-06-20 23:02:00,870 INFO spawned: 'pcmanfm' with pid 76
  39. 2017-06-20 23:02:00,873 INFO spawned: 'lxpanel' with pid 77
  40. 2017-06-20 23:02:00,878 INFO spawned: 'lxsession' with pid 78
  41. 2017-06-20 23:02:00,881 INFO spawned: 'x11vnc' with pid 79
  42. 2017-06-20 23:02:00,884 INFO spawned: 'novnc' with pid 80
  43. 2017-06-20 23:02:01,913 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  44. 2017-06-20 23:02:01,914 INFO success: pcmanfm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  45. 2017-06-20 23:02:01,914 INFO success: lxpanel entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  46. 2017-06-20 23:02:01,914 INFO success: lxsession entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  47. 2017-06-20 23:02:01,914 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  48. 2017-06-20 23:02:01,914 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Ubuntu的VNC桌面

Docker图像提供HTML5 VNC界面访问Ubuntu 16.04 LXDE桌面环境。

快速开始

运行码头图像并打开端口 6080

  1. docker run -it --rm -p 6080:80 dorowu/ubuntu-desktop-lxde-vnc

浏览http://127.0.0.1:6080/

<img src =“https://raw.github.com/fcwu/docker-ubuntu-vnc-desktop/master/screenshots/lxde.png?v1”width = 700 />

连接VNC Viewer并通过VNC密码进行保护

将VNC服务端口5900转发到主机

  1. docker run -it --rm -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc

现在,打开vnc查看器并连接到端口5900.如果要通过密码保护vnc服务,请设置环境变量VNC_PASSWORD,例如

  1. docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc

提示将在浏览器或vnc查看器中询问密码。

故障排除

  1. boot2docker连接问题,https://github.com/fcwu/docker-ubuntu-vnc-desktop/issues/2

----补充局域网(外网访问)----

获取IP信息:

两种方法:

1 $ docker exec ec8a8836ea5f ifconfig eth0 | grep "inet addr:"

注意,ec8a8836ea5f为ID,依据实际情况进行调整。

  1. relaybot@relaybot-desktop:~$ docker exec fdfc8eda1 ifconfig eth0 | grep "inet addr:"
  2. inet addr:172.17.0.2 Bcast:0.0.0.0 Mask:255.255.0.0
  3. relaybot@relaybot-desktop:~$ ifconfig -a
  4. docker0 Link encap:Ethernet HWaddr 02:42:16:25:5a:77
  5. inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
  6. inet6 addr: fe80::42:16ff:fe25:5a77/64 Scope:Link
  7. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  8. RX packets:21801 errors:0 dropped:0 overruns:0 frame:0
  9. TX packets:31279 errors:0 dropped:0 overruns:0 carrier:0
  10. collisions:0 txqueuelen:0
  11. RX bytes:6093261 (6.0 MB) TX bytes:30175014 (30.1 MB)
  12.  
  13. enp3s0 Link encap:Ethernet HWaddr 20:6a:8a:03:40:6b
  14. UP BROADCAST MULTICAST MTU:1500 Metric:1
  15. RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  16. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
  17. collisions:0 txqueuelen:1000
  18. RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
  19. Interrupt:16
  20.  
  21. lo Link encap:Local Loopback
  22. inet addr:127.0.0.1 Mask:255.0.0.0
  23. inet6 addr: ::1/128 Scope:Host
  24. UP LOOPBACK RUNNING MTU:65536 Metric:1
  25. RX packets:23603 errors:0 dropped:0 overruns:0 frame:0
  26. TX packets:23603 errors:0 dropped:0 overruns:0 carrier:0
  27. collisions:0 txqueuelen:1
  28. RX bytes:6543144 (6.5 MB) TX bytes:6543144 (6.5 MB)
  29.  
  30. vethd735054 Link encap:Ethernet HWaddr f6:0a:d2:7f:58:70
  31. inet6 addr: fe80::f40a:d2ff:fe7f:5870/64 Scope:Link
  32. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  33. RX packets:21801 errors:0 dropped:0 overruns:0 frame:0
  34. TX packets:31319 errors:0 dropped:0 overruns:0 carrier:0
  35. collisions:0 txqueuelen:0
  36. RX bytes:6398475 (6.3 MB) TX bytes:30180429 (30.1 MB)
  37.  
  38. wlp5s0 Link encap:Ethernet HWaddr 70:f1:a1:ca:75:52
  39. inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
  40. inet6 addr: fe80::3c12:a5b2:8cf9:246/64 Scope:Link
  41. UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  42. RX packets:1167103 errors:0 dropped:0 overruns:0 frame:0
  43. TX packets:965289 errors:0 dropped:0 overruns:0 carrier:0
  44. collisions:0 txqueuelen:1000
  45. RX bytes:1572330174 (1.5 GB) TX bytes:97246007 (97.2 MB)

----

2 在novnc网页中启动命令行ifconfig -a

----vnc-ros----

参考资料:

----https://hub.docker.com/r/kaixhin/vnc-ros/----

简短的介绍
Ubuntu Core 14.04 + LXDE桌面+ Firefox浏览器+ TightVNC服务器+ ROS Jade Desktop Full。
完整描述


VNC-ROS

Ubuntu Core 14.04 + LXDE桌面+ Firefox浏览器+ TightVNC服务器+ ROSJade桌面版。默认使用尾部运行作为守护进程。

建立

包括密码txt与TightVNC的密码(默认情况下这是“密码”)。这个长度必须至少为8个字符,如果更长,则会被截断。

用法

应该更改默认密码。这样做启动一个容器然后运行docker exec <id> bash -c "echo -e '<password>\n<password>\nn' | vncpasswd"

用于自动映射VNC端口使用docker run -dP kaixhin/vnc-rosdocker port <id>检索端口。
用于指定端口手动使用docker run -d -p <port>:5901 kaixhin/vnc-ros
外壳可以照常使用docker run -it kaixhin/vnc-ros bash

引文

如果您发现这在研究中有用,请考虑引用这项工作

----https://hub.docker.com/_/ros/----

简短的介绍
机器人操作系统(ROS)是构建机器人应用程序的开源项目。
完整描述

支持的标签和相应的Dockerfile链接

快速参考

什么是ROS

机器人操作系统(ROS)是一组可帮助您构建机器人应用程序的软件库和工具。从驱动程序到最先进的算法,以及强大的开发人员工具,ROS具有您下一个机器人项目所需的功能。这一切都是开源的。

wikipedia.org/wiki/Robot_Operating_System

如何使用此图像

Dockerfile在您的ROS应用程序项目中创建一个

  1. FROM ros:indigo
  2. # place here your application's setup specifics
  3. CMD [ "roslaunch", "my-ros-app my-ros-app.launch" ]

然后,您可以构建并运行Docker映像:

  1. $ docker build -t my-ros-app .
  2. $ docker run -it --rm --name my-running-app my-ros-app

部署用例

ROS的这种停泊图像旨在提供一个简化和一致的平台来构建和部署分布式机器人应用程序。由官方Ubuntu镜像和ROS官方Debian软件包组成,它包括最近支持的快速访问和下载版本。这为机器人研究和工业界提供了一个简单的方法来开发,重用和运送软件,用于自主操作和任务规划,控制动态,本地化和映射,群体行为以及一般系统集成。

开发具有前所未有的算法的复杂系统仍然具有挑战性,因为机器人软件的重复性和可重复性可能会在创新竞争中脱颖而出。随着编码,调优和部署跨越许多工程学科的多个软件组件的难度增加,更加协作的方法变得具有吸引力。然而,在多个机器人和平台上共享和维护软件集合的技术难题比许多较小的实验室和企业承担的时间和精力要长一些。

随着软件容器的进步和标准化,机器人专家被准备获得大量改进的开发工具来构建和发布软件。为了减轻采用新实践的不断增长的痛苦和技术挑战,我们专注于为ROS提供这些新技术的官方资源。

部署建议

可用的标签包括支持的发行版,以及基于最常见的元包依赖关系的层次标签,旨在具有小的占位面积和简单的配置:

  • ros-core:barebone ROS安装
  • ros-base:基本工具和库(也标记为具有LTS版本的发行版名称latest
  • robot:机器人的基本安装
  • perception:感知任务的基本安装

共同元套餐,如休息desktop,并desktop-full使用自动生成的回购协议下OSRF的泊坞枢纽轮廓托管在这里。这些元数据包包括图形依赖关系,并挂接许多其他大型软件包,如X11,X服务器等。因此,为了保持官方映像的精简和安全性,桌面软件包仅由OSRF的配置文件托管。

ROS使用~/.ros/存储日志的目录和调试信息。如果希望将这些文件保留在生成它们的容器的生命周期之外,则该~/.ros/文件夹可以挂载到主机上的外部卷上,或者派生的映像可以指定由Docker引擎管理的卷。默认情况下,容器作为root用户运行,因此/root/.ros/将是这些文件的完整路径。

例如,如果希望使用.ros已经驻留在其本地主目录中的自己的文件夹,使用用户名ubuntu,则可以使用附加的卷参数简单地启动该容器:

  1. $ docker run -v "/home/ubuntu/.ros/:/root/.ros/" ros

设备

某些应用程序可能需要设备访问以从连接的摄像机获取图像,控制人机接口设备的输入或用于硬件加速的GPUS。这可以使用--device运行参数来将设备安装在容器内,从而提供硬件访问中的进程。

网络

ROS运行时“图”是使用ROS通信基础设施松散耦合的进程对等网络(可能分布在机器之间)。ROS实现了多种不同的通信方式,包括通过服务进行的同步RPC式通信,主题数据的异步流传输以及参数服务器上数据的存储。为了遵守每个容器一个进程的最佳做法,Docker网络可以用于将几个正在运行的ROS进程串联在一起。有关ROS NetworkSetup wik文章的更多详细信息,或请参阅下面的部署示例。

部署示例

如果我们希望我们的所有ROS节点彼此轻松交谈,我们可以使用虚拟网络连接单独的容器。在这短短的例子中,我们将创建一个虚拟网络,旋转了一个新的容器中运行roscore标榜master的新网络服务,然后生成一个信息发布者和预订过程在同一网络上的服务。

构建图像

构建包含使用此ROS教程的ROS映像 Dockerfile:

  1. FROM ros:indigo-ros-base
  2. # install ros tutorials packages
  3. RUN apt-get update && apt-get install -y
  4. ros-indigo-ros-tutorials \
  5. ros-indigo-common-tutorials \
  6. && rm -rf /var/lib/apt/lists/

然后从同一目录中构建图像:

  1. $ docker build --tag ros:ros-tutorials .

创建网络

要创建一个新的网络foo,我们使用network命令:

  1. docker network create foo

现在我们有一个网络,我们可以创建服务。服务在网络上广告位置,可以方便地解析服务特定容器的位置/地址。我们将使用这个确保我们的ROS节点可以找到并连接到我们的ROS master

运行服务

为ROS主机创建一个容器并通告它的服务:

  1. $ docker run -it --rm \
  2. --net foo \
  3. --name master \
  4. ros:ros-tutorials \
  5. roscore

现在,您可以看到主机正在运行,并准备好管理我们的其他ROS节点。要添加我们的talker节点,我们需要将相关环境变量指向主服务:

  1. $ docker run -it --rm \
  2. --net foo \
  3. --name talker \
  4. --env ROS_HOSTNAME=talker \
  5. --env ROS_MASTER_URI=http://master:11311 \
  6. ros:ros-tutorials \
  7. rosrun roscpp_tutorials talker

然后在另一个终端中,listener类似地运行节点:

  1. $ docker run -it --rm \
  2. --net foo \
  3. --name listener \
  4. --env ROS_HOSTNAME=listener \
  5. --env ROS_MASTER_URI=http://master:11311 \
  6. ros:ros-tutorials \
  7. rosrun roscpp_tutorials listener

好的!你应该看到listener现在正在回应每个消息的talker广播。然后,您可以列出容器并查看如下内容:

  1. $ docker service ls
  2. SERVICE ID NAME NETWORK CONTAINER
  3. 67ce73355e67 listener foo a62019123321
  4. 917ee622d295 master foo f6ab9155fdbe
  5. 7f5a4748fb8d talker foo e0da2ee7570a

并为服务:

  1. $ docker ps
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. a62019123321 ros:ros-tutorials "/ros_entrypoint.sh About a minute ago Up About a minute 11311/tcp listener
  4. e0da2ee7570a ros:ros-tutorials "/ros_entrypoint.sh About a minute ago Up About a minute 11311/tcp talker
  5. f6ab9155fdbe ros:ros-tutorials "/ros_entrypoint.sh About a minute ago Up About a minute 11311/tcp master

内省

好的,现在我们看到两个节点正在沟通,让我们进入一个容器,做一些内省,究竟是什么主题:

  1. $ docker exec -it master bash
  2. $ source /ros_entrypoint.sh

如果我们然后使用rostopic列出发布的消息主题,我们应该看到如下:

  1. $ rostopic list
  2. /chatter
  3. /rosout
  4. /rosout_agg

拆除

为了拆除我们所做的结构,我们只需要停止容器和服务。我们可以使用Ctrl^C我们启动容器的位置停止并移除容器,或者使用我们给它们的名称的stop命令:

  1. $ docker stop master talker listener
  2. $ docker rm master talker listener

撰写

现在,您已经对手动引导分布式ROS示例感到欣慰,我们可以尝试使用它自动化docker-compose

首先创建一个名为的文件夹rostutorials,并将我们之前使用的Dockerfile移动到此目录中。然后创建一个docker-compose.yml在同一目录中命名的yaml文件,然后粘贴以下内容:

  1. version: '2'
  2. services:
  3. master:
  4. build: .
  5. container_name: master
  6. command:
  7. - roscore
  8. talker:
  9. build: .
  10. container_name: talker
  11. environment:
  12. - "ROS_HOSTNAME=talker"
  13. - "ROS_MASTER_URI=http://master:11311"
  14. command: rosrun roscpp_tutorials talker
  15. listener:
  16. build: .
  17. container_name: listener
  18. environment:
  19. - "ROS_HOSTNAME=listener"
  20. - "ROS_MASTER_URI=http://master:11311"
  21. command: rosrun roscpp_tutorials listener

现在从同一个文件夹中,使用docker-copose启动我们的ROS节点,并指定它们在自己的网络上共存:

  1. $ docker-compose up -d

请注意,rostutorials_default现在已经创建了一个名为的新网络,您可以进一步检查:

  1. $ docker network inspect rostutorials_default

我们可以监视每个服务的记录输出,如监听器节点,如下所示:

  1. $ docker-compose logs listener

最后,我们可以使用docker-copose从同一个目录中停止并删除所有相关的容器:

  1. $ docker-compose stop
  2. $ docker-compose rm

注意:自动生成的网络rostutorials_default将会停留在docker引擎的整个生命周期中,或者直到您使用它来显式删除它docker network rm

更多资源

ROS.org:主ROS网站
维基:查找教程并了解更多
ROS答案:提问。获取答案
博客:保持最新的
OSRF:开源机器人基金会

执照

ROS的核心是根据标准的三条BSD许可证进行许可。这是一个非常宽松的开放许可证,允许在商业和封闭源产品中重复使用。您可以从Opensource.org BSD 3-Clause页面和维基百科的BSD许可证条目中找到有关BSD许可证的更多信息。

虽然ROS的核心部分根据BSD许可证获得许可,但其他许可证通常用于社区软件包,例如Apache 2.0许可证,GPL许可证,MIT许可证,甚至专有许可证。ROS生态系统中的每个包都需要指定许可证,以便您能够快速识别包装是否符合您的许可需求。

----https://hub.docker.com/r/osrf/ros/----

简短的介绍
机器人操作系统(ROS)是构建机器人应用程序的开源项目。
完整描述

OSRF Docker图像

这个repo托管Dockerfiles用于生成OSRF项目的官方图像,包括Docker Hub上的onbuild存储库:

官方图书馆

ROS  

Gazebo  

OSRF资料

ROS  

ROS2  

Gazebo  

SROS  

这个repo还包括必要的脚本和配置文件来自动生成Dockerfiles。有关进一步的文档,请参阅doc目录。

----ROS在线学习---

The ROS Autonomous Vehicles 101 and ROS-Industrial 101 courses are now available. Ready to built the future today? Keep advancing your ROS!
ROS Autonomous Vehicles 101
Learn the essentials for doing autonomous cars control using ROS. You are going to learn:

    ✓ what are the sensors required for an autonomous car and how to access them using ROS
    ✓ how to do autonomous navigation using a GPS
    ✓ how to create an obstacle avoider for an autonomous car
    ✓ how to interface ROS with a car that follows the DBW interface

*Watch the ROS Autonomous Vehicles 101  Video Tutorials
Start Learning Now
ROS-Industrial 101

Learn ROS-Industrial to extend the advanced capabilities of ROS software to manufacturing. After this course you will be able to:

    ✓ know the basics of URDF for industrial robots
    ✓ create a MoveIt package for your industrial robot.
    ✓ perform motion planning using Python.

*Watch the ROS-Industrial 101  Video Tutorials

.

Start Learning Now
REFER & EARN free course
You can earn 1 year course for free by inviting your teacher to use Robot Ignite Academy to teach ROS effectively.​​​​​​​
Happy Learning!
The Construct team
 

----End----

Ubuntu与ROS的Docker桌面系统与ROS在线练习课程(在线Linux虚拟机)的更多相关文章

  1. Docker练习例子:基于 VNCServer + noVNC 构建 Docker 桌面系统

    0. 安装docker 这一步略,网上有好多教程,一般出现装不上的原因,也就是网速问题了,这个我也很难帮你. 1. 下载指定的镜像images docker pull dorowu/ubuntu-de ...

  2. 改变ubuntu终端显示语言(桌面系统是中文,终端提示是英文)

    打开终端: $ vi .bashrc 最后添加 if [ "$TERM"="linux" ] ;then export LANGUAGE=en_US expor ...

  3. Linux 桌面玩家指南:04. Linux 桌面系统字体配置要略

    特别说明:要在我的随笔后写评论的小伙伴们请注意了,我的博客开启了 MathJax 数学公式支持,MathJax 使用$标记数学公式的开始和结束.如果某条评论中出现了两个$,MathJax 会将两个$之 ...

  4. linux桌面系统开启windows远程访问

    本文基于centos系统,且默认你的桌面系统已经安装完成 1.在linux中安装如下软件 sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epe ...

  5. Ubuntu 16.04 使用docker资料汇总与应用docker安装caffe并使用Classifier(ros kinetic+usb_cam+caffe)

    Docker是开源的应用容器引擎.若想简单了解一下,可以参考百度百科词条Docker.好像只支持64位系统. Docker官网:https://www.docker.com/ Docker - 从入门 ...

  6. 使用 Docker/LXC 迅速启动一个桌面系统

    使用 Docker/LXC 迅速启动一个桌面系统 Docker 是 dotCloud 最近几个月刚宣布的开源引擎,旨在提供一种应用程序的自动化部署解决方案,简单的说就是,在 Linux 系统上迅速创建 ...

  7. Ubuntu 16.04 LTS 64位系统 安装Docker

    本文开发环境为Ubuntu 16.04 LTS 64位系统,通过apt的docker官方源安装最新的Docker CE(Community Edition),即Docker社区版,是开发人员和小型团队 ...

  8. Redhat/Ubuntu/Windows下安装Docker

    Redhat/Ubuntu/Windows下安装Docker 什么是Docker Docker是Docker.inc公司开源的一个基于LXC技术之上构建的Container容器引擎,基于Go语言并遵从 ...

  9. 【转】Ubuntu做日常开发电脑的系统是一种怎样的体验

    [原文]https://www.toutiao.com/i6594291159911105031/ Ubuntu 我现在已经基本不开windows了.学习娱乐开发基本都在Ubuntu 首先你要接受的是 ...

随机推荐

  1. 轻谈Normalize.css

    Normalize.css 是 * ? Normalize.css只是一个很小的CSS文件,但它在默认的HTML元素样式上提供了跨浏览器的高度一致性.相比于传统的CSS reset , Normali ...

  2. mvn设置

    mvn仓库网址: https://mvnrepository.com 安装好maven后,一定要确认安装路径下的setting.xml与本地仓库中的setting.xml一致. 坐标: 什么是坐标? ...

  3. 剑指Offer——最长不包含重复字符的子字符串

    Solution 动态规划. f(i)表示包含第i个字符的最长子串. 如果第i个字符没在之前出现过,那么f(i) = f(i - 1) + 1 如果第i个字符在之前出现过,这个时候应该分两种情况,假设 ...

  4. LeetCode——Increasing Triplet Subsequence

    Question Given an unsorted array return whether an increasing subsequence of length 3 exists or not ...

  5. unix_timestamp() 和 from_unixtime()

    unix_timestamp() 将时间转换为时间戳.(date 类型数据转换成 timestamp 形式整数) select unix_timestamp('2016-03-23 11:10:10' ...

  6. Docker 推送镜像到 阿里Docker镜像

    登录 阿里云Docker镜像 https://cr.console.aliyun.com 创建一个镜像 成功之后点击  “管理” 阿里有详细的 使用说明 PS : 注意的地方是 sudo docker ...

  7. HDFS读写流程learning

    有许多对流程进行描述的博客,但是感觉还是应当学习一遍代码,不然总感觉怪怪的,https://blog.csdn.net/popsuper1982/article/details/51615285,首先 ...

  8. java classloader原理深究

    前面已经写过一篇关于java classloader的拙文java classloader原理初探. 时隔几年,再看一遍,觉得有些地方显得太过苍白,于是再来一篇: 完成一个Java类之后,经过java ...

  9. wamp升级php7

    原文:http://blog.csdn.net/cheng6251/article/details/50730441 1.下载php7   http://windows.PHP.net/downloa ...

  10. 使用jquery.jqprint.js 实现的打印功能,IE9不能进行打印预览、火狐打印空白界面

    提示的内容:SCRIPT438: 对象不支持“ExecWB”属性或方法 首先解决IE9不能打印预览的问题: 查找了一大推资料 ,有两种说法:一种是IE的安全性级别太高:一种是需要安装什么   微软we ...