在 Google Colab 上安装和运行 ROS

时间:2021-01-02 01:33:13

标签: python ubuntu google-colaboratory robot

我想让 ROS(机器人操作系统)在 Google Colab 上运行。有没有人有任何如何做到这一点的例子?我正在查看这两个链接:

https://github.com/RoboStack/jupyter-ros/issues/11

在链接中,似乎作者使它起作用,在链接中:

https://colab.research.google.com/drive/1QpSNBB339OoCJaVJ4_3bfikt0ygOC2NV

根据上面的链接,我做了如下安装ROS的代码:

# @ title Install ROS melodic

ROS_CODE_NAME = 'melodic'

#from http://wiki.ros.org/indigo/Installation/Ubuntu

# 1.2 Setup sources.list
! echo "1.2 Doing"
! sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $ (lsb_release -sc) main"> /etc/apt/sources.list.d/ros-latest.list'
! echo "1.2 Done"

# 1.3 Setup keys
! echo "1.3 Doing"
! sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116
! sudo apt-key del B01FA116

! apt --fix-broken install

! sudo dpkg --configure -a
! sudo apt-get update && sudo apt-get -f install

# add the new key
! sudo -E apt-key adv --keyserver 'hkp: //keyserver.ubuntu.com: 80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

! sudo apt clean && sudo apt update

! sudo apt install
! echo "1.3 Done"

# 1.4 Installation
! echo "1.4 Doing"
! sudo apt update
! sudo apt upgrade
! echo "1.4 Done"

# Desktop-Full Install:
! echo "1.4.1 Doing"
! sudo apt install ros-melodic-desktop-full
! echo "1.4.2 Done"

# 1.5 Initialize rosdep
! echo "1.5 Doing"
! sudo rosdep init
! rosdep update
! echo "1.5 Done"


# 1.7 Getting rosinstall (python)
! echo "1.7 Doing"
! sudo apt install python-rosinstall
! sudo apt install python-catkin-tools
! echo "1.7 Done"
! echo "All Done"

几个python模块存在问题:

dpkg: error processing package python-rosdep-modules (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ros-melodic-rqt-robot-monitor:
 ros-melodic-rqt-robot-monitor depends on python-rospkg-modules; however:
  Package python-rospkg-modules is not installed.

此外,还有几个模块也出现了以下错误(即使运行了上面提到的命令,也不能解决问题):

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python-rosdep-modules: Depends: python-rospkg-modules (> = 1.2.7) but it is not installed
                         Depends: python-rosdistro-modules (> = 0.7.5) but it is not installed
 ros-melodic-rqt-gui: Depends: python-rospkg-modules but it is not installed
 ros-melodic-rqt-robot-monitor: Depends: python-rospkg-modules but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

有人做过这样的事情吗?

谢谢!

0 个答案:

没有答案
相关问题