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

Issue in MultiRotor movement using simSetVehiclePose #100

Open
mhe1999 opened this issue Aug 6, 2024 · 0 comments
Open

Issue in MultiRotor movement using simSetVehiclePose #100

mhe1999 opened this issue Aug 6, 2024 · 0 comments

Comments

@mhe1999
Copy link

mhe1999 commented Aug 6, 2024

Bug report

  • AirSim Version/#commit: Latest commit
  • UE/Unity version: Unreal Engine 5.4.3
  • autopilot version: N/A
  • OS Version: Windows 11

What's the issue you encountered?

I have installed and built the Colosseum on my system. My main goal is to use the lidar sensor. I currently can run the plugin on UE5.

  1. I can run with the multirotor mode, with or without lidar.
  2. I can run the ComputerVision mode, without lidar.
  3. I cannot run the plugin with the car and I get this error in the popup message:
    Error at startup: Failed to load asset class - Class'/AirSim/VehicleAdv/SUV/SuvCarPawn.SuvCarPawn_C'
    

Additionally, while I can run in the multirotor mode with the lidar, the problem is that I cannot move the multirotor. I need to use the API and not the controller. I tried to move it using the API with simSetVehiclePose() in the PhysicsEngineName: ExternalPhysicsEngine. The reason is that I want to simulate the movement of a different robot whose movement of the camera is not as smooth as the multirotor, and I want to simulate the movement using Python code.

Settings

{
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/main/docs/settings.md",
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor",
  "PhysicsEngineName": "ExternalPhysicsEngine",
  "Vehicles": {
    "Drone1": {
      "VehicleType": "simpleflight",
      "AutoCreate": true,
      "DefaultVehicleState": "Armed"
    }
  }
}

Code

import airsim

# Connect to AirSim
client = airsim.MultirotorClient()
client.confirmConnection()

# Enable API control
client.enableApiControl(True)
initial_pose = airsim.Pose(airsim.Vector3r(0, 0, -10), airsim.to_quaternion(0, 0, 0))
set_pose_response = client.simSetVehiclePose(initial_pose, ignore_collision=True)

I also tried the function with and without the "vehicle_name" attribute, same error. I also tried to use the codes in the "Colosseum\PythonClient\multirotor", for example, the survey.py, hello_drone.py. I get the same error as the @chaoer in the #99, but that is a problem for another issue.

Include full error message in text form

Connected!
Client Ver:1 (Min Req: 1), Server Ver:1 (Min Req: 1)

Traceback (most recent call last):
  File "engine.py", line 10, in <module>
    set_pose_response = client.simSetVehiclePose(initial_pose, ignore_collision=True)
  File "Python38\lib\site-packages\airsim\client.py", line 460, in simSetVehiclePose
    self.client.call('simSetVehiclePose', pose, ignore_collision, vehicle_name)
  File "Python38\lib\site-packages\msgpackrpc\session.py", line 41, in call
    return self.send_request(method, args).get()
  File "Python38\lib\site-packages\msgpackrpc\future.py", line 45, in get
    raise error.RPCError(self._error)
msgpackrpc.error.RPCError: rpclib: function 'simSetVehiclePose' (called with 3 arg(s)) threw an exception. The exception contained this information: bad cast.

Questions

  1. Is it possible to use a lidar sensor in the computer vision mode? From what I understand from reading the issues in the original AirSim Repo, it is not possible, but I might be wrong.
  2. I couldn't find how to solve the problem of loading the SuvCarPawn class. It is not the main question of this issue, but if you could help, that would be awesome.
  3. How can I move the multirotor using Python code and API, specifically using the ExternalPhysicsEngine? Additionally, how can I solve the error mentioned above?
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

Successfully merging a pull request may close this issue.

1 participant