【ROS书籍】Mastering ROS for Robotics Programming——1.6.8维护ROS包

维护ROS包

大多数ROS包以开放源代码的形式发布,使用BSD许可。全球有活跃的开发人员正在为ROS平台做贡献。在所有软件中,维护包都是一个重要的约束,特别是开放源码应用程序。开源软件是由开发者社区维护和支持。如果我们想要维护和接受其他开发人员的贡献,那么为我们的包创建一个版本控制系统是非常必要的。前面的包已经在GitHub上更新了,你可以查看项目代码在https://github.com/qboticslabs/mastering_ros_demo_pkg

代码上传到Github后,我们可以看到将当前包发布(release)到ROS的过程是什么。

发布(release)你的ROS包

在Github上创建一个ROS包之后,我们可以随意发布(release)我们的包。ROS提供了详细的步骤,使用名为bloom (http://ros-infrastructure.github.io/bloom/)的工具来发布ROS包。Bloom是一个发布自动化工具,旨在从源项目中发布指定平台版本。Bloom的设计是为了在catkin项目中发挥最大的作用。

发布的前期准备需要做如下工作:

  • 安装bloom工具
  • 为当前包创建Git存储库
  • 为发布创建空的Git存储库

在Ubuntu系统运行如下命令安装bloom:

$ sudo apt-get install python-bloom

为当前包创建Git存储库。该存储库我们称为“上游存储库”。在这里,我们已经在https://github.com/qboticslabs/mastering_ros_demo_pkg创建了一个存储库。

为发布包创建一个空的存储库。该存储库我们称为“release存储库”。我们已经创建了一个名为“demo_pkg-release”包。该包位于:https://github.com/qboticslabs/demo_pkg-release

在满足这些先决条件之后,我们可以开始创建包的发布。导航到mastering_ros_demo_pkg本地存储库,我们将包代码推到Git。在本地存储库中打开一个终端并执行以下命令:

$ catkin_generate_changelog

这个命令的目的是,它将在本地存储库中创建一个CHANGELOG.rst。执行此命令后,它将显示此选项:

Continue without -all option [y/N]. 输入y 

它将在本地存储库创建一个CHANGELOG.rst。

创建完日志文件之后,我们通过提交修改来更新Git存储库:

$ git add -A
$ git commit -m 'Updated CHANGELOG.rst'
$ git push -u origin master

为ROS包Release做准备

在这一步,我们将检查包中的更新日志、版本等。下面的命令使我们的包保持一致,并建议发布。

这个命令应该在本地存储库的包中运行:

$ catkin_prepare_release

如果没有当前版本并提交上游存储库中的更改,该命令将设置一个版本标记。

发布我们的包

运行以下命令开始发布。更改以下命令:

bloom-release --rosdistro <ros_distro> --track <ros_distro> repository_name

$ bloom-release --rosdistro indigo --track indigo mastering_ros_demo_pkg

当这个命令运行后,它将会到rosdistro(https://github.com/ros/rosdistro)包存储库得到包列表。在ROS中,rosdistro包包含一个索引文件,该文件包含ROS所有包的索引。当前状态,因为我们是第一个发布,所以这里并没有我们包的索引,但我们可以添加我们包的细节到索引文件,该索引文件名为:distributions.yaml。

以下展示的消息表示在rosdistro中没有包的参考:

我们应该在前面的截图中用红色标记的终端提供发布存储库。在这个情况下,URL是:https://github.com/qboticslabs/demo_pkg-release


在以上步骤中,向导将请求存储库名称、上游存储库、URL等。我们可以提供这些选项,最后,将提交对ros发行版的pull请求,如下面的截图所示::


为这个包的pull请求可以在 https://github.com/ros/rosdistro/pull/9662 查看。

如果接受,它将会合并到indigo/distribution.yaml,该文件包含ROS包的所有索引。

以下截图为indigo/distribution.yaml下的索引内容:


完成该步骤后,我们可以将该包发布并将其添加到ROS索引中。

为ROS包创建wiki界面

ROS wiki允许用户创建自己的主页来展示他们的包、机器人或传感器。ROS的官方wiki页面是wiki.ros.org。现在,我们将为我们的包创建一个wiki页面。

下载示例代码

你可以从http://www.packtpub.com下载你购买的所有Packt出版书籍的示例代码。如果你在其他地方购买了这本书,你可以访问http://www.packtpub.com/support并注册,以便将这些电子邮件直接发送给你。你还可以从https://github.com/qboticslabs/mastering_ros.git下载章节代码。

第一步是使用你的邮件地址在维基中注册。登录wiki.ros.org,点击屏幕截图中显示的登录按钮:

单击Login之后,你可以注册,如果你已经注册了可以直接登录。登录后,按下截图中显示的wiki页面右侧的用户名链接:

单击此链接后,你将获得创建包的主页的机会;你将得到一个带有GUI的文本编辑器来输入数据。下面的屏幕截图显示了我们为这个演示程序包创建的页面:


当前包的wiki界面可以在http://wiki.ros.org/qboticslabs查看。

Effective Robotics Programming with ROS, Third Edition gives you a comprehensive review of ROS, the Robot Operating System framework, which is used nowadays by hundreds of research groups and companies in the robotics industry. More importantly, ROS is also the painless entry point to robotics for nonprofessionals and students. This book will guide you through the installation process of ROS, and soon enough, you will be playing with the basic tools and understanding the different elements of the framework. The content of the book can be followed without any special devices, and each chapter comes with a series of source code examples and tutorials that you can run on your own computer. This is the only thing you need to follow the book. However, we also show you how to work with hardware so that you can connect your algorithms with the real world. Special care has been taken in choosing devices that are affordable for amateur users, but at the same time, the most typical sensors or actuators in robotics research are covered. Finally, the potential of ROS is illustrated with the ability to work with whole robots in a real or simulated environment. You will learn how to create your own robot and integrate it with a simulation by using the Gazebo simulator. From here, you will have the chance to explore the different aspects of creating a robot, such as perceiving the world using computer vision or point cloud analysis, navigating through the environment using the powerful navigation stack, and even being able to control robotic arms to interact with your surroundings using the MoveIt! package. By the end of the book, it is our hope that you will have a thorough understanding of the endless possibilities that ROS gives you when developing robotic systems.What this book covers Chapter 1, Getting Started with ROS, shows the easiest way you must follow in order to have a working installation of ROS. You will see how to install ROS on different platforms, and you will use ROS Kinetic throughout the rest of the book. This chapter describes how to make an installation from Debian packages, compile the sources, and make installations in virtual machines, Docker, and ARM CPU. Chapter 2, ROS Architecture and Concepts, is concerned with the concepts and tools provided by the ROS framework. We will introduce you to nodes, topics, and services, and you will also learn how to use them. Through a series of examples, we will illustrate how to debug a node and visualize the messages published through a topic. Chapter 3, Visualization and Debugging Tools, goes a step further in order to show you powerful tools to debug your nodes and visualize the information that goes through the node's graph along with the topics. ROS provides a logging API that allows you to diagnose node problems easily. In fact, we will see some powerful graphical tools, such as rqt_console and rqt_graph, as well as visualization interfaces, such as rqt_plot and rviz. Finally, this chapter explains how to record and play back messages using rosbag and rqt_bag. Chapter 4, 3D Modeling and Simulation, constitutes one of the first steps in order to implement your own robot in ROS. It shows you how to model a robot from scratch and run it in simulation using the Gazebo simulator. You will simulate sensors, such as cameras and laser range sensors. This will later allow you to use the whole navigation stack provided by ROS and other tools. Chapter 5, The Navigation Stack – Robot Setups, is the first of two chapters concerned with the ROS navigation stack. This chapter describes how to configure your robot so that it can be used with the navigation stack. In the same way, the stack is explained, along with several examples. Chapter 6, The Navigation Stack – Beyond Setups, continues the discussion of the previous chapter by showing how we can effectively make our robot navigate autonomously. It will use the navigation stack intensively for that. This chapter shows the great potential of ROS using the Gazebo simulator and RViz to create a virtual environment in which we can build a map, localize our robot, and do path planning with obstacle avoidance. Chapter 7, Manipulation with MoveIt!, is a set of tools for mobile manipulation in ROS. This chapter contains the documentation that you need to install this package. The chapter also contains example demonstrations with robotic arms that use MoveIt! for manipulation tasks, such as grasping, picking and placing, or simple motion planning with inverse kinematics. Chapter 8, Using Sensors and Actuators with ROS, literally connects ROS with the real world. This chapter goes through a number of common sensors and actuators that are supported inROS, such as range lasers, servo motors, cameras, RGB-D sensors, and GPS. Moreover, we explain how to use embedded systems with microcontrollers, similar to the widely known Arduino boards. Chapter 9, Computer Vision, shows the support for cameras and computer vision tasks in ROS. This chapter starts with drivers available for FireWire and USB cameras so that you can connect them to your computer and capture images. You will then be able to calibrate your camera using the ROS calibration tools. Later, you will be able to use the image pipeline, which is explained in detail. Then, you will see how to use several APIs for vision and integrate OpenCV. Finally, the installation and usage of a visual odometry software is described. Chapter 10, Point Clouds, shows how to use Point Cloud Library in your ROS nodes. This chapter starts with the basics utilities, such as read or write a PCL snippet and the conversions needed to publish or subscribe to these messages. Then, you will create a pipeline with different nodes to process 3D data, and you will downsample, filter, and search for features using
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值