2021SC@SDUSC
1. 本周工作目标
前面几周阅读了ros core部分的ros master和ros topic方面的源码,注重于一些核心、通用库的实现。本周开始,我们要进入另一部分的阅读,阅读导航库的源码,探究其实现。结合实际情况,本周的工作目标如下:
-
阅读ros wiki,了解导航库源码结构
-
结合文档和源码结构,搭建阅读环境
2. ros导航库结构
回到最开始的wiki(RecommendedRepositoryUsage/CommonGitHubOrganizations - ROS Wiki),阅读列表,找到了我们想要的导航部分源码:

看到是通过ros-planning这个账号进行发布的。这个账号下有很多仓库:

这一个个阅读太慢了,于是我顺手写了一个python脚本调用api,打印该用户所有的仓库:
import requests
import json
resp = requests.get('https://api.github.com/users/ros-planning/repos?page=1&per_page=100')
resp_dict = json.loads(resp.text)
print(f'{"repo_name" :<30}html_url')
for repo in resp_dict:
print(f'{repo["name"] :<30}{repo["html_url"]}')
输出如下:
3d_navigation https://github.com/ros-planning/3d_navigation geometric_shapes https://github.com/ros-planning/geometric_shapes industrial_moveit https://github.com/ros-planning/industrial_moveit map_manager_app https://github.com/ros-planning/map_manager_app map_store https://github.com/ros-planning/map_store moveit https://github.com/ros-planning/moveit moveit.ros.org https://github.com/ros-planning/moveit.ros.org moveit2 https://github.com/ros-planning/moveit2 moveit2_tutorials https://github.com/ros-planning/moveit2_tutorials moveit_advanced https://github.com/ros-planning/moveit_advanced moveit_calibration https://github.com/ros-planning/moveit_calibration moveit_ci https://github.com/ros-planning/moveit_ci moveit_commander https://github.com/ros-planning/moveit_commander moveit_core https://github.com/ros-planning/moveit_core moveit_docs https://github.com/ros-planning/moveit_docs moveit_example_apps https://github.com/ros-planning/moveit_example_apps moveit_experimental https://github.com/ros-planning/moveit_experimental moveit_grasps https://github.com/ros-planning/moveit_grasps moveit_ikfast https://github.com/ros-planning/moveit_ikfast moveit_kinematics_tests https://github.com/ros-planning/moveit_kinematics_tests moveit_metapackages https://github.com/ros-planning/moveit_metapackages moveit_msgs https://github.com/ros-planning/moveit_msgs moveit_planners https://github.com/ros-planning/moveit_planners moveit_plugins https://github.com/ros-planning/moveit_plugins moveit_pr2 https://github.com/ros-planning/moveit_pr2 moveit_resources https://github.com/ros-planning/moveit_resources moveit_robots https://github.com/ros-planning/moveit_robots moveit_ros https://github.com/ros-planning/moveit_ros moveit_setup_assistant https://github.com/ros-planning/moveit_setup_assistant moveit_task_constructor https://github.com/ros-planning/moveit_task_constructor moveit_tutorials https://github.com/ros-planning/moveit_tutorials moveit_visual_tools https://github.com/ros-planning/moveit_visual_tools navigation https://github.com/ros-planning/navigation navigation.ros.org https://github.com/ros-planning/navigation.ros.org navigation2 https://github.com/ros-planning/navigation2 navigation2_dynamic https://github.com/ros-planning/navigation2_dynamic navigation2_tutorials https://github.com/ros-planning/navigation2_tutorials navigation_experimental https://github.com/ros-planning/navigation_experimental navigation_msgs https://github.com/ros-planning/navigation_msgs navigation_tutorials https://github.com/ros-planning/navigation_tutorials panda_moveit_config https://github.com/ros-planning/panda_moveit_config random_numbers https://github.com/ros-planning/random_numbers robot_pose_ekf https://github.com/ros-planning/robot_pose_ekf shape_tools https://github.com/ros-planning/shape_tools srdfdom https://github.com/ros-planning/srdfdom warehouse_ros https://github.com/ros-planning/warehouse_ros warehouse_ros_mongo https://github.com/ros-planning/warehouse_ros_mongo warehouse_ros_sqlite https://github.com/ros-planning/warehouse_ros_sqlite
其实还是很多,但是我们大致可以看出来moveit、navigation有很多子仓库,应该是比较核心而复杂的组件。
单纯看代码不能了解很多,我们要结合代码的wiki一起阅读:

可以看到这里有一个类似目录一样的区域。通过上方的链接点入move_base的介绍,可以看见整个导航的包的框架图:

这张图生动形象地概括了整个导航功能包的框架。至于详细的内容就不清楚了。
3. 搭建阅读环境
本部分代码过于复杂,应该是比较难用“vscode”进行调试了,我决定只使用vscode当做代码阅读器,然后使用ros本来的调试套件(如rostopic、rqt等)进行调试。
4. 总结
这就是本周的工作内容。新的部分比原有的部分更难,需要接下来的日子继续努力阅读。
本周工作转向ROS导航库源码分析,重点包括理解导航库结构、搭建阅读环境。通过查阅wiki和调用API了解了ros-planning账号下的仓库,如moveit和navigation。计划结合代码和wiki深入阅读,初步建立了使用vscode作为代码阅读器,配合ros调试工具的阅读环境。

3828

被折叠的 条评论
为什么被折叠?



