microsoft / AirSim

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

Fixing camera position and angle in Game Mode #1065

Open kshitijgoel007 opened 6 years ago

kshitijgoel007 commented 6 years ago

HI!

Thanks for keeping various modes for the following camera in game mode. I am trying to fix the camera in position and orientation, instead of moving it with the vehicle. Is it possible in the current API? I think the manual mode (activated by pressing 'M' in game mode) is the closest to this point, but that too follows the vehicle.

Thanks in advance!

Kshitij

Robin-Wong commented 6 years ago

The modify on camera's orientation must in Game Thread. I using the code UAirBlueprintLib::RunCommandOnGameThread([&param, camera]() { cameta->SetActorRotation(param); }, true); for modify the camera's orientation in my own thread.

husha1993 commented 6 years ago

https://github.com/Microsoft/AirSim/blob/d088719d0b4bf19901e96045581c21177158816d/PythonClient/AirSimClient.py#L500

We can set the camera orientation relative to the drone body frame. But I haven't found the api for set the camera position yet.

sytelus commented 6 years ago

Manual view mode shouldn't move the camera. Are you using Computer Vision mode, drone or car?

kshitijgoel007 commented 6 years ago

@sytelus I am using CV Mode on a multirotor. Observing what @husha1993 is observing, can not set orientation independent of vehicle's orientation. Camera is moving with the vehicle as well.

kshitijgoel007 commented 6 years ago

@sytelus I am trying to create support for this (and corresponding pull request). Can you provide me some background on how the manual view camera works?