ros2+在Ubuntu上安装gazebo

2023-12-14 13:07:44

Binary Installation on Ubuntu(Ubuntu上binary方式安装gazebo)

Harmonic binaries are provided for Ubuntu Jammy (22.04) and Ubuntu 24.04 (when it's released). (在Ubuntu22.04或者24.04上都是安装Harmonic版本的gazebo)The Harmonic binaries are hosted in the packages.osrfoundation.org repository. To install all of them, the metapackage?gz-harmonic?can be installed.(gz-harmonic应该是一个元功能包,你可以认为就是gazebo)

WARNING:?gz-harmonic?(gazebo-harmonic版)cannot be installed alongside gazebo-classic (gz-harmonic不能与gazebo11同时安装,因为都是使用gz 命令工具)(eg.?gazebo11) since both use the?gz?command line tool. Trying to install?gz-harmonic?on a system that already has gazebo-classic installed from binaries will cause gazebo-classic and its dependencies to be uninstalled(在一台已经安装了gazebo11的电脑上安装gz-harmonic会导致gazebo11被删除) Currently, the workarounds for this are to install from source or to use Docker?gazebo-classic?so they are not installed side-by-side on the same system.(如果你要同时安装gazebo11和gz-harmonic那么使用docker方式可以做到)

First install some necessary tools:()第一步:

sudo apt-get update
sudo apt-get install lsb-release wget gnupg

Then install Gazebo Harmonic:第二步:

sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install gz-harmonic

All libraries should be ready to use and the?gz sim?app ready to be executed.

Head back to the?Getting started?page to start using Gazebo!这里就安装完了

启动gazebo方式:

gz sim

?sim的意思就是simulator

Uninstalling binary install

If you need to uninstall Gazebo or switch to a source-based install once you have already installed the library from binaries, run the following command:

sudo apt remove gz-harmonic && sudo apt autoremove

Troubleshooting

See?Troubleshooting

文章来源:https://blog.csdn.net/geniusChinaHN/article/details/134992111
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。