当前位置:网站首页>Installation of gazebo & connection with ROS

Installation of gazebo & connection with ROS

2022-07-07 01:16:00 Serinus

One 、 install

1. Add source

sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'

 Insert picture description here

2. add to key

wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -

 Insert picture description here

3. install Gazebo

sudo apt-get update
sudo apt-get install gazebo9
sudo apt-get install libgazebo9-dev

 Insert picture description here
The following error occurred , Then re-enter the command sudo apt-get install gazebo9, Until the download is successful ( There may be multiple errors ).
 Insert picture description here

4. open Gazebo

# Enter the command 
gazebo

If the following interface appears, the installation is successful .
 Insert picture description here
If an error :

VMware: vmw_ioctl_command error  Invalid parameter .

Enter the following command :

echo "export SVGA_VGPU10=0" >> ~/.bashrc

Then restart the virtual machine .

Two 、 And ROS Connect

1. install ROS-Gazebo Interface

sudo apt install ros-melodic-gazebo-ros-pkgs  ros-melodic-gazebo-msgs  ros-melodic-gazebo-plugins  ros-melodic-gazebo-ros-control

2. Terminal input command

roscore
# Open a new terminal 
rosrun gazebo_ros gazebo

 Insert picture description here

The following interface will explain and ROS Successful connection .
 Insert picture description here

conversely , Then enter the following command :

 cd ~/.gazebo/
 mkdir -p models
 cd ~/.gazebo/models/
 wget http://file.ncnynl.com/ros/gazebo_models.txt
 wget -i gazebo_models.txt
 ls model.tar.g* | xargs -n1 tar xzvf
 killall gzserver
 killall gzclient

Then type :

roscore
# Open a new terminal 
rosrun gazebo_ros gazebo

appear Gazebo Open the interface and the connection succeeds .

原网站

版权声明
本文为[Serinus]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061730251017.html