Airsim: Possible to add Cameras to the Drone?

Created on 22 Feb 2018  路  14Comments  路  Source: microsoft/AirSim

Is it possible to add a camera to the drone? What files would you have to change besides FlyingPawn.cpp?
Thanks!

Most helpful comment

I have done this previously, you'll also need to make changes in FlyingPawn.h, VehicleWrapper.cpp. I followed the code starting from multiRotorAPI simGetImage method. I can outline the specific changes that I made if that isn't enough

All 14 comments

You will have to modify the BP_FlyingPawn blueprint with the added camera and parameters, and then inside FlyingPawn.cpp, add your reference to it, making sure to add it to the camera list.

@zergler thanks for the reply back! So I'm currently doing that right now but when I try and do ImageRequest for that camera then my UnrealEngine crashes. Any ideas of things I could be missing?

Hmm I'm not sure. You could launch UE4Editor inside gdb and then run r /path/to/airsim/Unreal/Environments/Blocks/Blocks.uproject to get a stack track. That might point out the problem.

I have done this previously, you'll also need to make changes in FlyingPawn.h, VehicleWrapper.cpp. I followed the code starting from multiRotorAPI simGetImage method. I can outline the specific changes that I made if that isn't enough

@DavidLSmyth thanks for the response! I made changes in FlyingPawn.h to add my camera. What other changes in VehicleWrapper.cpp would I need to add? Thanks so much!

Just got it working I think! Thanks for the help @zergler! @DavidLSmyth I didn't end up changing anything in VehicleWrapper.cpp was still curious what you changed?

Just curious, why you need additional cameras. We already have 5 cameras on the drone...

Hi @sytelus , not the OP but might have an answer to your question. Since my team and I would like to duplicate camera rig configurations from real vehicles (we have many) and test new ones, it helps to be able to specify the exact number, position and orientation of each camera, which I'm currently attempting to do similar to the methods discussed on this thread. Even though my use is for the car, I'd imagine there's a similar reason for wanting this option on a drone.

For now you might be able to just change values here: https://github.com/Microsoft/AirSim/blob/master/Unreal/Plugins/AirSim/Source/Car/CarPawn.cpp#L123

In long run we want to be able to specify this through json settings.

@DavidLSmyth, Can you go over the changes or attach files to the comment so I can personally go through the changes? I need multiple stereo cameras on the multirotor. Thank you.

@nalinraut do you mean you need multiple cameras for stereo vision? I don't think unreal provides stereo cameras. The changes were merged for the multirotor, see above

@DavidLSmyth If I am not wrong, I can use the left and right camera as a stereo pair using the simGetImages API. Thank you!

@olivia-skydio Did you only make changes to FlyingPawn.h or are there more changes to other scripts? Thank you!

hey @nalinraut, see my comment here https://github.com/Microsoft/AirSim/issues/1770#issuecomment-462949223

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MattChanTK picture MattChanTK  路  3Comments

zywOwO picture zywOwO  路  3Comments

HereIsPatrick picture HereIsPatrick  路  3Comments

Kim-BongSu picture Kim-BongSu  路  3Comments

Mayankm96 picture Mayankm96  路  4Comments