1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

LP-385 - Initial CameraControl module commit

This commit is contained in:
Alessio Morale 2016-08-18 12:40:34 +02:00
parent 22969c5e17
commit c7e060c04a
6 changed files with 146 additions and 0 deletions

View File

@ -0,0 +1,63 @@
/**
******************************************************************************
*
* @file cameracontrol.c
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* @brief camera control module. triggers cameras with multiple options
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Additional note on redistribution: The copyright and license notices above
* must be maintained in each individual source file that is a derivative work
* of this source file; otherwise redistribution is prohibited.
*/
#include <openpilot.h>
#include "inc/cameracontrol.h"
#include <cameradesired.h>
#include <cameracontrolsettings.h>
#include <cameracontrolactivity.h>
#include <hwsettings.h>
/*
// Private variables
static struct CameraControl_data {
portTickType lastSysTime;
} *ccd;
*/
//static void setOutput();
/**
* Initialise the module, called on startup
* \returns 0 on success or -1 if initialisation failed
*/
int32_t CameraControlInitialize(void)
{
return 0;
}
/* stub: module has no module thread */
int32_t CameraControlStart(void)
{
return 0;
}
MODULE_INITCALL(CameraControlInitialize, CameraControlStart);

View File

@ -0,0 +1,36 @@
/**
******************************************************************************
*
* @file cameracontrol.h
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* @brief camera control module. triggers cameras with multiple options
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Additional note on redistribution: The copyright and license notices above
* must be maintained in each individual source file that is a derivative work
* of this source file; otherwise redistribution is prohibited.
*/
#ifndef FLIGHT_MODULES_CAMERACONTROL_INC_CAMERACONTROL_H
#define FLIGHT_MODULES_CAMERACONTROL_INC_CAMERACONTROL_H
#endif /* FLIGHT_MODULES_CAMERACONTROL_INC_CAMERACONTROL_H */

View File

@ -112,6 +112,8 @@ UAVOBJSRCFILENAMES += receiveractivity
UAVOBJSRCFILENAMES += receiverstatus
UAVOBJSRCFILENAMES += cameradesired
UAVOBJSRCFILENAMES += camerastabsettings
UAVOBJSRCFILENAMES += cameracontrolsettings
UAVOBJSRCFILENAMES += cameracontrolactivity
UAVOBJSRCFILENAMES += altitudeholdsettings
UAVOBJSRCFILENAMES += oplinksettings
UAVOBJSRCFILENAMES += oplinkstatus

View File

@ -59,6 +59,8 @@ UAVOBJS = \
$${UAVOBJ_XML_DIR}/auxmagsettings.xml \
$${UAVOBJ_XML_DIR}/barosensor.xml \
$${UAVOBJ_XML_DIR}/callbackinfo.xml \
$${UAVOBJ_XML_DIR}/cameracontrolactivity.xml \
$${UAVOBJ_XML_DIR}/cameracontrolsettings.xml \
$${UAVOBJ_XML_DIR}/cameradesired.xml \
$${UAVOBJ_XML_DIR}/camerastabsettings.xml \
$${UAVOBJ_XML_DIR}/debuglogcontrol.xml \

View File

@ -0,0 +1,24 @@
<xml>
<object name="CameraControlActivity" singleinstance="true" settings="false" category="State">
<description>Contains position and timestamp of each camera operation</description>
<field name="Latitude" units="degrees x 10^-7" type="int32" elements="1"/>
<field name="Longitude" units="degrees x 10^-7" type="int32" elements="1"/>
<field name="Altitude" units="meters" type="float" elements="1"/>
<field name="Roll" units="degrees" type="float" elements="1"/>
<field name="Pitch" units="degrees" type="float" elements="1"/>
<field name="Yaw" units="degrees" type="float" elements="1"/>
<field name="TriggerMonth" units="" type="int8" elements="1"/>
<field name="TriggerDay" units="" type="int8" elements="1"/>
<field name="TriggerYear" units="" type="int16" elements="1"/>
<field name="TriggerHour" units="" type="int8" elements="1"/>
<field name="TriggerMinute" units="" type="int8" elements="1"/>
<field name="TriggerSecond" units="" type="int8" elements="1"/>
<field name="TriggerMilliSecond" units="" type="int16" elements="1"/>
<field name="Activity" units="" type="enum" elements="1" options="None,TriggerPicture,TriggerVideo" default="None"/>
<field name="Reason" units="" type="enum" elements="1" options="Manual,AutoDistance,AutoTime" default="Manual"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>

View File

@ -0,0 +1,19 @@
<xml>
<object name="CameraControlSettings" singleinstance="true" settings="true" category="Control">
<description>Settings for the @ref CameraControl module</description>
<field name="Input" units="channel" type="enum" elements="1" options="Accessory0,Accessory1,Accessory2,Accessory3,Accessory4,Accessory5,None" defaultvalue="None"/>
<field name="AutoTriggerMode" units="mode" type="enum" elements="1" options="Disabled,WhenArmed,Always,Input" defaultvalue="Armed"/>
<field name="OutputValues" units="%" type="float" elementnames="Standby,Shot,Video" defaultvalue="0.5,1.0,0" />
<field name="TriggerResponseTime" units="ms" type="uint8" elements="1" defaultvalue="0"/>
<field name="TimeInterval" units="s" type="float" elements="1" defaultvalue="0"/>
<field name="SpaceInterval" units="m" type="float" elements="1" defaultvalue="0"/>
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>
<logging updatemode="manual" period="0"/>
</object>
</xml>