2011-03-19 07:20:11 -03:00
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
2011-03-08 08:20:48 -04:00
2011-03-02 22:32:50 -04:00
/********************************************************************************/
// Command Event Handlers
/********************************************************************************/
2012-12-09 02:50:50 -04:00
// process_nav_command - main switch statement to initiate the next nav command in the command_nav_queue
2011-11-16 04:16:24 -04:00
static void process_nav_command()
2011-02-24 01:56:59 -04:00
{
2012-08-21 23:19:50 -03:00
switch(command_nav_queue.id) {
2011-03-02 22:32:50 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_TAKEOFF: // 22
do_takeoff();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_WAYPOINT: // 16 Navigate to Waypoint
do_nav_wp();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LAND: // 21 LAND to Waypoint
2013-06-03 03:20:37 -03:00
do_land(&command_nav_queue);
2012-08-21 23:19:50 -03:00
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_UNLIM: // 17 Loiter indefinitely
do_loiter_unlimited();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_TURNS: //18 Loiter N Times
2013-02-25 04:50:56 -04:00
do_circle();
2012-08-21 23:19:50 -03:00
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_TIME: // 19
do_loiter_time();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_RETURN_TO_LAUNCH: //20
do_RTL();
break;
2011-04-02 21:47:20 -03:00
2012-08-21 23:19:50 -03:00
default:
break;
}
2011-05-31 02:29:06 -03:00
2011-02-24 01:56:59 -04:00
}
2013-05-10 00:06:29 -03:00
// process_cond_command - main switch statement to initiate the next conditional command in the command_cond_queue
2011-11-16 04:16:24 -04:00
static void process_cond_command()
2011-02-24 01:56:59 -04:00
{
2012-08-21 23:19:50 -03:00
switch(command_cond_queue.id) {
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_DELAY: // 112
do_wait_delay();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_DISTANCE: // 114
do_within_distance();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_CHANGE_ALT: // 113
do_change_alt();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_YAW: // 115
do_yaw();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
default:
break;
}
2011-03-02 22:32:50 -04:00
}
2011-02-24 01:56:59 -04:00
2013-05-10 00:06:29 -03:00
// process_now_command - main switch statement to initiate the next now command in the command_cond_queue
// now commands are conditional commands that are executed immediately so they do not require a corresponding verify to be run later
2011-11-16 04:16:24 -04:00
static void process_now_command()
2011-02-24 01:56:59 -04:00
{
2012-08-21 23:19:50 -03:00
switch(command_cond_queue.id) {
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_JUMP: // 177
do_jump();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_CHANGE_SPEED: // 178
do_change_speed();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_SET_HOME: // 179
do_set_home();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_SET_SERVO: // 183
do_set_servo();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_SET_RELAY: // 181
do_set_relay();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_REPEAT_SERVO: // 184
do_repeat_servo();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_REPEAT_RELAY: // 182
do_repeat_relay();
break;
2011-03-27 18:26:34 -03:00
2013-07-13 11:27:51 -03:00
case MAV_CMD_DO_SET_ROI: // 201
// point the copter and camera at a region of interest (ROI)
do_roi();
break;
2012-07-10 19:39:13 -03:00
#if CAMERA == ENABLED
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_CONTROL_VIDEO: // Control on-board camera capturing. |Camera ID (-1 for all)| Transmission: 0: disabled, 1: enabled compressed, 2: enabled raw| Transmission mode: 0: video stream, >0: single images every n seconds (decimal)| Recording: 0: disabled, 1: enabled compressed, 2: enabled raw| Empty| Empty| Empty|
break;
2012-07-10 19:39:13 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_DIGICAM_CONFIGURE: // Mission command to configure an on-board camera controller system. |Modes: P, TV, AV, M, Etc| Shutter speed: Divisor number for one second| Aperture: F stop number| ISO number e.g. 80, 100, 200, Etc| Exposure type enumerator| Command Identity| Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)|
break;
2012-07-10 19:39:13 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_DIGICAM_CONTROL: // Mission command to control an on-board camera controller system. |Session control e.g. show/hide lens| Zoom's absolute position| Zooming step value to offset zoom from the current position| Focus Locking, Unlocking or Re-locking| Shooting Command| Command Identity| Empty|
2012-12-06 10:48:30 -04:00
do_take_picture();
2012-08-21 23:19:50 -03:00
break;
2012-07-10 19:39:13 -03:00
#endif
#if MOUNT == ENABLED
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_MOUNT_CONFIGURE: // Mission command to configure a camera mount |Mount operation mode (see MAV_CONFIGURE_MOUNT_MODE enum)| stabilize roll? (1 = yes, 0 = no)| stabilize pitch? (1 = yes, 0 = no)| stabilize yaw? (1 = yes, 0 = no)| Empty| Empty| Empty|
camera_mount.configure_cmd();
break;
2012-07-10 19:39:13 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_DO_MOUNT_CONTROL: // Mission command to control a camera mount |pitch(deg*100) or lat, depending on mount mode.| roll(deg*100) or lon depending on mount mode| yaw(deg*100) or alt (in cm) depending on mount mode| Empty| Empty| Empty| Empty|
camera_mount.control_cmd();
break;
2012-07-10 19:39:13 -03:00
#endif
2012-07-24 23:02:54 -03:00
2012-08-21 23:19:50 -03:00
default:
// do nothing with unrecognized MAVLink messages
break;
}
2011-02-24 01:56:59 -04:00
}
2011-03-13 03:25:38 -03:00
/********************************************************************************/
// Verify command Handlers
/********************************************************************************/
2013-05-10 00:06:29 -03:00
// verify_nav_command - switch statement to ensure the active navigation command is progressing
2012-12-09 02:50:50 -04:00
// returns true once the active navigation command completes successfully
2013-05-10 00:06:29 -03:00
static bool verify_nav_command()
2011-03-02 22:32:50 -04:00
{
2012-08-21 23:19:50 -03:00
switch(command_nav_queue.id) {
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_TAKEOFF:
return verify_takeoff();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_WAYPOINT:
return verify_nav_wp();
break;
2012-07-24 23:02:54 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LAND:
2012-11-23 02:57:49 -04:00
return verify_land();
2012-08-21 23:19:50 -03:00
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_UNLIM:
return verify_loiter_unlimited();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_TURNS:
2013-02-25 04:50:56 -04:00
return verify_circle();
2012-08-21 23:19:50 -03:00
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_LOITER_TIME:
return verify_loiter_time();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_NAV_RETURN_TO_LAUNCH:
return verify_RTL();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
default:
//gcs_send_text_P(SEVERITY_HIGH,PSTR("<verify_must: default> No current Must commands"));
return false;
break;
}
2011-03-02 22:32:50 -04:00
}
2011-02-24 01:56:59 -04:00
2013-05-10 00:06:29 -03:00
// verify_cond_command - switch statement to ensure the active conditional command is progressing
2012-12-09 02:50:50 -04:00
// returns true once the active conditional command completes successfully
2013-05-10 00:06:29 -03:00
static bool verify_cond_command()
2011-03-02 22:32:50 -04:00
{
2012-08-21 23:19:50 -03:00
switch(command_cond_queue.id) {
2011-03-02 22:32:50 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_DELAY:
return verify_wait_delay();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_DISTANCE:
return verify_within_distance();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_CHANGE_ALT:
return verify_change_alt();
break;
2011-02-24 01:56:59 -04:00
2012-08-21 23:19:50 -03:00
case MAV_CMD_CONDITION_YAW:
return verify_yaw();
break;
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
default:
//gcs_send_text_P(SEVERITY_HIGH,PSTR("<verify_must: default> No current May commands"));
return false;
break;
}
2011-02-24 01:56:59 -04:00
}
2011-03-02 22:32:50 -04:00
/********************************************************************************/
2011-04-26 02:15:25 -03:00
//
2011-03-02 22:32:50 -04:00
/********************************************************************************/
2012-11-29 08:08:19 -04:00
// do_RTL - start Return-to-Launch
2011-07-17 07:32:00 -03:00
static void do_RTL(void)
2011-03-13 03:25:38 -03:00
{
2012-11-29 08:08:19 -04:00
// set rtl state
2013-04-08 23:58:01 -03:00
rtl_state = RTL_STATE_START;
2011-03-13 03:25:38 -03:00
2013-04-08 23:58:01 -03:00
// verify_RTL will do the initialisation for us
verify_RTL();
2011-03-13 03:25:38 -03:00
}
2011-04-26 02:15:25 -03:00
/********************************************************************************/
// Nav (Must) commands
/********************************************************************************/
2012-12-09 02:50:50 -04:00
// do_takeoff - initiate takeoff navigation command
2011-07-17 07:32:00 -03:00
static void do_takeoff()
2011-02-24 01:56:59 -04:00
{
2013-02-18 01:58:24 -04:00
// set roll-pitch mode
set_roll_pitch_mode(AUTO_RP);
2011-04-25 02:12:59 -03:00
2013-02-18 01:58:24 -04:00
// set yaw mode
set_yaw_mode(YAW_HOLD);
2011-04-21 02:15:45 -03:00
2013-02-04 10:54:06 -04:00
// set throttle mode to AUTO although we should already be in this mode
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-01-14 23:13:04 -04:00
2013-02-18 01:58:24 -04:00
// set our nav mode to loiter
2013-04-08 23:58:01 -03:00
set_nav_mode(NAV_WP);
// Set wp navigation target to safe altitude above current position
Vector3f pos = inertial_nav.get_position();
2013-04-18 10:30:24 -03:00
pos.z = max(pos.z, command_nav_queue.alt);
2013-07-16 03:51:18 -03:00
pos.z = max(pos.z, 100.0f);
2013-04-08 23:58:01 -03:00
wp_nav.set_destination(pos);
2013-02-18 01:58:24 -04:00
2013-01-14 23:13:04 -04:00
// prevent flips
2013-02-04 10:54:06 -04:00
// To-Do: check if this is still necessary
2013-01-14 23:13:04 -04:00
reset_I_all();
2011-03-02 22:32:50 -04:00
}
2011-02-24 01:56:59 -04:00
2012-12-09 02:50:50 -04:00
// do_nav_wp - initiate move to next waypoint
2011-07-17 07:32:00 -03:00
static void do_nav_wp()
2011-03-13 03:25:38 -03:00
{
2013-02-18 01:58:24 -04:00
// set roll-pitch mode
set_roll_pitch_mode(AUTO_RP);
// set throttle mode
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-02-18 01:58:24 -04:00
2013-02-04 11:45:31 -04:00
// set nav mode
2013-02-18 01:58:24 -04:00
set_nav_mode(NAV_WP);
2011-04-26 02:15:25 -03:00
2013-03-20 10:29:08 -03:00
// Set wp navigation target
wp_nav.set_destination(pv_location_to_vector(command_nav_queue));
2011-04-25 02:12:59 -03:00
2013-03-21 06:29:38 -03:00
// initialise original_wp_bearing which is used to check if we have missed the waypoint
wp_bearing = wp_nav.get_bearing_to_destination();
original_wp_bearing = wp_bearing;
2013-04-08 23:58:01 -03:00
// this will be used to remember the time in millis after we reach or pass the WP.
loiter_time = 0;
// this is the delay, stored in seconds and expanded to millis
loiter_time_max = command_nav_queue.p1;
2013-05-08 12:18:36 -03:00
// if no delay set the waypoint as "fast"
if (loiter_time_max == 0 ) {
wp_nav.set_fast_waypoint(true);
}
2011-04-25 02:12:59 -03:00
2013-04-20 03:36:24 -03:00
// set yaw_mode depending upon contents of WP_YAW_BEHAVIOR parameter
set_yaw_mode(get_wp_yaw_mode(false));
2011-03-13 03:25:38 -03:00
}
2012-12-09 02:50:50 -04:00
// do_land - initiate landing procedure
2013-02-18 01:58:24 -04:00
// caller should set roll_pitch_mode to ROLL_PITCH_AUTO (for no pilot input) or ROLL_PITCH_LOITER (for pilot input)
2013-06-03 03:20:37 -03:00
static void do_land(const struct Location *cmd)
2011-03-13 03:25:38 -03:00
{
2013-05-10 10:37:15 -03:00
// To-Do: check if we have already landed
// if location provided we fly to that location at current altitude
2013-06-03 03:20:37 -03:00
if (cmd != NULL && (cmd->lat != 0 || cmd->lng != 0)) {
2013-05-10 10:37:15 -03:00
// set state to fly to location
land_state = LAND_STATE_FLY_TO_LOCATION;
// set roll-pitch mode
set_roll_pitch_mode(AUTO_RP);
// set yaw_mode depending upon contents of WP_YAW_BEHAVIOR parameter
set_yaw_mode(get_wp_yaw_mode(false));
// set throttle mode
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-05-10 10:37:15 -03:00
// set nav mode
set_nav_mode(NAV_WP);
// calculate and set desired location above landing target
2013-06-03 03:20:37 -03:00
Vector3f pos = pv_location_to_vector(*cmd);
2013-05-10 10:37:15 -03:00
pos.z = min(current_loc.alt, RTL_ALT_MAX);
wp_nav.set_destination(pos);
2013-06-03 03:20:37 -03:00
// initialise original_wp_bearing which is used to check if we have missed the waypoint
wp_bearing = wp_nav.get_bearing_to_destination();
original_wp_bearing = wp_bearing;
2013-02-18 01:58:24 -04:00
}else{
2013-05-10 10:37:15 -03:00
// set landing state
land_state = LAND_STATE_DESCENDING;
2012-12-10 10:38:43 -04:00
2013-06-25 10:33:47 -03:00
// if we have gps lock, attempt to hold horizontal position
2013-07-19 23:01:10 -03:00
if (GPS_ok()) {
2013-06-25 10:33:47 -03:00
// switch to loiter which restores horizontal control to pilot
// To-Do: check that we are not in failsafe to ensure we don't process bad roll-pitch commands
set_roll_pitch_mode(ROLL_PITCH_LOITER);
// switch into loiter nav mode
set_nav_mode(NAV_LOITER);
}else{
// no gps lock so give horizontal control to pilot
// To-Do: check that we are not in failsafe to ensure we don't process bad roll-pitch commands
set_roll_pitch_mode(ROLL_PITCH_STABLE);
// switch into loiter nav mode
set_nav_mode(NAV_NONE);
}
2013-01-12 01:49:26 -04:00
2013-05-10 10:37:15 -03:00
// hold yaw while landing
set_yaw_mode(YAW_HOLD);
2013-02-18 01:58:24 -04:00
2013-05-10 10:37:15 -03:00
// set throttle mode to land
set_throttle_mode(THROTTLE_LAND);
}
2011-03-13 03:25:38 -03:00
}
2013-02-04 11:45:31 -04:00
// do_loiter_unlimited - start loitering with no end conditions
2013-02-18 01:58:24 -04:00
// note: caller should set yaw_mode
2011-07-17 07:32:00 -03:00
static void do_loiter_unlimited()
2011-03-13 03:25:38 -03:00
{
2013-07-10 23:35:54 -03:00
Vector3f target_pos;
2013-02-18 01:58:24 -04:00
// set roll-pitch mode (no pilot input)
set_roll_pitch_mode(AUTO_RP);
// set throttle mode to AUTO which, if not already active, will default to hold at our current altitude
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-02-18 01:58:24 -04:00
2013-05-09 22:51:46 -03:00
// hold yaw
set_yaw_mode(YAW_HOLD);
2013-04-08 23:58:01 -03:00
// get current position
2013-07-10 23:35:54 -03:00
Vector3f curr_pos = inertial_nav.get_position();
2013-04-08 23:58:01 -03:00
2013-07-10 23:35:54 -03:00
// use current location if not provided
if(command_nav_queue.lat == 0 && command_nav_queue.lng == 0) {
wp_nav.get_stopping_point(curr_pos,inertial_nav.get_velocity(),target_pos);
}else{
// default to use position provided
target_pos = pv_location_to_vector(command_nav_queue);
}
2013-04-08 23:58:01 -03:00
// use current altitude if not provided
if( command_nav_queue.alt == 0 ) {
2013-07-10 23:35:54 -03:00
target_pos.z = curr_pos.z;
2013-02-04 11:45:31 -04:00
}
2013-04-08 23:58:01 -03:00
// start way point navigator and provide it the desired location
set_nav_mode(NAV_WP);
2013-07-10 23:35:54 -03:00
wp_nav.set_destination(target_pos);
2013-02-18 01:58:24 -04:00
}
2013-02-25 04:50:56 -04:00
// do_circle - initiate moving in a circle
static void do_circle()
2013-02-18 01:58:24 -04:00
{
// set roll-pitch mode (no pilot input)
set_roll_pitch_mode(AUTO_RP);
2013-02-04 11:45:31 -04:00
// set throttle mode to AUTO which, if not already active, will default to hold at our current altitude
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-02-04 11:45:31 -04:00
2013-04-08 23:58:01 -03:00
// set nav mode to CIRCLE
set_nav_mode(NAV_CIRCLE);
2013-02-04 11:45:31 -04:00
// set target altitude if provided
if( command_nav_queue.alt != 0 ) {
2013-04-08 23:58:01 -03:00
wp_nav.set_desired_alt(command_nav_queue.alt);
2012-08-21 23:19:50 -03:00
}
2011-03-13 03:25:38 -03:00
2013-02-25 04:50:56 -04:00
// override default horizontal location target
2013-02-04 11:45:31 -04:00
if( command_nav_queue.lat != 0 || command_nav_queue.lng != 0) {
2013-03-20 10:29:08 -03:00
circle_set_center(pv_location_to_vector(command_nav_queue), ahrs.yaw);
2012-08-21 23:19:50 -03:00
}
2013-02-25 04:50:56 -04:00
// set yaw to point to center of circle
2013-02-18 01:58:24 -04:00
set_yaw_mode(CIRCLE_YAW);
2012-07-12 13:22:20 -03:00
2013-02-25 04:50:56 -04:00
// set angle travelled so far to zero
circle_angle_total = 0;
// record number of desired rotations from mission command
circle_desired_rotations = command_nav_queue.p1;
2011-03-13 03:25:38 -03:00
}
2012-12-09 02:50:50 -04:00
// do_loiter_time - initiate loitering at a point for a given time period
2013-02-18 01:58:24 -04:00
// note: caller should set yaw_mode
2011-07-17 07:32:00 -03:00
static void do_loiter_time()
2011-03-13 03:25:38 -03:00
{
2013-07-10 23:35:54 -03:00
Vector3f target_pos;
2013-02-18 01:58:24 -04:00
// set roll-pitch mode (no pilot input)
set_roll_pitch_mode(AUTO_RP);
// set throttle mode to AUTO which, if not already active, will default to hold at our current altitude
2013-08-27 23:45:07 -03:00
set_throttle_mode(AUTO_THR);
2013-04-08 23:58:01 -03:00
2013-05-09 22:51:46 -03:00
// hold yaw
set_yaw_mode(YAW_HOLD);
2013-04-08 23:58:01 -03:00
// get current position
2013-07-10 23:35:54 -03:00
Vector3f curr_pos = inertial_nav.get_position();
2013-04-08 23:58:01 -03:00
2013-07-10 23:35:54 -03:00
// use current location if not provided
if(command_nav_queue.lat == 0 && command_nav_queue.lng == 0) {
wp_nav.get_stopping_point(curr_pos,inertial_nav.get_velocity(),target_pos);
}else{
// default to use position provided
target_pos = pv_location_to_vector(command_nav_queue);
}
2013-04-08 23:58:01 -03:00
// use current altitude if not provided
if( command_nav_queue.alt == 0 ) {
2013-07-10 23:35:54 -03:00
target_pos.z = curr_pos.z;
2012-08-21 23:19:50 -03:00
}
2011-09-24 21:40:29 -03:00
2013-04-08 23:58:01 -03:00
// start way point navigator and provide it the desired location
set_nav_mode(NAV_WP);
2013-07-10 23:35:54 -03:00
wp_nav.set_destination(target_pos);
2013-04-08 23:58:01 -03:00
// setup loiter timer
loiter_time = 0;
2013-03-27 09:54:12 -03:00
loiter_time_max = command_nav_queue.p1; // units are (seconds)
2011-03-13 03:25:38 -03:00
}
/********************************************************************************/
2011-04-03 18:11:14 -03:00
// Verify Nav (Must) commands
2011-03-13 03:25:38 -03:00
/********************************************************************************/
2012-12-09 02:50:50 -04:00
// verify_takeoff - check if we have completed the takeoff
2011-07-17 07:32:00 -03:00
static bool verify_takeoff()
2011-03-02 22:32:50 -04:00
{
2013-04-08 23:58:01 -03:00
// have we reached our target altitude?
return wp_nav.reached_destination();
2011-03-02 22:32:50 -04:00
}
2012-11-23 02:57:49 -04:00
// verify_land - returns true if landing has been completed
static bool verify_land()
2012-01-29 02:00:05 -04:00
{
2013-05-10 10:37:15 -03:00
bool retval = false;
switch( land_state ) {
case LAND_STATE_FLY_TO_LOCATION:
// check if we've reached the location
if (wp_nav.reached_destination()) {
// get destination so we can use it for loiter target
Vector3f dest = wp_nav.get_destination();
// switch into loiter nav mode
set_nav_mode(NAV_LOITER);
// override loiter target
wp_nav.set_loiter_target(dest);
// switch to loiter which restores horizontal control to pilot
// To-Do: check that we are not in failsafe to ensure we don't process bad roll-pitch commands
set_roll_pitch_mode(ROLL_PITCH_LOITER);
// give pilot control of yaw
set_yaw_mode(YAW_HOLD);
// set throttle mode to land
set_throttle_mode(THROTTLE_LAND);
// advance to next state
land_state = LAND_STATE_DESCENDING;
}
break;
case LAND_STATE_DESCENDING:
// rely on THROTTLE_LAND mode to correctly update landing status
retval = ap.land_complete;
break;
default:
// this should never happen
// TO-DO: log an error
retval = true;
break;
}
// true is returned if we've successfully landed
return retval;
2011-03-02 22:32:50 -04:00
}
2012-12-09 02:50:50 -04:00
// verify_nav_wp - check if we have reached the next way point
2011-07-17 07:32:00 -03:00
static bool verify_nav_wp()
2011-03-02 22:32:50 -04:00
{
2013-04-08 23:58:01 -03:00
// check if we have reached the waypoint
if( !wp_nav.reached_destination() ) {
return false;
2012-08-21 23:19:50 -03:00
}
2013-04-08 23:58:01 -03:00
// start timer if necessary
if(loiter_time == 0) {
loiter_time = millis();
2012-08-21 23:19:50 -03:00
}
2013-04-08 23:58:01 -03:00
// check if timer has run out
if (((millis() - loiter_time) / 1000) >= loiter_time_max) {
2012-10-22 04:59:51 -03:00
gcs_send_text_fmt(PSTR("Reached Command #%i"),command_nav_index);
2012-08-21 23:19:50 -03:00
copter_leds_nav_blink = 15; // Cause the CopterLEDs to blink three times to indicate waypoint reached
return true;
}else{
return false;
}
2011-03-02 22:32:50 -04:00
}
2012-07-12 12:52:36 -03:00
static bool verify_loiter_unlimited()
{
2012-08-21 23:19:50 -03:00
return false;
2012-07-12 12:52:36 -03:00
}
2011-03-02 22:32:50 -04:00
2012-12-09 02:50:50 -04:00
// verify_loiter_time - check if we have loitered long enough
2011-07-17 07:32:00 -03:00
static bool verify_loiter_time()
2011-03-02 22:32:50 -04:00
{
2013-04-08 23:58:01 -03:00
// return immediately if we haven't reached our destination
if (!wp_nav.reached_destination()) {
return false;
2012-08-21 23:19:50 -03:00
}
2013-04-08 23:58:01 -03:00
// start our loiter timer
if( loiter_time == 0 ) {
2012-08-21 23:19:50 -03:00
loiter_time = millis();
}
2013-04-08 23:58:01 -03:00
// check if loiter timer has run out
2013-04-15 11:57:22 -03:00
return (((millis() - loiter_time) / 1000) >= loiter_time_max);
2011-03-02 22:32:50 -04:00
}
2013-02-25 04:50:56 -04:00
// verify_circle - check if we have circled the point enough
static bool verify_circle()
2011-09-21 17:19:36 -03:00
{
2012-08-21 23:19:50 -03:00
// have we rotated around the center enough times?
2013-04-20 00:03:55 -03:00
return fabsf(circle_angle_total/(2*M_PI)) >= circle_desired_rotations;
2011-09-21 17:19:36 -03:00
}
2012-11-29 08:08:19 -04:00
// verify_RTL - handles any state changes required to implement RTL
// do_RTL should have been called once first to initialise all variables
// returns true with RTL has completed successfully
2011-07-17 07:32:00 -03:00
static bool verify_RTL()
2011-03-02 22:32:50 -04:00
{
2012-11-29 08:08:19 -04:00
bool retval = false;
2011-11-08 01:09:29 -04:00
2012-11-29 08:08:19 -04:00
switch( rtl_state ) {
2013-04-08 23:58:01 -03:00
case RTL_STATE_START:
// set roll, pitch and yaw modes
set_roll_pitch_mode(RTL_RP);
set_throttle_mode(RTL_THR);
2011-11-08 01:09:29 -04:00
2013-04-08 23:58:01 -03:00
// set navigation mode
set_nav_mode(NAV_WP);
2012-12-17 03:17:49 -04:00
2013-04-08 23:58:01 -03:00
// if we are below rtl alt do initial climb
if( current_loc.alt < get_RTL_alt() ) {
// first stage of RTL is the initial climb so just hold current yaw
set_yaw_mode(YAW_HOLD);
2013-05-11 04:21:25 -03:00
// use projection of safe stopping point based on current location and velocity
Vector3f origin, dest;
wp_nav.get_stopping_point(inertial_nav.get_position(),inertial_nav.get_velocity(),origin);
dest.x = origin.x;
dest.y = origin.y;
dest.z = get_RTL_alt();
wp_nav.set_origin_and_destination(origin,dest);
2013-04-08 23:58:01 -03:00
// advance to next rtl state
rtl_state = RTL_STATE_INITIAL_CLIMB;
}else{
2013-04-20 03:36:24 -03:00
// point nose towards home (maybe)
set_yaw_mode(get_wp_yaw_mode(true));
2013-04-08 23:58:01 -03:00
// Set wp navigation target to above home
wp_nav.set_destination(Vector3f(0,0,get_RTL_alt()));
2013-05-11 04:21:25 -03:00
// initialise original_wp_bearing which is used to point the nose home
wp_bearing = wp_nav.get_bearing_to_destination();
original_wp_bearing = wp_bearing;
2013-04-08 23:58:01 -03:00
// advance to next rtl state
rtl_state = RTL_STATE_RETURNING_HOME;
}
break;
case RTL_STATE_INITIAL_CLIMB:
// check if we've reached the safe altitude
if (wp_nav.reached_destination()) {
// set nav mode
2013-02-18 01:58:24 -04:00
set_nav_mode(NAV_WP);
2013-04-08 23:58:01 -03:00
2013-03-20 10:29:08 -03:00
// Set wp navigation target to above home
wp_nav.set_destination(Vector3f(0,0,get_RTL_alt()));
2013-01-28 11:01:40 -04:00
2013-05-11 04:21:25 -03:00
// initialise original_wp_bearing which is used to point the nose home
wp_bearing = wp_nav.get_bearing_to_destination();
original_wp_bearing = wp_bearing;
2013-05-09 09:44:46 -03:00
// point nose towards home (maybe)
set_yaw_mode(get_wp_yaw_mode(true));
2012-12-17 03:17:49 -04:00
// advance to next rtl state
rtl_state = RTL_STATE_RETURNING_HOME;
}
break;
2012-11-29 08:08:19 -04:00
case RTL_STATE_RETURNING_HOME:
2013-04-08 23:58:01 -03:00
// check if we've reached home
if (wp_nav.reached_destination()) {
// Note: we remain in NAV_WP nav mode which should hold us above home
2012-11-29 08:08:19 -04:00
2013-04-08 23:58:01 -03:00
// start timer
2012-11-29 08:08:19 -04:00
rtl_loiter_start_time = millis();
// give pilot back control of yaw
2013-05-29 17:22:46 -03:00
if(get_wp_yaw_mode(true) != YAW_HOLD) {
set_yaw_mode(YAW_RESETTOARMEDYAW); // yaw back to initial yaw on take off
} else {
set_yaw_mode(YAW_HOLD);
}
2013-04-08 23:58:01 -03:00
// advance to next rtl state
rtl_state = RTL_STATE_LOITERING_AT_HOME;
2012-11-29 08:08:19 -04:00
}
break;
case RTL_STATE_LOITERING_AT_HOME:
// check if we've loitered long enough
if( millis() - rtl_loiter_start_time > (uint32_t)g.rtl_loiter_time.get() ) {
// initiate landing or descent
2013-09-26 05:54:33 -03:00
if(g.rtl_alt_final == 0 || failsafe.radio) {
2013-05-10 10:37:15 -03:00
// switch to loiter which restores horizontal control to pilot
// To-Do: check that we are not in failsafe to ensure we don't process bad roll-pitch commands
set_roll_pitch_mode(ROLL_PITCH_LOITER);
// switch into loiter nav mode
set_nav_mode(NAV_LOITER);
// override landing location (loiter defaults to a projection from current location)
2013-03-21 06:29:38 -03:00
wp_nav.set_loiter_target(Vector3f(0,0,0));
2013-05-10 10:37:15 -03:00
// hold yaw while landing
set_yaw_mode(YAW_HOLD);
// set throttle mode to land
set_throttle_mode(THROTTLE_LAND);
2012-11-29 08:08:19 -04:00
// update RTL state
rtl_state = RTL_STATE_LAND;
}else{
2013-04-08 23:58:01 -03:00
// descend using waypoint controller
2012-11-29 08:08:19 -04:00
if(current_loc.alt > g.rtl_alt_final) {
2013-04-08 23:58:01 -03:00
// set navigation mode
set_nav_mode(NAV_WP);
// Set wp navigation alt target to rtl_alt_final
wp_nav.set_destination(Vector3f(0,0,g.rtl_alt_final));
2012-11-29 08:08:19 -04:00
}
// update RTL state
rtl_state = RTL_STATE_FINAL_DESCENT;
}
}
break;
case RTL_STATE_FINAL_DESCENT:
2013-04-08 23:58:01 -03:00
// check we have reached final altitude
if(current_loc.alt <= g.rtl_alt_final || wp_nav.reached_destination()) {
// indicate that we've completed RTL
2012-11-29 08:08:19 -04:00
retval = true;
}
break;
case RTL_STATE_LAND:
2013-05-10 10:37:15 -03:00
// rely on land_complete flag to indicate if we have landed
retval = ap.land_complete;
2012-11-29 08:08:19 -04:00
break;
default:
// this should never happen
// TO-DO: log an error
retval = true;
break;
2012-08-21 23:19:50 -03:00
}
2012-11-29 08:08:19 -04:00
// true is returned if we've successfully completed RTL
return retval;
2011-03-02 22:32:50 -04:00
}
/********************************************************************************/
2011-04-03 18:11:14 -03:00
// Condition (May) commands
2011-03-02 22:32:50 -04:00
/********************************************************************************/
2011-07-17 07:32:00 -03:00
static void do_wait_delay()
2011-03-13 03:25:38 -03:00
{
2012-11-21 02:08:03 -04:00
//cliSerial->print("dwd ");
2012-08-21 23:19:50 -03:00
condition_start = millis();
condition_value = command_cond_queue.lat * 1000; // convert to milliseconds
2012-11-21 02:08:03 -04:00
//cliSerial->println(condition_value,DEC);
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_change_alt()
2011-03-13 03:25:38 -03:00
{
2013-04-08 23:58:01 -03:00
// adjust target appropriately for each nav mode
switch (nav_mode) {
case NAV_CIRCLE:
case NAV_LOITER:
// update loiter target altitude
wp_nav.set_desired_alt(command_cond_queue.alt);
break;
case NAV_WP:
// To-Do: update waypoint nav's destination altitude
break;
}
2013-02-04 11:45:31 -04:00
2013-04-08 23:58:01 -03:00
// To-Do: store desired altitude in a variable so that it can be verified later
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_within_distance()
2011-03-13 03:25:38 -03:00
{
2012-08-21 23:19:50 -03:00
condition_value = command_cond_queue.lat * 100;
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_yaw()
2011-03-02 22:32:50 -04:00
{
2012-12-08 01:23:32 -04:00
// get final angle, 1 = Relative, 0 = Absolute
if( command_cond_queue.lng == 0 ) {
// absolute angle
2013-03-28 23:14:31 -03:00
yaw_look_at_heading = wrap_360_cd(command_cond_queue.alt * 100);
2012-12-08 01:23:32 -04:00
}else{
// relative angle
2013-03-28 23:14:31 -03:00
yaw_look_at_heading = wrap_360_cd(nav_yaw + command_cond_queue.alt * 100);
2012-12-08 01:23:32 -04:00
}
2012-08-21 23:19:50 -03:00
2012-12-08 01:23:32 -04:00
// get turn speed
if( command_cond_queue.lat == 0 ) {
// default to regular auto slew rate
yaw_look_at_heading_slew = AUTO_YAW_SLEW_RATE;
2012-08-21 23:19:50 -03:00
}else{
2013-03-28 23:14:31 -03:00
int32_t turn_rate = (wrap_180_cd(yaw_look_at_heading - nav_yaw) / 100) / command_cond_queue.lat;
2013-05-01 21:29:57 -03:00
yaw_look_at_heading_slew = constrain_int32(turn_rate, 1, 360); // deg / sec
2012-08-21 23:19:50 -03:00
}
2012-12-08 01:23:32 -04:00
// set yaw mode
set_yaw_mode(YAW_LOOK_AT_HEADING);
// TO-DO: restore support for clockwise / counter clockwise rotation held in command_cond_queue.p1
// command_cond_queue.p1; // 0 = undefined, 1 = clockwise, -1 = counterclockwise
2011-03-02 22:32:50 -04:00
}
2011-03-26 03:35:52 -03:00
2011-03-13 03:25:38 -03:00
/********************************************************************************/
// Verify Condition (May) commands
/********************************************************************************/
2011-07-17 07:32:00 -03:00
static bool verify_wait_delay()
2011-03-02 22:32:50 -04:00
{
2012-11-21 02:08:03 -04:00
//cliSerial->print("vwd");
2013-01-26 22:27:43 -04:00
if (millis() - condition_start > (uint32_t)max(condition_value,0)) {
2012-11-21 02:08:03 -04:00
//cliSerial->println("y");
2012-08-21 23:19:50 -03:00
condition_value = 0;
return true;
}
2012-11-21 02:08:03 -04:00
//cliSerial->println("n");
2012-08-21 23:19:50 -03:00
return false;
2011-03-02 22:32:50 -04:00
}
2011-02-24 01:56:59 -04:00
2011-07-17 07:32:00 -03:00
static bool verify_change_alt()
2011-03-02 22:32:50 -04:00
{
2013-04-08 23:58:01 -03:00
// To-Do: use recorded target altitude to verify we have reached the target
return true;
2011-02-24 01:56:59 -04:00
}
2011-07-17 07:32:00 -03:00
static bool verify_within_distance()
2011-03-02 22:32:50 -04:00
{
2013-01-26 04:04:12 -04:00
if (wp_distance < max(condition_value,0)) {
2012-08-21 23:19:50 -03:00
condition_value = 0;
return true;
}
return false;
2011-03-02 22:32:50 -04:00
}
2012-12-08 01:23:32 -04:00
// verify_yaw - return true if we have reached the desired heading
2011-07-17 07:32:00 -03:00
static bool verify_yaw()
2011-03-02 22:32:50 -04:00
{
2013-03-28 23:14:31 -03:00
if( labs(wrap_180_cd(ahrs.yaw_sensor-yaw_look_at_heading)) <= 200 ) {
2012-08-21 23:19:50 -03:00
return true;
}else{
return false;
}
2011-03-02 22:32:50 -04:00
}
/********************************************************************************/
2011-04-03 18:11:14 -03:00
// Do (Now) commands
2011-03-02 22:32:50 -04:00
/********************************************************************************/
2013-06-01 23:25:35 -03:00
// do_guided - start guided mode
// this is not actually a mission command but rather a
static void do_guided(const struct Location *cmd)
{
bool first_time = false;
// switch to guided mode if we're not already in guided mode
if (control_mode != GUIDED) {
2013-07-19 23:01:10 -03:00
if (set_mode(GUIDED)) {
first_time = true;
}else{
// if we failed to enter guided mode return immediately
return;
}
2013-06-01 23:25:35 -03:00
}
// set wp_nav's destination
Vector3f pos = pv_location_to_vector(*cmd);
wp_nav.set_destination(pos);
// initialise wp_bearing for reporting purposes
wp_bearing = wp_nav.get_bearing_to_destination();
// point nose at next waypoint if it is more than 10m away
if (yaw_mode == YAW_LOOK_AT_NEXT_WP) {
// get distance to new location
wp_distance = wp_nav.get_distance_to_destination();
// set original_wp_bearing to point at next waypoint
if (wp_distance >= 1000 || first_time) {
original_wp_bearing = wp_bearing;
}
}
}
2011-09-24 13:49:11 -03:00
static void do_change_speed()
{
2013-04-14 01:27:37 -03:00
wp_nav.set_horizontal_velocity(command_cond_queue.p1 * 100);
2011-09-24 13:49:11 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_jump()
2011-03-13 03:25:38 -03:00
{
2012-08-21 23:19:50 -03:00
// Used to track the state of the jump command in Mission scripting
// -10 is a value that means the register is unused
// when in use, it contains the current remaining jumps
static int8_t jump = -10; // used to track loops in jump command
2012-01-03 14:21:52 -04:00
2012-08-21 23:19:50 -03:00
if(jump == -10) {
// we use a locally stored index for jump
jump = command_cond_queue.lat;
}
2011-03-13 03:25:38 -03:00
2012-08-21 23:19:50 -03:00
if(jump > 0) {
jump--;
change_command(command_cond_queue.p1);
2011-09-24 21:40:29 -03:00
2012-08-21 23:19:50 -03:00
} else if (jump == 0) {
// we're done, move along
jump = -11;
2011-09-24 21:40:29 -03:00
2012-08-21 23:19:50 -03:00
} else if (jump == -1) {
// repeat forever
change_command(command_cond_queue.p1);
}
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_set_home()
2011-03-02 22:32:50 -04:00
{
2012-08-21 23:19:50 -03:00
if(command_cond_queue.p1 == 1) {
init_home();
} else {
home.id = MAV_CMD_NAV_WAYPOINT;
home.lng = command_cond_queue.lng; // Lon * 10**7
home.lat = command_cond_queue.lat; // Lat * 10**7
home.alt = 0;
2012-11-10 01:55:51 -04:00
//home_is_set = true;
set_home_is_set(true);
2012-08-21 23:19:50 -03:00
}
2011-03-02 22:32:50 -04:00
}
2011-07-17 07:32:00 -03:00
static void do_set_servo()
2011-03-02 22:32:50 -04:00
{
2012-12-06 23:58:44 -04:00
uint8_t channel_num = 0xff;
2012-12-06 07:18:33 -04:00
switch( command_cond_queue.p1 ) {
case 1:
channel_num = CH_1;
break;
case 2:
channel_num = CH_2;
break;
case 3:
channel_num = CH_3;
break;
case 4:
channel_num = CH_4;
break;
case 5:
channel_num = CH_5;
break;
case 6:
channel_num = CH_6;
break;
case 7:
channel_num = CH_7;
break;
case 8:
channel_num = CH_8;
break;
case 9:
// not used
break;
case 10:
channel_num = CH_10;
break;
case 11:
channel_num = CH_11;
break;
}
// send output to channel
2012-12-06 23:58:44 -04:00
if (channel_num != 0xff) {
2012-12-12 21:25:09 -04:00
hal.rcout->enable_ch(channel_num);
hal.rcout->write(channel_num, command_cond_queue.alt);
2012-12-06 07:18:33 -04:00
}
2011-03-02 22:32:50 -04:00
}
2011-07-17 07:32:00 -03:00
static void do_set_relay()
2011-03-02 22:32:50 -04:00
{
2012-08-21 23:19:50 -03:00
if (command_cond_queue.p1 == 1) {
relay.on();
} else if (command_cond_queue.p1 == 0) {
relay.off();
}else{
relay.toggle();
}
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_repeat_servo()
2011-03-13 03:25:38 -03:00
{
2012-08-21 23:19:50 -03:00
event_id = command_cond_queue.p1 - 1;
if(command_cond_queue.p1 >= CH_5 + 1 && command_cond_queue.p1 <= CH_8 + 1) {
event_timer = 0;
event_value = command_cond_queue.alt;
event_repeat = command_cond_queue.lat * 2;
2013-01-10 14:42:24 -04:00
event_delay = command_cond_queue.lng * 500.0f; // /2 (half cycle time) * 1000 (convert to milliseconds)
2012-08-21 23:19:50 -03:00
switch(command_cond_queue.p1) {
case CH_5:
event_undo_value = g.rc_5.radio_trim;
break;
case CH_6:
event_undo_value = g.rc_6.radio_trim;
break;
case CH_7:
event_undo_value = g.rc_7.radio_trim;
break;
case CH_8:
event_undo_value = g.rc_8.radio_trim;
break;
}
update_events();
}
2011-03-13 03:25:38 -03:00
}
2011-07-17 07:32:00 -03:00
static void do_repeat_relay()
2011-03-13 03:25:38 -03:00
{
2012-08-21 23:19:50 -03:00
event_id = RELAY_TOGGLE;
event_timer = 0;
2013-01-10 14:42:24 -04:00
event_delay = command_cond_queue.lat * 500.0f; // /2 (half cycle time) * 1000 (convert to milliseconds)
2012-08-21 23:19:50 -03:00
event_repeat = command_cond_queue.alt * 2;
update_events();
2011-03-19 07:14:15 -03:00
}
2012-07-24 23:02:54 -03:00
2013-07-13 11:27:51 -03:00
// do_roi - starts actions required by MAV_CMD_NAV_ROI
// this involves either moving the camera to point at the ROI (region of interest)
// and possibly rotating the copter to point at the ROI if our mount type does not support a yaw feature
// Note: the ROI should already be in the command_nav_queue global variable
// TO-DO: add support for other features of MAV_CMD_DO_SET_ROI including pointing at a given waypoint
static void do_roi()
2012-07-24 23:02:54 -03:00
{
#if MOUNT == ENABLED
2012-08-21 23:19:50 -03:00
// check if mount type requires us to rotate the quad
2012-10-08 00:31:10 -03:00
if( camera_mount.get_mount_type() != AP_Mount::k_pan_tilt && camera_mount.get_mount_type() != AP_Mount::k_pan_tilt_roll ) {
2013-07-14 05:36:27 -03:00
yaw_look_at_WP = pv_location_to_vector(command_cond_queue);
2012-12-08 01:23:32 -04:00
set_yaw_mode(YAW_LOOK_AT_LOCATION);
2012-08-21 23:19:50 -03:00
}
// send the command to the camera mount
2013-07-14 05:36:27 -03:00
camera_mount.set_roi_cmd(&command_cond_queue);
2012-08-21 23:19:50 -03:00
// TO-DO: expand handling of the do_nav_roi to support all modes of the MAVLink. Currently we only handle mode 4 (see below)
// 0: do nothing
// 1: point at next waypoint
// 2: point at a waypoint taken from WP# parameter (2nd parameter?)
// 3: point at a location given by alt, lon, lat parameters
2013-07-13 11:27:51 -03:00
// 4: point at a target given a target id (can't be implemented)
2012-07-24 23:02:54 -03:00
#else
2012-12-08 01:23:32 -04:00
// if we have no camera mount aim the quad at the location
2013-07-14 05:36:27 -03:00
yaw_look_at_WP = pv_location_to_vector(command_cond_queue);
2012-12-08 01:23:32 -04:00
set_yaw_mode(YAW_LOOK_AT_LOCATION);
2012-07-24 23:02:54 -03:00
#endif
}
2012-12-06 10:48:30 -04:00
// do_take_picture - take a picture with the camera library
static void do_take_picture()
{
2012-12-06 11:57:08 -04:00
#if CAMERA == ENABLED
2012-12-22 04:26:27 -04:00
camera.trigger_pic();
2012-12-06 11:57:08 -04:00
if (g.log_bitmask & MASK_LOG_CAMERA) {
Log_Write_Camera();
}
#endif
2012-12-06 10:48:30 -04:00
}