Can't find copter camera sensor size [AirSim & Ardupilot ArduCopter]

86 Views Asked by At

Where I can find the sensor size (width and height) of the drone virtual camera?

Include context on what you are trying to achieve

I'm trying to analyze images that I get from the bottom center camera (number 3), but I need to know the camera sensor size.

Context details

I'm using v1.8.1 - Linux AirSimNH as a virtual environment with Ardupilot ArduCopter. Here's my setting.json:

{
"SettingsVersion":1.2,
"LogMessagesVisible":true,
"SimMode":"Multirotor",
"Vehicles":{
"Copter":{
"VehicleType":"ArduCopter",
"UseSerial":false,
"DefaultVehicleState":"Armed",
"LocalHostIp":"127.0.0.1",
"UdpIp":"127.0.0.1",
"UdpPort":9003,
"ControlPort":9002,
"AllowAPIAlways": true,
}
},
"CameraDefaults":{
"CaptureSettings":[
{
"ImageType":0,
"Width":600,
"Height":600,
"FOV_Degrees":90,
"AutoExposureSpeed":100,
"AutoExposureBias":0,
"AutoExposureMaxBrightness":0.64,
"AutoExposureMinBrightness":0.03,
"MotionBlurAmount":0,
"TargetGamma":1.0,
"ProjectionMode":"",
"OrthoWidth":10
}
],
"X": 0, "Y": 0, "Z": 0,
"Pitch": 0, "Roll": 0, "Yaw": 0
}
}

I searched through airsim, unreal engine, and ardupilot projects for any information, but found only setup for cinematicCamera. But I'm not sure that it's the correct camera used on copter. Does any have an idea where I can find this information?

1

There are 1 best solutions below

0
On

You can get sensor size senttings with the instructionsimGetFilmbackSettings and the focal lenght with simGetFocalLength:

import airsim

client = airsim.MultirotorClient()
sensor_specs = client.simGetFilmbackSettings("front_left_custom")
focal_lenght = client.simGetFocalLength("front_left_custom")

The output of the sensor specs is a string, you might need to parse the numbers.