Ubuntu22 humble安装openRMF
一。reference
二。rmf install
好用的代理地址:https://ghproxy.com/
英文版安装步骤请参考:openrmf代码的readme
1. install ROS 2 Humble
这个自行下载吧,可以用fishbot的一键安装,很快。
2. Setup Gazebo repositories
设置gazebo相关
sudo apt update
sudo apt install -y wget
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
3. Building from sources (Recommended)
最好是使用源码安装,RMF作为一个还在发展的项目,这个才是最新版本。
3.1 Additional Dependencies
下载非ros的依赖
sudo apt update && sudo apt install \
git cmake python3-vcstool curl \
-y
python3 -m pip install flask-socketio fastapi uvicorn datamodel_code_generator
sudo apt-get install python3-colcon*
3.2 Install rosdep
使用rosdep下载ros相关依赖,网络不行的兄弟可以用小鱼的rosdepc
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
3.3 Download the source code
- 构建一个ros2工作空间并使用vcs下载代码
mkdir -p ~/rmf_ws/src
cd ~/rmf_ws
wget https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
vcs import src < rmf.repos
此处网络不行可以使用代理网址:
wget https://ghproxy.com/https://raw.githubusercontent.com/open-rmf/rmf/main/rmf.repos
- 下载依赖项
cd ~/rmf_ws
rosdep install --from-paths src --ignore-src --rosdistro humble -y
- 下载编译工具
下载 clang
sudo apt update
sudo apt install clang clang-tools lldb lld libstdc++-12-dev
note: RMF强烈建议使用clang为编译器,lld为链接器来编译RMF的package
更新colcon mix,这个只要执行一次
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
colcon mixin update default
同样网不好的可以用代理网址,同上
- 编译
cd ~/rmf_ws
source /opt/ros/humble/setup.bash
export CXX=clang++
export CC=clang
colcon build --mixin release lld
note:因为一边编译一边下载东西,所以第一次编译应该会很久(比如60min)
4. 二进制安装
Latest Open-RMF binary packages are available for Ubuntu Jammy 22.04 for the Humble and Rolling releases of ROS 2. Older releases are also available on Ubuntu Focal 20.04 for Foxy and Galactic. Most Open-RMF packages have the prefix rmf on their name, therefore, you can find them by searching for the pattern ros--rmf, e.g., for humble it would be:
这个就懒得翻译了
apt-cache search ros-humble-rmf
5. docker安装
这个就更简单了,不翻译了
Alternatively, you can run RMF Demos by using docker.
Pull docker image from open-rmf/rmf github registry (setup refer here).
docker pull ghcr.io/open-rmf/rmf/rmf_demos:latest
docker tag ghcr.io/open-rmf/rmf/rmf_demos:latest rmf:latest
Run it!
docker run -it --network host rmf:latest bash -c "export ROS_DOMAIN_ID=9; ros2 launch rmf_demos_gz office.launch.xml headless:=1"
This will run rmf_demos in headless mode. Open this link with a browser to start a task.
(Experimental) User can also run rmf_demos in “non-headless” graphical form, via rocker.
6. 错误
- rmf_robot_sim_gazebo_plugins build error
https://github.com/open-rmf/rmf_simulation/issues/96
总结一下就是:查看libignition-cmake2-dev的版本,如果小于2.16.01~jammy那就用upgrade更新一下
apt list | grep libignition-cmake2-dev
sudo apt upgrade libignition-cmake2-dev
三。rmf-web install
英文版:https://github.com/open-rmf/rmf-web
这里的主要困难在于网络问题,建议网络不好的试试手机热点,最好是软陆游代理。
牢记github代理地址:https://ghproxy.com/
1. Prerequisites
- Install nodejs >= 16,
sudo apt update && sudo apt install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
nvm install 16
网不好就是:
cd ~
mkdir rmf_web
cd rmf_web
curl -o install.sh https://ghproxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh
#然后修改install.sh里面的东西,把所有和github相关的网址都加上代理
bash install.sh
- Install pnpm and nodejs
curl -fsSL https://get.pnpm.io/install.sh | bash -
pnpm env use --global 16
网不好同上
- Install pipenv
pip3 install pipenv
- For Debian/Ubuntu systems, you may need to install python3-venv first.就是ubuntu的话有可能需要先下载这个
sudo apt install python3-venv
2. Installing Open-RMF
这个就是上面的那个
3. Install dependencies
这里英文版教程不完整
cd ~/rmf_web
git clone https://github.com/open-rmf/rmf-web.git
cd rmf-web
pnpm install
4. launch
Source Open-RMF and launch the dashboard in development mode,
# For binary installation二进制安装的执行这个
source /opt/ros/humble/setup.bash
# For source build 源码安装的找到源码根目录,就是src上一级,替换调下述命令/install前面的部分,执行
source /path/to/workspace/install/setup.bash
# 这个就是在rmf-web目录里面的
cd packages/dashboard
pnpm start
This starts up the API server which sets up endpoints to communicate with an Open-RMF deployment, as well as begin compilation of the dashboard. Once completed, it can be viewed at localhost:3000.
If presented with a login screen, use user=admin password=admin.
就是开启之后,在浏览器输入网址:localhost:3000,如果有登陆界面,用户名:admin,密码:admin