# Camera in simulation

**URL:** <https://discuss.px4.io/t/camera-in-simulation/39296>\
**Category:** MAVSDK\
**Created:** [June 18, 2024, 3:03pm UTC](https://discuss.px4.io/t/camera-in-simulation/39296 "2024-06-18T15:03:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Argo\_Saakyan](https://discuss.px4.io/user_avatar/discuss.px4.io/argo_saakyan/32/16645_2.png) [@Argo\_Saakyan](https://discuss.px4.io/u/Argo_Saakyan)\
**Post date:** [June 18, 2024, 3:03pm UTC](https://discuss.px4.io/t/camera-in-simulation/39296/1 "2024-06-18T15:03:59Z")

</div>

Hey everyone, pretty new here. I have `PX4-Autopilot, QGroundControl, mavsdk` installed on ubuntu. I was able to start a jmavsim and control the drone using python. Now I want to:

- Take a picture from that drone of the simulation env (downside view from drone);
- Add some obstacles in the sim env.

I tried camera connection from [this example](https://github.com/mavlink/MAVSDK-Python/blob/fca61e3db0be16f3fc54df799fb6fbb785a362f3/examples/camera.py), `await drone.camera.set_mode(Mode.PHOTO)` but got timeout error. Is there a way to emulate a camera? Maybe I am suing wring simulator? Anyways, any suggestions on how to achieve this goal appreciated.

---

<div class="post-metadata">

**Author:** ![Argo\_Saakyan](https://discuss.px4.io/user_avatar/discuss.px4.io/argo_saakyan/32/16645_2.png) [@Argo\_Saakyan](https://discuss.px4.io/u/Argo_Saakyan)\
**Post date:** [June 21, 2024, 9:22am UTC](https://discuss.px4.io/t/camera-in-simulation/39296/2 "2024-06-21T09:22:23Z")

</div>

I tired using gazebo with `make px4_sitl gz_x500_baylands` and `make px4_sitl gz_x500_mono_cam_baylands` but got the same timeout error while trying to capture a photo. At least with `bayland` I don’t need to create objects anymore. I now only need a way to capture frames from mavsdk of gazebo env.

I use [this part of documentation](https://docs.px4.io/main/en/sim_gazebo_gz/vehicles.html#x500-quadrotor-with-monocular-camera)
