在Windows上使用ROS软件包

# 1.二进制安装

如果有ROS软件包的二进制发行版,可以使用Chocolatey安装

choco install ros-melodic-<package_name>

ROS软件包查询

https://index.ros.org/

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

如果编译失败,可尝试以下步骤:

  1. 如果尚未发布Windows端口,则可以重复上述源码安装步骤,但是这次请rosinstall_generator使用development分支。

:: use the development branch

rosinstall_generator <package> --upstream-development --deps --exclude RPP > pkg.rosinstall

 

  1. 如果使用上游开发分支没有帮助,则可以编辑pkg.rosinstall,将损坏的软件包的版本:切换到其他分支,例如Windows或init_windows(如果存在)。

 

  1. 除了使用上游存储库之外,您还可以检查Microsoft的ms-iot Github组织是否具有该项目的分支并正在使用端口。 如果是这样,您可以编辑pkg.rosinstall以将uri:指向另一个fork。
  2. 对于未注册到ROS发行版的软件包,您可以手动创建.rosinstall文件以维护要使用的存储库列表。
  3. ROS WikiROS Index也是搜索程序包存储库的良好资源。

 

如果以上方法都解决不了,可以考虑 移植ROS软件包到windows环境中。

 

 

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为了在Windows上安装ROS,您需要按照以下步骤进行: 1. 安装Ubuntu虚拟机:ROS仅适用于Linux操作系统,因此您需要在Windows上安装Linux虚拟机。在此过程中,您可以选择使用VirtualBox或VMware。 2. 安装ROS:安装ROS的最简单方法是通过ROS的官方安装脚本。要运行安装脚本,请按照以下步骤操作: - 打开Ubuntu虚拟机,打开终端。 - 输入以下命令以运行ROS安装脚本: ``` $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ros/rosinstallers/master/rosinstall_generator.py)" ``` - 运行后,很多选项将显示在终端中。选择您需要的ROS版本和软件包,并根据您的需求进行自定义设置。 - 在完成设置后,请运行以下安装命令以安装ROS: ``` $ sh ./install_ros.sh ``` - 安装过程需要一些时间,具体取决于您的计算机性能和您选择的软件包数量。 3. 配置ROS:安装完成后,您需要配置ROS环境变量和ROS工作区。要设置这些值,请输入以下命令: - 配置ROS环境变量: ``` echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc ``` 注意:上面的脚本是用于ROS Melodic的。如果您选择的是不同版本的ROS,请将“melodic”替换为您选择的版本。 - 创建ROS工作区: ``` mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catkin_make ``` - 最后,将下面这行代码添加到您的 .bashrc 文件: ``` source ~/catkin_ws/devel/setup.bash ``` 现在您已经成功安装和配置了ROS,可以开始在Windows上编写和运行ROS节点了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值