Skip to content

Commit

Permalink
Mission Computer and payload computer support (#2053)
Browse files Browse the repository at this point in the history
* Copilot module
* Added mission computer status
* modules_parse_datalink() now accepts arguments
* Update pprzlink
* Update cartography module to comply with the extended CAMERA_SNAPSHOT message
  • Loading branch information
podhrmic authored and gautierhattenberger committed Apr 19, 2017
1 parent 8f1e082 commit ca68570
Show file tree
Hide file tree
Showing 13 changed files with 478 additions and 7 deletions.
21 changes: 20 additions & 1 deletion conf/airframes/AGGIEAIR/aggieair_control_panel.xml
Expand Up @@ -82,7 +82,9 @@
<arg flag="-s" constant="57600"/>
</program>
<program name="Server"/>
<program name="GCS"/>
<program name="GCS">
<arg flag="-layout" constant="AGGIEAIR/vertical.xml"/>
</program>
<program name="Messages"/>
<program name="Real-time Plotter"/>
</session>
Expand Down Expand Up @@ -135,6 +137,23 @@
</session>


<session name="NPS Flight Gear">
<program name="Data Link">
<arg flag="-udp"/>
<arg flag="-udp_broadcast"/>
</program>
<program name="Server">
<arg flag="-n"/>
</program>
<program name="GCS"/>
<program name="Simulator">
<arg flag="-a" constant="@AIRCRAFT"/>
<arg flag="-f" constant="127.0.0.1"/>
<arg flag="-b" constant="127.255.255.255"/>
<arg flag="--fg_fdm" constant=""/>
</program>
</session>

<session name="NPS Flight Gear">
<program name="Data Link">
<arg flag="-udp"/>
Expand Down
1 change: 1 addition & 0 deletions conf/airframes/AGGIEAIR/aggieair_rp3_lia.xml
Expand Up @@ -57,6 +57,7 @@ RP3 Lisa MX
<module name="nav" type="launcher"/>
<module name="nav" type="skid_landing"/>
<module name="sys_mon"/>
<module name="copilot"/>
<module name="extra_dl">
<!-- in order to use uart1 without chibios we need to remap the peripheral-->
<define name="REMAP_UART1" value="TRUE"/>
Expand Down
1 change: 1 addition & 0 deletions conf/flight_plans/AGGIEAIR/BasicTuning_Launcher.xml
Expand Up @@ -22,6 +22,7 @@
<waypoint alt="1347.0" name="TD" x="1155.4" y="-354.1"/>
<waypoint name="CLIMB" x="1142.0" y="-97.9"/>
<waypoint name="_BASELEG" x="168.8" y="-13.8"/>
<waypoint name="PAYLOAD" x="100" y="50"/>
</waypoints>
<sectors>
<sector name="Section1">
Expand Down
52 changes: 52 additions & 0 deletions conf/gcs/AGGIEAIR/vertical.xml
@@ -0,0 +1,52 @@
<layout width="1280" height="709">
<columns>
<rows SIZE="600">
<widget NAME="strips" SIZE="225"/>
<widget NAME="aircraft" SIZE="350"/>
<widget NAME="alarms"/>
</rows>
<rows>
<widget NAME="map2d">
<papget type="message_field" display="gauge" x="77" y="304">
<property name="field" value="CAMERA_PAYLOAD:used_memory"/>
<property name="scale" value="1.0"/>
<property name="min" value="0."/>
<property name="max" value="100."/>
<property name="size" value="50."/>
<property name="text" value="Used memory(%)"/>
</papget>
<papget type="message_field" display="gauge" x="74" y="198">
<property name="field" value="CAMERA_PAYLOAD:used_disk"/>
<property name="scale" value="1.0"/>
<property name="min" value="0."/>
<property name="max" value="100."/>
<property name="size" value="50."/>
<property name="text" value="Used disk(%)"/>
</papget>
<papget type="message_field" display="text" x="45" y="414">
<property name="field" value="CAMERA_PAYLOAD:error_code"/>
<property name="size" value="15."/>
<property name="format" value="Error code: %.0f"/>
<property name="color" value="green"/>
</papget>
<papget type="message_field" display="led" x="151" y="395">
<property name="scale" value="1"/>
<property name="field" value="CAMERA_PAYLOAD:error_code"/>
<property name="size" value="15."/>
<property name="text" value="Error:"/>
<property name="test_value" value="0"/> <!-- will be green only if value==0 -->
<property name="test_invert" value="true"/>
</papget>
<papget type="message_field" display="led" x="152" y="366">
<property name="scale" value="1"/>
<property name="field" value="CAMERA_PAYLOAD:door_status"/>
<property name="size" value="15."/>
<property name="text" value="Door status:"/>
<property name="test_value" value="2"/> <!-- will be green only if value==2 -->
<property name="test_invert" value="true"/>
</papget>

</widget>
</rows>
</columns>
</layout>
41 changes: 41 additions & 0 deletions conf/modules/copilot.xml
@@ -0,0 +1,41 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="copilot" dir="mission">
<doc>
<description>
Mission Computer module, interfacing the mission computer (also known as Copilot),
based losely on
ISaAC: The Intelligent Safety and Airworthiness Co-Pilot module
Based on paper "A Payload Verification and Management Framework
for Small UAV-based Personal Remote Sensing Systems" by Cal Coopmans
and Chris Coffin. Link: http://ieeexplore.ieee.org/abstract/document/6309316/

More info can be found on http://wiki.paparazziuav.org/wiki/Mission_computer

Copilot is intended mainly for mapping applications.

This module processes messages from Copilot, and either forwards them to the GCS
(such as CAMERA_SNAPSHOT or CAMERA_PAYLOAD messages), or responds to them as necessary
(such as MOVE_WP).

The module assumes the source of the messages is trusted (i.e. not authentication besides
AC_ID check is performed).
</description>
</doc>


<depends>extra_dl</depends>
<header>
<file name="copilot.h"/>
</header>
<init fun="copilot_init()"/>
<periodic fun="copilot_periodic()" freq="1." autorun="TRUE"/>
<datalink message="CAMERA_SNAPSHOT_DL" fun="copilot_parse_cam_snapshot_dl(buf)"/>
<datalink message="CAMERA_PAYLOAD_DL" fun="copilot_parse_cam_payload_dl(buf)"/>
<datalink message="COPILOT_STATUS_DL" fun="copilot_parse_copilot_status_dl(buf)"/>
<datalink message="MOVE_WP" fun="copilot_parse_move_wp_dl(buf)"/>
<makefile target="ap">
<file name="copilot.c"/>
</makefile>
</module>

8 changes: 6 additions & 2 deletions conf/telemetry/AGGIEAIR/aggieair_fixedwing.xml
Expand Up @@ -5,7 +5,7 @@
<mode name="default">
<message name="AUTOPILOT_VERSION" period="11.1"/>
<message name="ALIVE" period="5.1"/>
<message name="GPS" period="0.25"/>
<message name="GPS_LLA" period="0.25"/>
<message name="NAVIGATION" period="1."/>
<message name="ATTITUDE" period="0.1"/>
<message name="ESTIMATOR" period="0.5"/>
Expand All @@ -21,6 +21,7 @@
<message name="DL_VALUE" period="1.5"/>
<message name="IR_SENSORS" period="1.2"/>
<message name="SURVEY" period="2.1"/>
<message name="COMMANDS" period="1"/>
<message name="FBW_STATUS" period="2"/>
<message name="VECTORNAV_INFO" period="1.0"/>
</mode>
Expand Down Expand Up @@ -106,7 +107,10 @@
</process>
<process name="Extra">
<mode name="default">
<message name="COMMANDS" period="0.01"/>
<message name="COMMANDS" period="0.01"/>
<message name="GPS_LLA" period="1.25"/>
<message name="ATTITUDE" period="1.1"/>
<message name="VECTORNAV_INFO" period="1.0"/>
</mode>
</process>
</telemetry>
11 changes: 10 additions & 1 deletion sw/airborne/modules/cartography/cartography.c
Expand Up @@ -151,7 +151,16 @@ void init_carto(void)

void periodic_downlink_carto(void)
{
DOWNLINK_SEND_CAMERA_SNAPSHOT(DefaultChannel, DefaultDevice, &camera_snapshot_image_number);
static uint16_t dummy_id = 0;
static uint8_t dummy_state = 0;
static uint8_t snapshot_valid = 1;
static float dummy_temp = NAN;
DOWNLINK_SEND_CAMERA_SNAPSHOT(DefaultChannel, DefaultDevice,
&dummy_d,
&dummy_state,
&camera_snapshot_image_number,
&snapshot_valid,
&dummy_temp);
}

void start_carto(void)
Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/modules/datalink/extra_pprz_dl.h
Expand Up @@ -41,6 +41,8 @@
/* PPRZ transport structure */
extern struct pprz_transport extra_pprz_tp;

extern uint8_t extra_dl_buffer[MSG_SIZE] __attribute__((aligned));

/** Datalink Event */
void extra_pprz_dl_event(void);

Expand Down

0 comments on commit ca68570

Please sign in to comment.