ROS2 & Gazebo Install Instructions #23
ElDablo123
started this conversation in
Simulation
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ros & Gazebo Install Instructions
Linux VM / Dual Boot
To run ROS2 and Gazebo youre gonna want to be in a Linux enviornment
We chose to run Ubuntu 22.04 as the os since it has a lot of support for Gazebo and ROS2 and it is decently user friendly for beginners.
Setting up a Virtual Machine vs creating a dual boot is completely up to preference, I always recommend VM's to people who are newer to different OS's as it can be easier to setup and troubleshoot.
(Side Note: For people running M1 or M2 macbooks, there are issues with running gazebo ignition however you can still run gazebo classic it just has its End Of Life next year)
Installing ROS2
Once you have gotten Ubuntu set up, we can now install ROS2
To start open the terminal and clone down our URC github repo:
If this creates an error because git is not installed then install it with this and enter your password:
Once cloned, you must go into the ./URC/ repo then into /rover-ros/ and finally /scripts/
You can do this by using the command cd (Change Directory)
and then run the install_ros2.sh script by entering:
This command should install ROS2 Humble which is the version we will be using for Gazebo
Gazebo Foretress Installation
This should be straight forward just go to this link and follow how to install Gazebo Foretress.
Just in case type "cd" in the terminal to go back to the home directory before installing, do this before cloning any repos as well.
https://gazebosim.org/docs/fortress/install_ubuntu/
Creating ROS2 Gazebo bridge
https://github.com/gazebosim/ros_gz_project_template/tree/fortress
At this link you will have the ros_gz template basiaclly the repo that will setup the link connecting ROS2 into our gazebo simulation.
I'd probably recommend downloading the zip and extracting by hand or just follow these commands:
Install necessary tools:
create workspace:
Install Dependencies:
Build the project:
Source the workspace:
Launch test sim:
If that worked GREAT! (if it didnt, try to troubleshoot it by looking up the error, if youre still stuck message me and I can see if i know a fix)
Now heres a little test sim that you can follow all the way through and it'll show you how to visualize lidar data from the gazebo sim in Rviz2
https://docs.ros.org/en/humble/Tutorials/Advanced/Simulators/Gazebo/Gazebo.html#prerequisites
Beta Was this translation helpful? Give feedback.
All reactions