First make sure you've installed Ignition Gazebo Fortress:
First install some necessary tools:
sudo apt-get update
sudo apt-get install lsb-release gnupgThen install Ignition Fortress:
sudo curl https://packages.osrfoundation.org/gazebo.gpg --output /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 ignition-fortressAll libraries should be ready to use and the Ignition Gazebo app ready to be executed.
If you need to uninstall Ignition or switch to a source-based install once you have already installed the library from binaries, run the following command:
sudo apt remove ignition-fortress && sudo apt autoremoveRun the following command on Windows PowerShell as an Administrator:
wsl --versionIf not WSL 2, run the following command:
wsl --upgradeTo use OpenGL Rendering, enter this command in the WSL2 terminal:
export LIBGL_ALWAYS_SOFTWARE=1More coming soon...
More details on how to spawn your robot with this world.
Run the following command:
ros2 launch gamefield launch_ign.launch.py-
Copy the folder:
./gamefield/sdfinto your robot's workspace in the folder:
./src/<your_package>/worlds -
Ensure that in the
gamefield.sdffile (in./src/<your_package>/worlds) this line:<uri>model://gamefield/sdf/My_GF.dae</uri>
and all of its instances change to the relative path of your
My_GF.dae, i.e.:<uri>model://src/<your_package>/worlds/My_GF.dae</uri>
-
In your
launch_sim.launch.py, assuming it is Gazebo Ignition Fortress compatible, change the name of the world togamefield.sdf, i.e.:default_world = os.path.join(get_package_share_directory(package_name), 'worlds', 'gamefield.sdf') world = LaunchConfiguration('world') world_arg = DeclareLaunchArgument( 'world', default_value=default_world, description='Path to the world SDF to load' )
-
Build your workspace:
colcon build --symlink-install
-
Source your workspace:
source install/setup.bash -
Then to launch the gamefield with the world in it, run:
ros2 launch <your_package> launch_sim.launch.py
Heads up: Ensure that your Gazebo clock is always running when trying to spawn the robot by clicking the play/pause button. A certain order is followed such that Gazebo should start with the world, then the robot spawns, then joint_broad starts, followed by diff_cont. Implement appropriate timer delays for this sequence to be followed rigidly.
Note: These instructions assume that the migration from Gazebo Classic to Ignition Fortress was done, making the robot's URDF compatible or spawnable.