Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ClockSpeed" setting does not work with SimMode: Car #2163

Closed
patnolan33 opened this issue Aug 28, 2019 · 7 comments
Closed

"ClockSpeed" setting does not work with SimMode: Car #2163

patnolan33 opened this issue Aug 28, 2019 · 7 comments
Labels

Comments

@patnolan33
Copy link

When trying to set the clock speed to anything greater than 1 in SimMode: Car, the simulation still seems to run at real time (i.e. ClockSpeed = 1). The same setup was used in Multirotor mode and the clock speed was set as expected to faster than real time. I am on master and using the Docker setup to run AirSim (binary versions of the Docker scripts).

Here is a screenshot showing the Config clock speed versus the actual clock speed:
Screenshot from 2019-08-27 16-45-45

Here is the settings.json file that was loaded by AirSim:

{
  "SimMode": "Car", 
  "ClockSpeed": 50.0, 
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings_json.md", 
  "SettingsVersion": 1.2, 
  "LocalHostIp": "127.0.0.1",
  "Recording": {
      "RecordOnMove": false, 
      "Cameras": [
          {
              "PixelsAsFloat": false, 
              "Compress": true, 
              "ImageType": 0, 
              "CameraName": "Car1_Scene"
          }
      ], 
      "RecordInterval": 0.05
  }, 
  "CameraDefaults": {
      "Gimbal": {
          "Yaw": 0, 
          "Stabilization": 0, 
          "Roll": 0, 
          "Pitch": 0
      }, 
      "Yaw": 0, 
      "NoiseSettings": [
          {
              "HorzDistortionContrib": 1.0, 
              "HorzWaveScreenSize": 1.0, 
              "HorzDistortionStrength": 0.002, 
              "HorzWaveContrib": 0.03, 
              "RandSize": 500.0, 
              "HorzWaveStrength": 0.08, 
              "Enabled": false, 
              "RandContrib": 0.2, 
              "RandDensity": 2, 
              "HorzNoiseLinesDensityXY": 0.5, 
              "RandSpeed": 100000.0, 
              "HorzWaveVertSize": 1.0, 
              "HorzNoiseLinesContrib": 1.0, 
              "ImageType": 0, 
              "HorzNoiseLinesDensityY": 0.01
          }
      ], 
      "CaptureSettings": [
          {
              "OrthoWidth": 5.12, 
              "AutoExposureSpeed": 100, 
              "TargetGamma": 1.0, 
              "AutoExposureBias": 0, 
              "AutoExposureMinBrightness": 0.03, 
              "AutoExposureMaxBrightness": 0.64, 
              "Height": 144, 
              "ProjectionMode": "", 
              "Width": 256, 
              "FOV_Degrees": 90, 
              "MotionBlurAmount": 0, 
              "ImageType": 0
          }
      ], 
      "Pitch": 0, 
      "Y": 0, 
      "X": 0, 
      "Z": 0, 
      "Roll": 0
  },
  "Vehicles": {
      "Car1": {
          "EnableCollisions": true, 
          "VehicleType": "PhysXCar", 
          "Yaw": -180, 
          "DefaultVehicleState": "", 
          "EnableCollisionPassthrogh": false, 
          "Y": 0, 
          "Cameras": {
              "Car1_Scene": {
                  "Yaw": 0, 
                  "CaptureSettings": [
                      {
                          "Width": 256, 
                          "FOV_Degrees": 90, 
                          "ImageType": 0, 
                          "Height": 144
                      }
                  ], 
                  "Pitch": 0, 
                  "Y": 0, 
                  "X": 2.25, 
                  "Z": -0.75, 
                  "Roll": 0
              }, 
              "Car1_Depth": {
                  "Yaw": 0, 
                  "CaptureSettings": [
                      {
                          "Width": 256, 
                          "FOV_Degrees": 90, 
                          "ImageType": 3, 
                          "Height": 144
                      }
                  ], 
                  "Pitch": 0, 
                  "Y": 0, 
                  "X": 2.25, 
                  "Z": -0.75, 
                  "Roll": 0
              }
          }, 
          "AllowAPIAlways": true, 
          "X": 0, 
          "Z": -1
      }
  }
}
@GimpelZhang
Copy link
Contributor

GimpelZhang commented May 24, 2020

I got the same problem.

When I set the ClockSpeed to a value lower than 1.0, like 0.1, the screen output still showed:

ClockSpeed config, actual: 0.1, 1.0

Hardware, OS, etc.:

Memory: 56GB;

CPU: Intel® Core™ i7-8700 CPU @ 3.20GHz × 12

GPU: GeForce GTX 1070

OS: ubuntu 16.04

Airsim: until #2506

@GimpelZhang
Copy link
Contributor

I got the same problem.

When I set the ClockSpeed to a value lower than 1.0, like 0.1, the screen output still showed:

ClockSpeed config, actual: 0.1, 1.0

Hardware, OS, etc.:

Memory: 56GB;

CPU: Intel® Core™ i7-8700 CPU @ 3.20GHz × 12

GPU: GeForce GTX 1070

OS: ubuntu 16.04

Airsim: until #2506

More tests on this issue:

I tried the following settings on one same launch of the "Block" Environment.

  1. "SimMode": "Car", "VehicleType": "PhysXCar", "ClockSpeed": 1.0

The simulation performed normally.

  1. Then I changed the ClockSpeed to 0.1. I got the screen output:

ClockSpeed config, actual: 0.1, 1.0

  1. Next I changed the SimMode to "Multirotor" with a "SimpleFlight" VehicleType. The ClockSpeed stayed 0.1. This time I got the screen output:

ClockSpeed config, actual: 0.1, [a number near 0.1]

  1. Then I changed the settings back to "Car" SimMode and "PhysXCar" VehicleType, with the same 0.1 ClockSpeed. This time the screen output showed the actual ClockSpeed dropped gradually from 0.1 down to a number near ZERO.
    An interesting thing is: I could still move the car and got moving images, but the timestamps of the image response from simGetImages stuck at the first timestamp.

I guess the simulation speed of the car SimMode somehow cannot be changed now for some reason.

@GimpelZhang
Copy link
Contributor

I made a temporary fix on this issue: master branch

So now in my situation, in Car SimMode smaller than 1.0 ClockSpeed does provide "more dense" timestamps.

But I'm not sure if there is any side effects on other using conditions.

@sguttikon
Copy link

is there an official fix for this available ? The fork of @GimpelZhang is out-of-date

@jonyMarino
Copy link
Collaborator

This was fixed in #4305

@haotiangu
Copy link

Hello guys, I got stuck by the same problem. The set up about the clock speed in settings does not reflect on the Unreal Engine simulator. Still default clock speed. Any thoughts.

@GimpelZhang
Copy link
Contributor

Hello guys, I got stuck by the same problem. The set up about the clock speed in settings does not reflect on the Unreal Engine simulator. Still default clock speed. Any thoughts.

Hi, I haven't worked on this project for a long time. If they didn't fix it in the official repo, you have to deal with the AirSim code yourself.

If you want a further discussion, welcome to contact me via vx: junchuan89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants