移植ROS软件包
Windows上的C ++ ROS节点是nodelet的可执行文件或dll。 ROS节点通常是一个或多个库或应用程序的包装,这可能需要单独的软件开发工具包(SDK)或其他下载文件。,此教程将逐步介绍如何从Linux移植到构建和发布,并在Windows上支持ROS节点。
移植ROS节点
要将ROS节点移植到Windows,可使用以下步骤。
- 通过《使用ROS软件包》指南确定ROS节点是否支持在Windows进行二进制或源码部署。
- 创建一个fork,在本地克隆并创建一个分支
- 解决依赖关系
- 在工作区运行catkin_make指令进行编译
- 修复构建中断 Fix Build breaks
- 修复链接器中断 Fix linker breaks
- 修复运行时错误 Fix runtime bugs
- 提交并发出拉取请求
下载源码 Forking & Cloning.
Fork the repository into your account and clone the melodic branch into a workspace created for the port.
- On github.com, fork https://github.com/<organization>/<project> into your personal github repo
- Create a workspace and clone:
mkdir c:\ws\ros_ws\src
cd c:\ws\ros_ws\src
git clone https://github.com/<your github>/<project>
cd ..
解决依赖关系 Resolve Dependencies
许多ROS软件包需要依赖库。 在检索ROS软件包的源代码之后,运行工具rosdep,该工具将尝试使用二进制和源代码分发管理器来解决软件包依赖性。
在Windows上,使用二进制程序包管理器Chocolatey。使用Microsoft的VCPkg管理器管理源代码发行版或依赖库。
在工作区中,使用rosdep解决依赖关系
rosdep update
rosdep install --from-paths src --ignore-src -r -y
您可能会看到以下输出,表明缺少依赖项:
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
<package: No definition of [<dependent library>] for OS [windows]
#All required rosdeps installed successfully
如果缺少依赖项,请按照“使用VCPKG”解决现有端口中的步骤,或根据需要使用“添加VCPKG”添加端口。
请注意运行rosdep时打印的特殊说明-为了在Windows上正确链接,可能需要这些特殊说明。
缺少ROS消息 Missing ROS Messages
许多ROS消息未打包为二进制分发。 这些可以简单地克隆到仓库中。
cd c:\ws\ros_ws\src
git clone https://github.com/<dependent package organization>/<depdnent package>
cd ..
rosdep install --from-paths src --ignore-src -r -y
修复构建中断 Fixing Build breaks
在构建过程中,您可能会遇到构建中断的情况。 通常,节点取决于特定于平台的头文件或功能。 为了移植这些,建议在迁移过程中利用Boost,STL和跨平台库中等效的跨平台库。
有关移植的一般帮助,请参阅《移植指南:平台差异》。