Home - TVMD-UAV/TVMD-GZ-Sim GitHub Wiki

Installation

  • Test Environment: MS-WSL Ubuntu 22.04
  1. Install ROS2 Humble. Follow the instructions from ROS2 doc.
  2. Install rviz2.
    sudo apt install ros-humble-rviz2
    
  3. Install Gazebo ignition. Follow the instructions from Gazebo doc.
    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 http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
    sudo apt-get update
    
    sudo apt-get install libignition-gazebo<#>-dev
    

OpenGL Issue

If you are using Ubuntu 20.04, Gazebo Ignition requires OpenGL 3.3, but WSL do not support it natively.

  1. Check the OpenGL version by
    glxinfo | grep "OpenGL"
    
  2. Following from this issue, one can use kiask's PPA
    sudo add-apt-repository ppa:kisak/kisak-mesa
    sudo apt update
    
  3. Update drivers according to this answer
    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt update
    sudo apt upgrade
    
  4. After that, you can check your OpenGL version by excuting glxinfo | grep "OpenGL" again.
    OpenGL vendor string: Mesa
    OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
    OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.1.7 - kisak-mesa PPA
    OpenGL core profile shading language version string: 4.50
    OpenGL core profile context flags: (none)
    OpenGL core profile profile mask: core profile
    OpenGL core profile extensions:
    OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.1.7 - kisak-mesa PPA
    OpenGL shading language version string: 4.50
    OpenGL context flags: (none)
    OpenGL profile mask: compatibility profile
    OpenGL extensions:
    OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.1.7 - kisak-mesa PPA
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    OpenGL ES profile extensions:
    

Test Run

Default test run from PX4 tutorial.

make px4_sitl gz_standard_vtol

Run gazebo with a custom model. Assuming you have already built the PX4 firmware we customized, go to the project root and run the following command.

PX4_SYS_AUTOSTART=4007 ./build/px4_sitl_default/bin/px4