当前位置: 首页 > article >正文

2025-gazebo配置on vmware,wsl

ros2安装

# 安装ros2, 推荐鱼香ros一键式安装
wget http://fishros.com/install -O fishros && . fishros

安装版本:ubuntu24.04 + ros2 jazzy

gazebo

Getting Started with Gazebo? — Gazebo ionic documentation

ros与gz的版本对应关系:

在这里插入图片描述

​ 使用推荐版本安装

sudo apt-get install ros-${ROS_DISTRO}-ros-gz

Try

# Fortress uses "ign gazebo" instead of "gz sim"
gz sim

vmware

​ 起初使用ubuntu20.04+ros2-humble,安装的gazebo测试黑屏,遇到了如下issure提交的信息:(总结,与qt相关,尚未解决)

VMWare Ubuntu: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. · Issue #618 · gazebosim/gz-gui

​ 一些解决办法,并不work,会有其他error。

# method 1, not work
export LIBGL_DRI3_DISABLE=1
# method 2, not work
export SVGA_VGPU10=0

ubuntu24.04+ros2-jazzy实测还是类似问题:
在这里插入图片描述
​ 一个老办法,关闭vmware的3D加速,但是感觉不能接受,转战wsl。

wsl

参考官方教程:

旧版本 WSL 的手动安装步骤 |Microsoft 学习 — Manual installation steps for older versions of WSL | Microsoft Learn

wsl --install
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

下载并手动安装24发行版:

在这里插入图片描述

# 该链接是下载的Appxbundle,先执行下面步骤,解压后得到一系列appx版本
Rename-Item .\Ubuntu[your version].appx Ubuntu.zip
Expand-Archive .\Ubuntu.zip -Verbose
cd .\Ubuntu\
.\ubuntu[your version].exe

安装完成测试gz sim发现帧率并不高,找到了相关issure中,执行NVIDIA的环境变量。

Windows Docker 中的 Gazebo 无法使用 Nvidia GPU,回退到使用 CPU。·问题 #2595 ·凉亭/GZ-SIM — Gazebo in Windows Docker cannot use Nvidia GPU, falls back to using CPU. · Issue #2595 · gazebosim/gz-sim

echo "export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA" > ~/.bashrc

如下是前后对比(将核显改成了nvidia显卡):

dod@qDoDp:~$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (Intel(R) UHD Graphics) (0xffffffff)
    Version: 24.2.8
    Accelerated: yes
    Video memory: 16429MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.1
    Max compat profile version: 4.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
……

dod@qDoDp:~$ export MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA

dod@qDoDp:~$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (NVIDIA GeForce GTX 1660 Ti) (0xffffffff)
    Version: 24.2.8
    Accelerated: yes
    Video memory: 22267MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
……

在这里插入图片描述

遇到的warning(暂未解决,但似乎没有影响):

dod@qDoDp:~$ gz sim
libEGL warning: failed to open /dev/dri/renderD128: Permission denied

libEGL warning: failed to open /dev/dri/renderD128: Permission denied

libEGL warning: NEEDS EXTENSION: falling back to kms_swrast

http://www.kler.cn/a/592198.html

相关文章:

  • android MutableLiveData setValue 响应速速 postValue 快
  • 网络爬虫【爬虫库urllib】
  • 织梦DedeCMS优化文章模版里的“顶一下”与“踩一下”样式
  • VulnHub-matrix-breakout-2-morpheus通关攻略
  • 启幕数据结构算法雅航新章,穿梭C++梦幻领域的探索之旅——二叉树序列构造探秘——堆的奥义与实现诗篇
  • redis缓存更新策略
  • Superagent 异步请求:如何处理复杂的 HTTP 场景
  • C#中修饰符——abstract、virtual
  • 领略算法真谛:01背包问题
  • 深入理解 Linux ALSA 音频架构:从入门到驱动开发
  • LeetCode算法题(Go语言实现)_05
  • Linux--内核进程O(1)调度队列
  • HTML 图像与多媒体元素:拓展学习边界的进度记录(一)
  • LinkedList 底层源码深度解析
  • 【蓝桥杯每日一题】3.17
  • 基于springboot的房屋租赁系统(008)
  • Mysql相关知识:存储引擎、sql执行流程、索引失效
  • AI 大模型统一集成|微服务 + 认证中心:如何保障大模型 API 的安全调用!
  • Elasticsearch 索引
  • 言简意赅 Linux部署elasticsearch7.15.2