Skip to content

Commit

Permalink
Quick and dirty ISaAC test version
Browse files Browse the repository at this point in the history
  • Loading branch information
podhrmic committed Apr 10, 2017
1 parent 036c619 commit ff32a30
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conf/airframes/AGGIEAIR/aggieair_conf.xml
Expand Up @@ -51,7 +51,7 @@
telemetry="telemetry/AGGIEAIR/aggieair_fixedwing.xml"
flight_plan="flight_plans/AGGIEAIR/BasicTuning_Launcher.xml"
settings="settings/fixedwing_basic.xml settings/nps.xml"
settings_modules="modules/battery_monitor.xml modules/lidar_sf11.xml modules/nav_skid_landing.xml modules/nav_survey_poly_osam.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
settings_modules="modules/battery_monitor.xml modules/lidar_sf11.xml modules/isaac.xml modules/nav_skid_landing.xml modules/nav_survey_poly_osam.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml"
gui_color="#00009e93ffff"
/>
</conf>
4 changes: 3 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
1 change: 1 addition & 0 deletions conf/airframes/AGGIEAIR/aggieair_rp3_lia.xml
Expand Up @@ -65,6 +65,7 @@ RP3 Lisa MX
<configure name="EXTRA_DL_BAUD" value="B921600"/>
</module>
<module name="lidar_sf11"/>
<module name="rssi"/>
<module name="battery_monitor.xml">
<define name="BATMON_REV4" value="1"/>
<define name="BATMON_CURRENT_OFFSET" value="-120"/>
Expand Down
15 changes: 15 additions & 0 deletions conf/modules/isaac.xml
Expand Up @@ -18,6 +18,21 @@
AC_ID check is performed).
</description>
</doc>

<settings>
<dl_settings NAME="ISaAC">
<dl_settings NAME="Isaac">
<dl_setting MAX="1" MIN="0" STEP="1" VAR="send_cam_snapshot" shortname="snapshot"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="send_cam_payload" shortname="payload"/>
<dl_setting MAX="1" MIN="0" STEP="1" VAR="send_copilot_status" shortname="copilot"/>
<dl_setting MAX="254" MIN="0" STEP="1" VAR="snapshot_cnt" shortname="snapshot_cnt"/>
<dl_setting MAX="254" MIN="0" STEP="1" VAR="status_cnt" shortname="status_cnt"/>
<dl_setting MAX="254" MIN="0" STEP="1" VAR="isaac_cnt" shortname="isaac_cnt"/>
<dl_setting MAX="254" MIN="0" STEP="1" VAR="move_wp_cnt" shortname="move_wp_cnt"/>
</dl_settings>
</dl_settings>
</settings>

<depends>extra_dl</depends>
<header>
<file name="isaac.h"/>
Expand Down
10 changes: 4 additions & 6 deletions conf/telemetry/AGGIEAIR/aggieair_fixedwing.xml
Expand Up @@ -6,7 +6,6 @@
<message name="AUTOPILOT_VERSION" period="11.1"/>
<message name="AIRSPEED" period="1"/>
<message name="ALIVE" period="5.1"/>
<message name="GPS_INT" period="0.25"/>
<message name="GPS_LLA" period="0.25"/>
<message name="NAVIGATION" period="1."/>
<message name="ATTITUDE" period="0.1"/>
Expand All @@ -26,10 +25,6 @@
<message name="DL_VALUE" period="1.5"/>
<message name="IR_SENSORS" period="1.2"/>
<message name="SURVEY" period="2.1"/>
<message name="GPS_SOL" period="2.0"/>
<message name="IMU_ACCEL" period=".8"/>
<message name="IMU_GYRO" period=".6"/>
<message name="IMU_MAG" period="1.3"/>
<message name="CAM" period="0.5"/>
<message name="CAM_POINT" period="1.0"/>
<message name="COMMANDS" period="1"/>
Expand Down Expand Up @@ -120,7 +115,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>
29 changes: 29 additions & 0 deletions sw/airborne/modules/cartography/isaac.c
Expand Up @@ -54,6 +54,10 @@ struct CameraPayload cam_payload;
struct CameraSnapshot cam_snapshot;
struct CopilotStatus copilot_status;

uint8_t snapshot_cnt;
uint8_t status_cnt;
uint8_t isaac_cnt;
uint8_t move_wp_cnt;

/** Init function */
void isaac_init(void)
Expand All @@ -62,8 +66,15 @@ void isaac_init(void)
send_cam_payload = false;
send_copilot_status = false;

snapshot_cnt = 0;
status_cnt = 0;
isaac_cnt = 0;
move_wp_cnt = 0;


memset(&cam_payload, 0, sizeof(cam_payload));
memset(&cam_snapshot, 0, sizeof(cam_snapshot));
memset(&send_copilot_status, 0, sizeof(send_copilot_status));
}

/** Periodic function */
Expand All @@ -83,6 +94,7 @@ void isaac_periodic(void)
send_cam_snapshot = false;
}


if (send_cam_payload)
{
// NOTE: this would send the message over the EXTRA_DL port
Expand All @@ -109,6 +121,7 @@ void isaac_periodic(void)

send_copilot_status = false;
}

}

/** Message processing functions
Expand All @@ -131,6 +144,10 @@ void isaac_parse_cam_snapshot_dl(uint8_t *buf)
cam_snapshot.snapshot_valid = DL_CAMERA_SHOT_snapshot_valid(buf);
cam_snapshot.lens_temp = DL_CAMERA_SHOT_lens_temp(buf);
cam_snapshot.array_temp = DL_CAMERA_SHOT_array_temp(buf);

send_cam_snapshot = true;

snapshot_cnt++;
}

void isaac_parse_cam_payload_dl(uint8_t *buf){
Expand All @@ -142,6 +159,8 @@ void isaac_parse_cam_payload_dl(uint8_t *buf){
cam_payload.error_code = DL_CAMERA_PAYL_error_code(buf);

send_cam_payload = true;

status_cnt++;
}

void isaac_parse_copilot_status_dl(uint8_t *buf)
Expand All @@ -151,7 +170,10 @@ void isaac_parse_copilot_status_dl(uint8_t *buf)
copilot_status.used_disk = DL_COPILOT_STAT_used_disk(buf);
copilot_status.status = DL_COPILOT_STAT_status(buf);
copilot_status.error_code = DL_COPILOT_STAT_error_code(buf);

send_copilot_status = true;

isaac_cnt++;
}

/**
Expand Down Expand Up @@ -199,6 +221,13 @@ void isaac_parse_move_wp_dl(uint8_t *buf)
DOWNLINK_SEND_WP_MOVED(extra_pprz_tp, EXTRA_DOWNLINK_DEVICE,
&wp_id, &utm.east, &utm.north, &utm.alt, &nav_utm_zone0);
}

// only increment wp_payload
if (wp_id == 18) {
move_wp_cnt++;
}
}



}
9 changes: 9 additions & 0 deletions sw/airborne/modules/cartography/isaac.h
Expand Up @@ -68,6 +68,15 @@ struct CopilotStatus {
uint8_t error_code;
};

extern bool send_cam_snapshot;
extern bool send_cam_payload;
extern bool send_copilot_status;

extern uint8_t snapshot_cnt;
extern uint8_t status_cnt;
extern uint8_t isaac_cnt;
extern uint8_t move_wp_cnt;

/** Init function */
void isaac_init(void);

Expand Down

0 comments on commit ff32a30

Please sign in to comment.