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

msgpackrpc.error.RPCError: rpclib: server could not find function 'simStartRace' with argument count 1. #40

Closed
hany606 opened this issue Aug 25, 2019 · 3 comments

Comments

@hany606
Copy link

hany606 commented Aug 25, 2019

Hi, I am trying to run baseline_racer.py, but I got an error.

The version of the api is the latest one after performing upgrade with pip as follows sudo pip3 install --upgrade airsimneurips and the repository's version is the master branch and the latest version.

My settings.json:

{
  "ClockSpeed": 1,
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md",
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor",
  "Vehicles": {
    "drone_1": {
      "Cameras": {
        "fpv_cam": {
          "CaptureSettings": [
            {
              "FOV_Degrees": 90,
              "Height": 240,
              "ImageType": 0,
              "Width": 320
            }
          ],
          "Pitch": 0.0,
          "Roll": 0.0,
          "X": 0.25,
          "Y": 0.0,
          "Yaw": 0.0,
          "Z": 0.0
        }
      },
      "Pitch": 0.0,
      "Roll": 0.0,
      "VehicleType": "SimpleFlight",
      "X": 0.0,
      "Y": 0.0,
      "Yaw": 0.0,
      "Z": 0.0
    },
    "drone_2": {
      "Pitch": 0.0,
      "Roll": 0.0,
      "VehicleType": "SimpleFlight",
      "X": 0.0,
      "Y": 1.0,
      "Yaw": 0.0,
      "Z": 0
    }
  }
}

I got the following error:

  File "baseline_racer.py", line 283, in <module>
    main(args)
  File "baseline_racer.py", line 250, in main
    baseline_racer.start_race(args.race_tier)
  File "baseline_racer.py", line 41, in start_race
    self.airsim_client.simStartRace(tier)
  File "/usr/local/lib/python3.6/dist-packages/airsimneurips/client.py", line 132, in simStartRace
    self.client.call('simStartRace', tier)
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/session.py", line 41, in call
    return self.send_request(method, args).get()
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/future.py", line 45, in get
    raise error.RPCError(self._error)
msgpackrpc.error.RPCError: rpclib: server could not find function 'simStartRace' with argument count 1.

Also, I tried an older version of the api 0.0.14 and an older version of the repository v0.1.2, and it worked after some slight modifications in the code and there were no errors.

Thanks in advance.

@msb336
Copy link
Contributor

msb336 commented Aug 26, 2019

@hany606 that API is released with the latest environment binary. If you are using an older release, simStartRace, simResetRace, simGetObjectScale, and simSetObjectScale, will not be available. You can find the latest linux release here.

@hany606
Copy link
Author

hany606 commented Aug 28, 2019

@msb336 Yeah it works with the newest release, I didn't see the new release, thank you.
But when I run it, it was weird to get some errors like that:

Traceback (most recent call last):
  File "baseline_racer.py", line 283, in <module>
    main(args)
  File "baseline_racer.py", line 251, in main
    baseline_racer.initialize_drone()
  File "baseline_racer.py", line 49, in initialize_drone
    self.airsim_client.enableApiControl(vehicle_name=self.drone_name)
  File "/usr/local/lib/python3.6/dist-packages/airsimneurips/client.py", line 49, in enableApiControl
    return self.client.call('enableApiControl', True, vehicle_name)
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/session.py", line 41, in call
    return self.send_request(method, args).get()
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/future.py", line 45, in get
    raise error.RPCError(self._error)
msgpackrpc.error.RPCError: rpclib: function 'enableApiControl' (called with 2 arg(s)) threw an exception. The exception contained this information: Vehicle API for 'drone_1' is not available. This could either because this is simulation-only API or this vehicle does not exist.

then I removed the argument vehicle_name=self.drone_name from all the functions and it worked.

And also got

Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "baseline_racer.py", line 217, in repeat_timer_image_callback
    task()
  File "baseline_racer.py", line 198, in image_callback
    response = self.airsim_client_images.simGetImages(request)
  File "/usr/local/lib/python3.6/dist-packages/airsimneurips/client.py", line 172, in simGetImages
    responses_raw = self.client.call('simGetImages', requests, vehicle_name)
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/session.py", line 41, in call
    return self.send_request(method, args).get()
  File "/usr/local/lib/python3.6/dist-packages/msgpackrpc/future.py", line 45, in get
    raise error.RPCError(self._error)
msgpackrpc.error.RPCError: rpclib: function 'simGetImages' (called with 2 arg(s)) threw an exception. The exception contained this information: invalid map<K, T> key.

and it is solved by exchange "fpv_cam" argument with 0 in request = [airsim.ImageRequest("fpv_cam", airsim.ImageType.Scene, False, False)] and it worked without any errors.

Everything work now, thank you.

Note: My setup is: the API is running on Linux and the simulator on different machine on windows.

@msb336
Copy link
Contributor

msb336 commented Aug 28, 2019

Make sure you have the right settings configuration by running generate_settings_file.py. Your errors are because baseline_racer expects a specific configuration for the simulation.

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

No branches or pull requests

3 participants