Livox-SDK / livox_laser_simulation

A package to provide plug-in for Livox Series LiDAR.
MIT License
198 stars 61 forks source link

在gazebo中新建了个办公室环境,把mid360加入机器人中,发现明显卡顿 #20

Closed seanXMU closed 1 year ago

seanXMU commented 1 year ago

我在gazebo中新建了个简单的办公室环境,把mid360加入机器人中,移动机器人发现明显卡顿;gazebo仿真大概两三秒动一次,我把mid360移除后立马就正常了。请问是怎么回事呢? 图片

seanXMU commented 1 year ago

图片 real time factor仅有0.7左右而无法提升,gazebo模型再丰富点可以掉到0.07

georgflick commented 1 year ago

The simulation of the livox mid360 is not GPU based, so it is only running on the CPU and that could be slow (depending on your CPU etc.)

seanXMU commented 1 year ago

The simulation of the livox mid360 is not GPU based, so it is only running on the CPU and that could be slow (depending on your CPU etc.)

Is there any relevant information that I can refer to to modify it to be based on GPU?

georgflick commented 1 year ago

We have implemented a GPU based simulator for the mid360 sensor. But it is tricky to build and we do not give support for it. If you want to use it as a base or something, here are the repos:

  1. You need to build gazebo from that PR https://github.com/gazebosim/gazebo-classic/pull/3205
  2. Use our forked repo https://github.com/enwaytech/livox_laser_simulation
seanXMU commented 1 year ago

Thank you very much for your answer!But I encountered the following error when compiling this repos: /home/seanxxcheng/tool/gpu_livox/src/livox_laser_simulation/include/livox_laser_simulation/livox_gpu_points_plugin.h:36:30: error: ‘ConstLaserScanAnglesStampedPtr’ has not been declared 36 | void OnNewLaserAnglesScans(ConstLaserScanAnglesStampedPtr& _msg); Can https://github.com/enwaytech/livox_laser_simulation be compiled and used directly? Or do I need to rebuild gazebo based on https://github.com/gazebosim/gazebo-classic/pull/3205?

georgflick commented 1 year ago

Thank you very much for your answer!But I encountered the following error when compiling this repos: /home/seanxxcheng/tool/gpu_livox/src/livox_laser_simulation/include/livox_laser_simulation/livox_gpu_points_plugin.h:36:30: error: ‘ConstLaserScanAnglesStampedPtr’ has not been declared 36 | void OnNewLaserAnglesScans(ConstLaserScanAnglesStampedPtr& _msg); Can https://github.com/enwaytech/livox_laser_simulation be compiled and used directly? Or do I need to rebuild gazebo based on gazebosim/gazebo-classic#3205?

Oh, true, you need to build our fork with the modifications from here: https://github.com/enwaytech/gazebo branch devel-enway to have also the laser scan message with angles.

seanXMU commented 1 year ago

Thank you very much! Now I can run it.

shenhayi commented 3 months ago

Sorry, I also tried to use this GPU-accelerated simulation. The environment is in docker and the Nvidia support is fine. I build the gazebo and the package successfully, but the result didn't look like GPU-accelerated and I didn't see any processes in the docker's Nvidia-smi, do you guys know how to fix this?