# 1.二进制安装
如果有ROS软件包的二进制发行版,可以使用Chocolatey安装
choco install ros-melodic-<package_name>
ROS软件包查询
Windows下是否已有移植查询
https://roswin.azurewebsites.net/
# 2.源码安装
首先测试源码是否可在windows系统上编译运行
:: activate the ROS environment
c:\opt\ros\melodic\x64\setup.bat
:: create a empty workspace
mkdir c:\catkin_ws\src
cd c:\catkin_ws
:: generate the released package sources list and its ROS dependencies
:: you can customize the command line to checkout the sources from different channels
:: see the tips section for more details
rosinstall_generator <package_name> --deps --exclude RPP --tar --flat > pkg.rosinstall
:: you can manually edit the pkg.rosinstall for more customizations.
:: see the tips section for more details
:: checkout the sources for real
wstool init src
wstool merge -r -y -t src pkg.rosinstall
wstool update -t src
:: attempt to acquire the external dependencies
rosdep update
rosdep install --from-paths src --ignore-src -r -y
:: now catkin make to build the workspace
catkin_make
如果编译成功,就可以激活软件包相关开发环境,然后使用软件包
:: activate the development space
devel\setup.bat
:: test the new package is discoverable
rospack find <package_name>
源码安装Tips
如果编译失败,可尝试以下步骤:
- 如果尚未发布Windows端口,则可以重复上述源码安装步骤,但是这次请rosinstall_generator使用development分支。
:: use the development branch
rosinstall_generator <package> --upstream-development --deps --exclude RPP > pkg.rosinstall
- 如果使用上游开发分支没有帮助,则可以编辑pkg.rosinstall,将损坏的软件包的版本:切换到其他分支,例如Windows或init_windows(如果存在)。
- 除了使用上游存储库之外,您还可以检查Microsoft的ms-iot Github组织是否具有该项目的分支并正在使用端口。 如果是这样,您可以编辑pkg.rosinstall以将uri:指向另一个fork。
- 对于未注册到ROS发行版的软件包,您可以手动创建.rosinstall文件以维护要使用的存储库列表。
- ROS Wiki或ROS Index也是搜索程序包存储库的良好资源。
如果以上方法都解决不了,可以考虑 移植ROS软件包到windows环境中。