DownloadFailure`
:raises: :exc:`InvalidData` If targets file does not pass cursory
validation checks.
"""
# we can convert a gbpdistro file into rosdep data by following a
# couple rules
# will output a warning
targets_data = download_targets_data(targets_url=targets_url)
gbpdistro_url = "https://ghproxy.com/" + gbpdistro_url
try:
f = urlopen(gbpdistro_url, timeout=DOWNLOAD_TIMEOUT)
text = f.read()
f.close()
gbpdistro_data = yaml.safe_load(text)
# will output a warning
return gbprepo_to_rosdep_data(gbpdistro_data,
targets_data,
gbpdistro_url)
except Exception as e:
raise DownloadFailure('Failed to download target platform data '
'for gbpdistro:\n\t' + str(e))
好了,大招都使完了,看看效果
~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/if/.ros/rosdep/sources.cache
8.测试一下环境
分别按顺序独立在各自的终端里执行下边的这几个指令
// 启动 ROS 核心
roscore
// 启动 ROS 仿真平台
rosrun turtlesim turtlesim_node
// 接收方向键按键信息
rosrun turtlesim turtle_teleop_key
在最后的终端里按着键盘方向键就可以控制仿真窗口里的小乌龟动起来了
如果你能顺利走到这里,说明 ROS 环境可以正常跑了。
后记:
其实写这篇笔记的过程中,除了首次配置环境,还穿插了很多任务,导致配置的过程一直停滞不前,笔记也落下那么久才发出来。如果你在对照这篇笔记来配置 ROS 环境的时候也碰到了其它的问题,欢迎留言提出来,或者添加我的微信公众号englyf给我留言?毕竟博客不一定一直在线。