microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.29k stars 4.53k forks source link

Low FPS in ROS with AirSim drone #3297

Open giovannifagotti opened 3 years ago

giovannifagotti commented 3 years ago

Question

What's your question?

Hello everyone, I'm using the Unreal Plugin of Airsim in combination with ROS to record a rosbag with the drone. Since I have a very low frame rate in ROS, I would like to increase it reducing the parameter "ClockSpeed" in settings.json. After this setting, I effectively noticed that the simulator speed has become slower, but in ROS I continue to record with the old frame rate. There are some parameters to set also in ROS that I have missed?

Include context on what you are trying to achieve

I would like to record a rosbag with the AirSim drone at 20fps for each camera.

Context details

Include details of what you already did to find answers

I'm using the "NoDisplay" mode in the settings.json and, with a clock speed of 1.0, I can obtain 10 fps. Consequntly, I set the clock speed to 0.5, but I continue to get 10 fps while recording the rosbag. In the launch file, I have setted the "update_airsim_img_response_every_n_sec" at 0.01. Can someone explain how to use the parameter "ClockSpeed" to get a higher frame rate in ROS?

Thank you for your support,

GF

GimpelZhang commented 3 years ago

From my experience, in the "Multirotor" SimMode, the ClockSpeed setting does work (AirSim version until early September, 2020) with ROS. Which means ClockSpeed lower than 1.0 could make the image freq "more dense".

Maybe you can check the timestamps of the image rostopics directly to see if they get higher frequency instead of a "rostopic hz" command from a terminal.

giovannifagotti commented 3 years ago

Thanks for your answer,

I have recorded 2 different rosbags with "ClockSpeed" 1.0 and 0.5 and then, as suggested, I have checked the time interval bethween every consecuteve frames:

Again, if I play the rosbag recorded with 0.5 ClockSpeed and I watch the image topic with rqt_image_view, I notice that the drone goes slower, instead of having a higher frame rate.

alberto1995 commented 3 years ago

I have the same problem

GimpelZhang commented 3 years ago

Maybe have a try at the settings:

"PhysicsEngineName": "FastPhysicsEngine", "ClockType": "SteppableClock",

And have you seen an screen output similar to the one in the red rectangle? airsim_block_car_screen

alberto1995 commented 3 years ago

image

Tried those settings, nothing changed... I can see the right clockspeed in the simulator, but in ROS I have only a slower recorded video instead of a higher frame rate.

GimpelZhang commented 3 years ago

image

Tried those settings, nothing changed... I can see the right clockspeed in the simulator, but in ROS I have only a slower recorded video instead of a higher frame rate.

I'm sorry I forgot those are default settings.

alberto1995 commented 3 years ago

Any suggestion?

Thank you

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last year. It will be closed if no further activity occurs within 20 days.

77788888 commented 2 years ago

how to increate the frame per second of the depth image in AirSim