Exemplo n.º 1
0
/// 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);
    }
}
Exemplo n.º 2
0
/// 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;
    }
}
Exemplo n.º 3
0
/// 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();
}
Exemplo n.º 4
0
/// 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;
    }
}
Exemplo n.º 5
0
/// 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;
	}
}