Skip to content

Commit 387c4d2

Browse files
committed
AP_HAL_SITL: add camera simulation object
Add a new SIM_Camera object to SITL, similar to existing Sprayer and Gripper payload simulations. The camera simulation can be enabled via SIM_CAM_ENABLE and supports triggering image capture via: - servo output (TRIG_SRV + TRIG_PWM) - GPIO pin (GPIO) When triggered, the camera increments an internal image counter and sends a GCS message indicating capture.
1 parent b2ec483 commit 387c4d2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libraries/AP_HAL_SITL/SITL_State.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ void SITL_State::_sitl_setup()
5454
#endif
5555

5656
sitl_model->set_buzzer(&_sitl->buzzer_sim);
57+
#if AP_SIM_CAM_ENABLED && AP_SIM_MAX_CAMERAS > 0
58+
for (uint8_t i = 0; i < AP_SIM_MAX_CAMERAS; i++) {
59+
sitl_model->add_camera(&_sitl->camera_sim[i]);
60+
}
61+
#endif
5762
sitl_model->set_sprayer(&_sitl->sprayer_sim);
5863
sitl_model->set_gripper_servo(&_sitl->gripper_sim);
5964
sitl_model->set_gripper_epm(&_sitl->gripper_epm_sim);

0 commit comments

Comments
 (0)