/// single entry point to take pictures /// set send_mavlink_msg to true to send DO_DIGICAM_CONTROL message to all components void AP_Camera::trigger_pic(bool send_mavlink_msg) { _image_index++; switch (_trigger_type) { case AP_CAMERA_TRIGGER_TYPE_SERVO: servo_pic(); // Servo operated camera break; case AP_CAMERA_TRIGGER_TYPE_RELAY: relay_pic(); // basic relay activation break; } if (send_mavlink_msg) { // create command long mavlink message mavlink_command_long_t cmd_msg; memset(&cmd_msg, 0, sizeof(cmd_msg)); cmd_msg.command = MAV_CMD_DO_DIGICAM_CONTROL; cmd_msg.param5 = 1; // create message mavlink_message_t msg; mavlink_msg_command_long_encode(0, 0, &msg, &cmd_msg); // forward to all components GCS_MAVLINK::send_to_components(&msg); } }
/// distance_pic - triggers picture when within 3m of waypoint void AP_Camera::distance_pic() { if (wp_distance < AP_CAMERA_WP_DISTANCE) { servo_pic(); // triggering method } }
void Camera::distance_pic() // pictures blurry? use this trigger. Turns off the throttle until closer to waypoint then takes the picture and re-enables the throttle. { g.channel_throttle.radio_out = g.throttle_min; if (wp_distance < 3){ servo_pic(); // triggering method g.channel_throttle.radio_out = g.throttle_cruise; } }
/// pictures blurry? use this trigger. Turns off the throttle until closer to waypoint then takes the picture and re-enables the throttle. void AP_Camera::distance_pic() { // TODO find a way to do this without using the global parameter g // g.channel_throttle.radio_out = g.throttle_min; if (wp_distance < 3){ servo_pic(); // triggering method // g.channel_throttle.radio_out = g.throttle_cruise; } }
void Camera::throttle_pic() // pictures blurry? use this trigger. Turns off the throttle until for # of cycles of medium loop then takes the picture and re-enables the throttle. { g.channel_throttle.radio_out = g.throttle_min; if (thr_pic == 10){ servo_pic(); // triggering method thr_pic = 0; g.channel_throttle.radio_out = g.throttle_cruise; } thr_pic++; }
/// pictures blurry? use this trigger. Turns off the throttle until for # of cycles of medium loop then takes the picture and re-enables the throttle. void AP_Camera::throttle_pic() { // TODO find a way to do this without using the global parameter g // g.channel_throttle.radio_out = g.throttle_min; if (_thr_pic_counter == 10) { servo_pic(); // triggering method _thr_pic_counter = 0; // g.channel_throttle.radio_out = g.throttle_cruise; } _thr_pic_counter++; }
/// single entry point to take pictures void AP_Camera::trigger_pic() { switch (_trigger_type) { case AP_CAMERA_TRIGGER_TYPE_SERVO: servo_pic(); // Servo operated camera break; case AP_CAMERA_TRIGGER_TYPE_RELAY: relay_pic(); // basic relay activation break; } }
/// single entry point to take pictures /// set send_mavlink_msg to true to send DO_DIGICAM_CONTROL message to all components void AP_Camera::trigger_pic() { setup_feedback_callback(); _image_index++; switch (_trigger_type) { case AP_CAMERA_TRIGGER_TYPE_SERVO: servo_pic(); // Servo operated camera break; case AP_CAMERA_TRIGGER_TYPE_RELAY: relay_pic(); // basic relay activation break; } log_picture(); }
/// single entry point to take pictures void AP_Camera::trigger_pic() { switch (_trigger_type) { case AP_CAMERA_TRIGGER_TYPE_SERVO: servo_pic(); // Servo operated camera break; case AP_CAMERA_TRIGGER_TYPE_RELAY: relay_pic(); // basic relay activation break; case AP_CAMERA_TRIGGER_TYPE_THROTTLE_OFF_TIME: throttle_pic(); // pictures blurry? use this trigger. Turns off the throttle until for # of cycles of medium loop then takes the picture and re-enables the throttle. break; case AP_CAMERA_TRIGGER_TYPE_WP_DISTANCE: distance_pic(); // pictures blurry? use this trigger. Turns off the throttle until closer to waypoint then takes the picture and re-enables the throttle. break; case AP_CAMERA_TRIGGER_TYPE_TRANSISTOR: transistor_pic(); // hacked the circuit to run a transistor? use this trigger to send output. break; } }
/// single entry point to take pictures void AP_Camera::trigger_pic() { switch (trigger_type) { case 0: servo_pic(); // Servo operated camera break; case 1: relay_pic(); // basic relay activation break; case 2: throttle_pic(); // pictures blurry? use this trigger. Turns off the throttle until for # of cycles of medium loop then takes the picture and re-enables the throttle. break; case 3: distance_pic(); // pictures blurry? use this trigger. Turns off the throttle until closer to waypoint then takes the picture and re-enables the throttle. break; case 4: NPN_pic(); // hacked the circuit to run a transistor? use this trigger to send output. break; } }