-
Notifications
You must be signed in to change notification settings - Fork 95
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
Recording on multiple cameras at once #132
Comments
Can you share your setting.json and the simgetimages call snippet so we can repro this? It should not crash with rgb and depth itself. |
Before generating settings.json, I added the following code to the
Settings.json:
Here's the callback functions (one for rgb, one for depth) that poll their respective airsim clients.
I tried polling a shared client, but that resulted in crashing immediately. |
ok, you need a "capture" not a new "camera" use this: {
"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
},
{
"FOV_Degrees": 90,
"Height": 240,
"ImageType": 1,
"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": 0.0,
"Yaw": 0.0,
"Z": 0.0
}
}
} in general, here's another example https://github.com/microsoft/AirSim/blob/master/ros/src/airsim_tutorial_pkgs/settings/front_stereo_and_center_mono.json Your python code should be responses = self.airsim_client.simGetImages([
airsim.ImageRequest("fpv_cam", airsim.ImageType.Scene, False, False),
airsim.ImageRequest("fpv_cam", airsim.ImageType.DepthPlanner, True)
])
if responses[0].height > 0:
img_rgb_1d = np.fromstring(response[0].image_data_uint8, dtype=np.uint8)
img_rgb = img_rgb_1d.reshape(response[0].height, response[0].width, 3)
if responses[1].height > 0:
depth_img = airsim.list_to_2d_float_array(responses[1].image_data_float, responses[1].width, responses[1].height)
|
@madratman ah ok, thank you for the clarification. I cleaned up my code and used your settings.json file, but it's still crashing and I'm getting a different error post-crash:
|
Ensure you are using a single airsim client per thread |
I am using that code, so I'm not sure why it would be crashing. I tried to just get depth image to see if it was a bottleneck issue with processing two images at once, but the same Not sure if this will help, but here's my
|
I'm having trouble with recording data when running the
baseline_racer.py
simulation. I am trying to collect RGB-D data, so I added a second camera to the drone to collect Depth frames that are synchronized to RGB frames.When I run the basic
baseline_racer.py
with modified settings for two cameras, it runs for about 5 seconds and then crashes. I tried to create multiple client and individual threads for polling RGB and Depth separately, but it didn't help.The issue #7 states that there is a bottleneck issue with Unreal, but I was wondering if there was a way around this that doesn't break the simulation.
The text was updated successfully, but these errors were encountered: