问题描述:New ROS Distro index url: 'https://raw.githubusercontent.com/ros/rosdistro/f2392c54afcfa19910ceabaa54485479e377cfd6/index-v4.yaml

ROS Distro index file associate with commit 'f2392c54afcfa19910ceabaa54485479e377cfd6'
New ROS Distro index url: 'https://raw.githubusercontent.com/ros/rosdistro/f2392c54afcfa19910ceabaa54485479e377cfd6/index-v4.yaml'
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1256, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 951, in send
    self.connect()
  File "/usr/lib/python3.8/http/client.py", line 1418, in connect
    super().connect()
  File "/usr/lib/python3.8/http/client.py", line 922, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/rosdistro/loader.py", line 48, in load_url
    fh = urlopen(url, timeout=timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1357, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/bloom-generate", line 11, in <module>
    load_entry_point('bloom==0.11.2', 'console_scripts', 'bloom-generate')()
  File "/usr/lib/python3/dist-packages/bloom/commands/generate.py", line 82, in main
    create_subparsers(parser, generator_cmds)
  File "/usr/lib/python3/dist-packages/bloom/commands/generate.py", line 68, in create_subparsers
    desc = load_generator_description(generator_cmd)
  File "/usr/lib/python3/dist-packages/bloom/commands/generate.py", line 56, in load_generator_description
    return entry_point.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/bloom/generators/debian/__init__.py", line 1, in <module>
    from .generator import DebianGenerator
  File "/usr/lib/python3/dist-packages/bloom/generators/debian/generator.py", line 84, in <module>
    from bloom.packages import get_package_data
  File "/usr/lib/python3/dist-packages/bloom/packages.py", line 46, in <module>
    from bloom.config import BLOOM_CONFIG_BRANCH
  File "/usr/lib/python3/dist-packages/bloom/config.py", line 122, in <module>
    get_non_eol_distros_prompt()
  File "/usr/lib/python3/dist-packages/bloom/rosdistro_api.py", line 191, in get_non_eol_distros_prompt
    rosdistro_index = get_index()
  File "/usr/lib/python3/dist-packages/bloom/rosdistro_api.py", line 121, in get_index
    _rosdistro_index = rosdistro.get_index(get_index_url())
  File "/usr/lib/python3/dist-packages/rosdistro/__init__.py", line 104, in get_index
    yaml_str = load_url(url)
  File "/usr/lib/python3/dist-packages/rosdistro/loader.py", line 59, in load_url
    raise URLError(str(e) + ' (%s)' % url)
urllib.error.URLError: <urlopen error <urlopen error [Errno 111] Connection refused> (https://raw.githubusercontent.com/ros/rosdistro/f2392c54afcfa19910ceabaa54485479e377cfd6/index-v4.yaml)>

原因分析:

联网问题,其访问https://raw.githubusercontent.com/ros/rosdistro/f2392c54afcfa19910ceabaa54485479e377cfd6/index-v4.yaml,访问不到。

解决方案:

打开/usr/lib/python3/dist-packages/rosdistro目录下的__init__.py
将DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml’注释,并且添加DEFAULT_INDEX_URL = ‘file:///etc/ros/rosdistro/master/index-v4.yaml’。
在etc/ros/rosdistro/master文件夹下创建index-v4.yaml文件,内容是:

%YAML 1.1

ROS index file

see REP 153: http://ros.org/reps/rep-0153.html

— distributions: ardent:
distribution: [ardent/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/ardent-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 bouncy:
distribution: [bouncy/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/bouncy-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 crystal:
distribution: [crystal/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/crystal-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 dashing:
distribution: [dashing/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/dashing-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 eloquent:
distribution: [eloquent/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/eloquent-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 foxy:
distribution: [foxy/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/foxy-cache.yaml.gz
distribution_status: active
distribution_type: ros2
python_version: 3 galactic:
distribution: [galactic/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/galactic-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros2
python_version: 3 groovy:
distribution: [groovy/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/groovy-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 humble:
distribution: [humble/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/humble-cache.yaml.gz
distribution_status: active
distribution_type: ros2
python_version: 3 hydro:
distribution: [hydro/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/hydro-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 indigo:
distribution: [indigo/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/indigo-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 jade:
distribution: [jade/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/jade-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 kinetic:
distribution: [kinetic/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/kinetic-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 lunar:
distribution: [lunar/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/lunar-cache.yaml.gz
distribution_status: end-of-life
distribution_type: ros1
python_version: 2 melodic:
distribution: [melodic/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/melodic-cache.yaml.gz
distribution_status: active
distribution_type: ros1
python_version: 2 noetic:
distribution: [noetic/distribution.yaml]
distribution_cache: http://repositories.ros.org/rosdistro_cache/noetic-cache.yaml.gz
distribution_status: active
distribution_type: ros1
python_version: 3 rolling:
distribution: [rolling/distribution.yaml]
distribution_cache: http://repo.ros2.org/rosdistro_cache/rolling-cache.yaml.gz
distribution_status: rolling
distribution_type: ros2
python_version: 3 type: index version: 4

Debian打包参考手册。 Welcome to the Ubuntu Packaging Guide! This guide is primarily addressed to those who would like to make and maintain Ubuntu packages. 1)使用QT编译完之后在debug/release文件夹下得到可执行文件如demo 2)新建一个文件夹如demoPack,把demo拷贝这个地方 3)新建一个脚本文件pack.sh,作用是提取lib文件,内容如下: #!/bin/sh ... ROS运行中的一些常见报错及解法 现行的机器人应用研究,多是基于Ubuntu系统的ROS(Robot Operating System)进行搭建及仿真测试,这里简略记录一些经典报错及相应解法。这些仅是笔者在使用过程中遇到的小坑,水平有限,仅作学习记录之用途。 终端启动项 对于package中的功能包,使用中需要source相应的setup.bash文件,利用以下命令 gedit ~/.bashrc 可以直接编辑终端启动项(即你每次打开新的终端,这里面的命令行就自动运行了,可以直接把source语句放进其中) ubuntu上安装ROS,不管是在ubuntu16.04上装kinetic,还是在18.04上装melodic,安装完毕后,进行初始化时,反复失败,试遍了网上公开的方法,都没能解决。最后,通过本地创建配置文件的方法,终于搞定。 1.执行 sudo rosdep init 失败 首先反复尝试一下,一般情况下反复个几次,init这步就可以成功。 如果反复不成功,根据提示错误,可以先参考... 记录一次Deb打包过程即踩雷警示 最近写了一个python的小程序,希望能打包成deb文件,把这个程序弄得有头有脸,安装deb后可以在应用列表和桌面看到。参考了许多资料(文后附),它们给了我很多指导,对此表示感谢。 需要准备的 1、源代码(前提要可执行)或者编译好的程序,这里只介绍python 2、能用的ubuntu系统 3、用户的密码 4、图标(一定要有!) 这里给大家介绍一个案例,包名叫做debpacktest,整个过程中所有用到名字的地方,统统都是这个名字。xxx也指代这个名字。 一、建立目录架构 在开始学习ROS2之前,笔者先带大家了解一下Ubuntu。想必读者都知道Linux是一套免费并且开放源代码的操作系统。严格来讲,Linux这个词本身只表示Linux内核,而Ubuntu操作系统则是使用Linux内核的操作系统之一。与很多计算机技术相同,ROS2的更新换代是非常迅速的,目前对ROS2兼容最好的系统就是Ubuntu操作系统,所以本教程所有内容是基于目前较新版的Ubuntu22.04 LTS操作系统,对应的ROS2版本是ROS2:Humble。 一、MySQL数据库模块的安装和连接1、 PyMySQL模块的安装pip install pymysql2 、python连接数据库importpymysqldb= pymysql.connect("127.0.0.1", "root", "123456", "mysql") #("数据库ip","用户","密码","数据库" ) 打开数据库连接cursor =db.cursor()cursor...