%function [bdefault,bnames] = behaviorDefaults(behaviorsOnly)
function [bdefault,bnames] = behaviorDefaults(behaviorsOnly)

if ~nargin, behaviorsOnly = 0; end

if ~behaviorsOnly,
    
% Relative Waypoint
waypointrel.name = 'waypointrel';
waypointrel.range = [];
waypointrel.azimuth = [];

% Compass Star
compassstar.name = 'compassstar';
compassstar.missionname = 'compassstar.mis';
compassstar.startlat = 41.523596;
compassstar.startlon = -70.671533;
compassstar.tracklength =100.0;
compassstar.azimuth = 135.0;
compassstar.depth = 3;
compassstar.rpm = 300;
compassstar.gpsfixesperleg = 1;
compassstar.numlegs = 5;
compassstar.transittime = 300;

% Compass Circle
compasscircle.name = 'compasscircle';
compasscircle.missionname = 'compasscircle.mis';
compasscircle.startlat = 41.523596;
compasscircle.startlon = -70.671533;
compasscircle.tracklength =100.0;
compasscircle.azimuth = 135.0;
compasscircle.depth = 3;
compasscircle.rpm = 300;
compasscircle.gpsfixesperleg = 1;
compasscircle.numlegs = 10;
compasscircle.transittime = 300;

% Survey Criss Cross
crisscross.name = 'crisscross';
crisscross.missionname = 'crisscross.mis';
crisscross.lat0 = 33.276600;
crisscross.lon0 = -117.548133;
crisscross.lat1 = 33.286467;
crisscross.lon1 = -117.533100;
crisscross.lat2 = 33.324917;	
crisscross.lon2 = -117.568900;
crisscross.sonarrange = 100.0;
crisscross.naverr = 1.0;
crisscross.depth = 60;
crisscross.rpm = 300;
crisscross.gpsfixesperleg = 1;
crisscross.transitdistance = 1000;

% Survey
survey.name = 'survey';
survey.missionname = 'survey.mis';
survey.startlat = 41.523596;
survey.startlon = -70.671533;
survey.tracklead = 20.0;
survey.tracklength =100.0;
survey.trackspacing1 = 35.0;
survey.trackspacing2 = 55.0;
survey.azimuth = 135.0;
survey.depth = 3;
survey.rpm = 300;
survey.gpsfixesperleg = 1;
survey.numlegs = 10;
survey.transittime = 300;

% Survey Box
surveybox.name = 'surveybox';
surveybox.missionname = 'surveybox.mis';
surveybox.northwestlat = 41.523596;
surveybox.northwestlon = -70.675;
surveybox.southeastlat = 41.52;
surveybox.southeastlon = -70.671533;
surveybox.tracklead = 20.0;
surveybox.trackspacing1 = 35.0;
surveybox.trackspacing2 = 55.0;
surveybox.depth = 3;
surveybox.rpm = 300;
surveybox.gpsfixesperleg = 1;
surveybox.transittime = 300;

% Survey Area
surveyarea.name = 'surveyarea';
surveyarea.missionname = 'surveyarea.mis';
surveyarea.lat0 = 33.276600;
surveyarea.lon0 = -117.548133;
surveyarea.lat1 = 33.286467;
surveyarea.lon1 = -117.533100;
surveyarea.lat2 = 33.324917;	
surveyarea.lon2 = -117.568900;
surveyarea.tracklead = 100.0;
surveyarea.trackspacing1 = 200.0;
surveyarea.trackspacing2 = 200.0;
surveyarea.depth = 60;
surveyarea.rpm = 300;
surveyarea.gpsfixesperleg = 1;
surveyarea.transittime = 1200;

% Survey Area EZ
surveyareaez.name = 'surveyareaez';
surveyareaez.missionname = 'surveyarea.mis';
surveyareaez.lat0 = 33.276600;
surveyareaez.lon0 = -117.548133;
surveyareaez.lat1 = 33.286467;
surveyareaez.lon1 = -117.533100;
surveyareaez.lat2 = 33.324917;	
surveyareaez.lon2 = -117.568900;
surveyareaez.sonarrange = 100.0;
surveyareaez.naverr = 1.0;
surveyareaez.depth = 60;
surveyareaez.rpm = 300;
surveyareaez.gpsfixesperleg = 1;
surveyareaez.transitdistance = 1000;

% Survey Area Oneway
surveyareaoneway.name = 'surveyareaoneway';
surveyareaoneway.missionname = 'surveyarea.mis';
surveyareaoneway.lat0 = 36.562102;
surveyareaoneway.lon0 = 27.144458;
surveyareaoneway.lat1 = 36.559722;
surveyareaoneway.lon1 = 27.143056;
surveyareaoneway.lat2 = 36.558199;	
surveyareaoneway.lon2 = 27.147105;
surveyareaoneway.tracklead = 100.0;
surveyareaoneway.trackspacing1 = 200.0;
surveyareaoneway.trackspacing2 = 200.0;
surveyareaoneway.depth = 60;
surveyareaoneway.rpm = 300;
surveyareaoneway.gpsfixesperleg = 1;
surveyareaoneway.transittime = 1200;

% Survey Area 4Leaf
surveyarea4leaf.name = 'surveyarea4leaf';
surveyarea4leaf.missionname = 'surveyarea.mis';
surveyarea4leaf.lat0 = 36.562102;
surveyarea4leaf.lon0 = 27.562102;
surveyarea4leaf.az = 0.0;
surveyarea4leaf.leglength = 500;
surveyarea4leaf.tracklead = 50.0;
surveyarea4leaf.depth = 60;
surveyarea4leaf.rpm = 300;
surveyarea4leaf.transittime = 1200;

% Survey Area Raw
surveyarearaw.name = 'surveyarearaw';
surveyarearaw.missionname = 'surveyarea.mis';

% Q Route
qroute.name = 'qroute';
qroute.missionname = 'qroute.mis';
qroute.lat = '33.16338333 33.11666667 33.01666667 32.96388333 32.93';
qroute.lon = '-117.40858333 -117.36666667 -117.31666667 -117.30333333 -117.3';
qroute.direction = 'along';
qroute.tracklead = 50.0;
qroute.width = 165;
qroute.trackspacing1 = 35.0;
qroute.trackspacing2 = 55.0;
qroute.depth = 3;
qroute.rpm = 300;
qroute.gpsfixesperleg = 1;
qroute.transittime = 300;

% Q Route Relative
qrouterelative.name = 'qrouterelative';
qrouterelative.missionname = 'qroute.mis';
qrouterelative.initiallat = 33.103667;
qrouterelative.initiallong = -117.3602;
qrouterelative.offsetfromstart = 0;
qrouterelative.length = 440;
qrouterelative.azimuth = 157.14;
qrouterelative.direction = 'cross';
qrouterelative.tracklead = 50;
qrouterelative.width = 915;
qrouterelative.trackspacing1 = 60;
qrouterelative.trackspacing2 = 160;
qrouterelative.depth = 100;
qrouterelative.rpm = 300;
qrouterelative.gpsfixesperleg = 1;
qrouterelative.transittime = 600;

% Worksite
worksite.name = 'worksite';
worksite.description = '*';
worksite.latitude = '*';
worksite.longitude = '*';
worksite.magneticvariation = '*';
worksite.utmzone = '*';

end %if ~behaviorsOnly

%Ascend
ascend.name = 'ascend';
ascend.description = '*';
ascend.comment = '*';
ascend.duration = [];
ascend.pitch = [];
ascend.enddepth = '*';
ascend.dropdescentweight = 'False';
ascend.dropascentweight = 'False';
ascend.speedblock = '*';
ascend.horizontalblock = '*';
ascend.debug = '0';

%AvoidObstacles
avoidobstacles.name = 'avoidobstacles';
avoidobstacles.description = '*';
avoidobstacles.comment = '*';
avoidobstacles.abortrange = 5;
avoidobstacles.minrange = 5;
avoidobstacles.avoidmode = 'NoPlane';
avoidobstacles.defrangeact = 40;
avoidobstacles.mydebug = 0;

%Chirpfin
chirpfin.name = 'chirpfin';
chirpfin.description = '*';
chirpfin.comment = '*';
chirpfin.duration = [];
chirpfin.amplitude = [];
chirpfin.initialfreq = [];
chirpfin.finalfreq = [];
chirpfin.plane = [];
chirpfin.debug = '0';

%CompassCal
compasscal.name = 'compasscal';
compasscal.description = '*';
compasscal.comment = '*';
compasscal.crossbow = 'False';
compasscal.leica = 'False';
compasscal.start = 'False';
compasscal.stop = 'False';
compasscal.debug = '0';

%ControlModem
controlmodem.name = 'controlmodem';
controlmodem.description = '*';
controlmodem.comment = '*';
controlmodem.allowcoms = 'True';
controlmodem.mydebug = '0';

%ControlPower
controlpower.name = 'controlpower';
controlpower.description = '*';
controlpower.comment = '*';
controlpower.circuit0 = 'False';
controlpower.circuit1 = 'False';
controlpower.circuit2 = 'False';
controlpower.circuit3 = 'False';
controlpower.circuit4 = 'False';
controlpower.circuit5 = 'False';
controlpower.circuit6 = 'False';
controlpower.circuit7 = 'False';
controlpower.circuit8 = 'False';
controlpower.circuit9 = 'False';
controlpower.circuit10 = 'False';
controlpower.circuit11 = 'False';
controlpower.circuit12 = 'False';
controlpower.circuit13 = 'False';
controlpower.circuit14 = 'False';
controlpower.circuit15 = 'False';
controlpower.circuit16 = 'False';

%ControlSonar
controlsonar.name = 'controlsonar';
controlsonar.description = '*';
controlsonar.comment = '*';
controlsonar.setmode = 'ns';
controlsonar.logging = 'ns';
controlsonar.setrange = '-1';
controlsonar.setresolution = '-1';
controlsonar.snapshot = '-1';
controlsonar.debug = '0';

%ControlSonarEdgeTech
controlsonaredgetech.name = 'controlsonaredgetech';
controlsonaredgetech.description = '*';
controlsonaredgetech.comment = '*';
controlsonaredgetech.sonarsystempoweron  = 'ns';
controlsonaredgetech.sonarsystempoweroff = 'ns';
controlsonaredgetech.sonarsystemreboot   = 'ns';
controlsonaredgetech.sonarsystemshutdown = 'ns';
controlsonaredgetech.setmodesbp = 'ns';
controlsonaredgetech.setmodessl = 'ns';
controlsonaredgetech.setmodessh = 'ns';
controlsonaredgetech.logging = 'ns';
controlsonaredgetech.sbppingrate = '-1';
controlsonaredgetech.sslpingrate = 'ns';
controlsonaredgetech.sshpingrate = 'ns';
controlsonaredgetech.sslpingrange = '-1';
controlsonaredgetech.sshpingrange = '-1';
controlsonaredgetech.debug = '0';

%DepthEnvelope
depthenvelope.name = 'depthenvelope';
depthenvelope.description = '*';
depthenvelope.comment = '*';
depthenvelope.mindepth = [];
depthenvelope.maxdepth = 100;
depthenvelope.minaltitude = 5;
depthenvelope.abortdepth = 110;
depthenvelope.abortaltitude = 2;
depthenvelope.debug = '0';    

%Descend
descend.name = 'descend';
descend.description = '*';
descend.comment = '*';
descend.duration = [];
descend.pitch = [];
descend.maxdepth = -1000.0;
descend.minaltitude = -1000.0;
descend.dropdescentweight = 'False';
descend.dropascentweight = 'False';
descend.speedblock = '*';
descend.horizontalblock = '*';
descend.debug = '0';

%GetGps
getgps.name = 'getgps';
getgps.description = '*';
getgps.comment = '*';
getgps.duration = [];
getgps.abortontimeout = 'False';
getgps.minhits = 1;
getgps.minsats = 6;
getgps.maxhitvelocity = 50.0;
getgps.maxhitspacing = 5.0;
getgps.debug = '0';

%Homing
homing.name = 'homing';
homing.description = '*';
homing.comment = '*';
homing.duration = [];
homing.headinggain = 1.0;
homing.releasedepth = 20.0;
homing.releasedepthchange = 2.0;
homing.releasetime = 900.0;
homing.latchedrangerate = 0.1;
homing.missedrangerate = 0.1;
homing.closingrangerate = -0.5;
homing.azimutherror = 0.0;
homing.headingrate = 0.2;
homing.pingperiod = 0.4;
homing.startdelaytime = 1.0;
homing.listentime = 60.0;
homing.tolerancetime = 4.0;
homing.runouttime = 30.0;
homing.realigntime = 25.0;
homing.searchtime = 30.0;
homing.terminationtime = 30.;
homing.speedblock = '*';
homing.horizontalblock = '*';
homing.mydebug = 1;
			
%Launch
launch.name = 'launch';
launch.description = '*';
launch.comment = '*';
launch.duration = [];
launch.elevator = [];
launch.finaldepth = [];
launch.abortontimeout = 'False';
launch.initialelevator = 0.0;
launch.initialrunout = -1.0;
launch.speedblock = '*';
launch.horizontalblock = '*';
launch.debug = '0';

%MissionTime
missiontimer.name = 'missiontimer';
missiontimer.description = '*';
missiontimer.comment = '*';
missiontimer.timeout = [];
missiontimer.debug = '0';

%SetDepth
setdepth.name = 'setdepth';
setdepth.description = '*';
setdepth.comment = '*';
setdepth.duration = [];
setdepth.depth = [];
setdepth.speedblock = '*';
setdepth.debug = '0';

%SetElevator
setelevator.name = 'setelevator';
setelevator.description = '*';
setelevator.comment = '*';
setelevator.duration = [];
setelevator.elevator = [];
setelevator.mindepth = -1.0;
setelevator.maxdepth = 10000.0;
setelevator.maxpitch = 90.0;
setelevator.speedblock = '*';
setelevator.debug = '0';

%Setpoint
setpoint.name = 'setpoint';
setpoint.description = '*';
setpoint.comment = '*';
setpoint.duration = [];
setpoint.heading = [];
setpoint.legduration = -1.0;
setpoint.maxlegs = 1;
setpoint.headinginc = 0;
setpoint.verticalblock = '*';
setpoint.speedblock = '*';
setpoint.debug = '0';

%SetRudder
setrudder.name = 'setrudder';
setrudder.description = '*';
setrudder.comment = '*';
setrudder.duration = [];
setrudder.rudder = 0.0;
setrudder.depth = -1.0;
setrudder.speedblock = '*';
setrudder.debug = '0';

%Trackline Geo
tracklinegeo.name = 'tracklinegeo';
tracklinegeo.description = '*';
tracklinegeo.comment = '*';
tracklinegeo.duration = [];
tracklinegeo.latitude = [];
tracklinegeo.longitude = [];
tracklinegeo.captureradius = [];
tracklinegeo.circlemode = 'True';
tracklinegeo.initiallat = [];
tracklinegeo.initiallong = [];
tracklinegeo.crosstrackpgain = 0.05;
tracklinegeo.crosstrackigain = 0.0005;
tracklinegeo.verticalblock = '*';
tracklinegeo.speedblock = '*';
tracklinegeo.debug = '0';

%Trackline Utm
tracklineutm.name = 'tracklineutm';
tracklineutm.description = '*';
tracklineutm.comment = '*';
tracklineutm.duration = [];
tracklineutm.northing = [];
tracklineutm.easting = [];
tracklineutm.captureradius = [];
tracklineutm.circlemode = 'True';
tracklineutm.initialn = [];
tracklineutm.initiale = [];
tracklineutm.crosstrackpgain = 0.05;
tracklineutm.crosstrackigain = 0.0005;
tracklineutm.verticalblock = '*';
tracklineutm.speedblock = '*';
tracklineutm.debug = '0';

%Waypoint Geo
waypointgeo.name = 'waypointgeo';
waypointgeo.description = '*';
waypointgeo.comment = '*';
waypointgeo.duration = [];
waypointgeo.latitude = [];
waypointgeo.longitude = [];
waypointgeo.captureradius = [];
waypointgeo.circlemode = 'True';
waypointgeo.verticalblock = '*';
waypointgeo.speedblock = '*';
waypointgeo.debug = '0';

%Waypoint Utm
waypointutm.name = 'waypointutm';
waypointutm.description = '*';
waypointutm.comment = '*';
waypointutm.duration = [];
waypointutm.northing = [];
waypointutm.easting = [];
waypointutm.captureradius = [];
waypointutm.circlemode = 'True';
waypointutm.verticalblock = '*';
waypointutm.speedblock = '*';
waypointutm.debug = '0';

%Wiggle
wiggle.name = 'wiggle';
wiggle.description = '*';
wiggle.comment = '*';
wiggle.duration = [];
wiggle.rudderperiod = 0.0;
wiggle.elevatorperiod = 0.0;
wiggle.rudderamplitude = 0.0;
wiggle.elevatoramplitude = 0.0;
wiggle.speedblock = '*';
wiggle.debug = '0';

%Yoyo
yoyo.name = 'yoyo';
yoyo.description = '*';
yoyo.comment = '*';
yoyo.duration = [];
yoyo.mindepth = [];
yoyo.maxdepth = [];
yoyo.minaltitude = 5.;
yoyo.maxcycles = 1;
yoyo.debug = '0';

%YoyoLeicaCalibrate
yoyoleicacalibrate.name = 'yoyoleicacalibrate';
yoyoleicacalibrate.description = '*';
yoyoleicacalibrate.comment = '*';
yoyoleicacalibrate.duration = [];
yoyoleicacalibrate.mindepth = [];
yoyoleicacalibrate.maxdepth = [];
yoyoleicacalibrate.pitchup = [];
yoyoleicacalibrate.pitchdown = [];
yoyoleicacalibrate.minaltitude = 5.;
yoyoleicacalibrate.maxcycles = 1;
yoyoleicacalibrate.initialheading = [];
yoyoleicacalibrate.increment = [];
yoyoleicacalibrate.speedblock = '*';
yoyoleicacalibrate.debug = '0';

% YoyoPitch					 
yoyopitch.name = 'yoyopitch';
yoyopitch.description = '*';
yoyopitch.comment = '*';
yoyopitch.duration = [];
yoyopitch.mindepth = [];
yoyopitch.maxdepth = [];
yoyopitch.pitchup = [];
yoyopitch.pitchdown = [];
yoyopitch.minaltitude = 5.;
yoyopitch.maxcycles = 1;
yoyopitch.debug = '0';

% create cell array
clear behaviorsOnly
s = whos;
n = {s.name};
bnames = '';
for i=1:length(n),
	eval(['bdefault{i} = ' s(i).name ';']);
	bnames = strvcat(bnames,s(i).name);
end

i = indexof(bnames,'tracklineutm');
bdefault{i}.name = 'trackline';
i = indexof(bnames,'tracklinegeo');
bdefault{i}.name = 'trackline';
i = indexof(bnames,'waypointutm');
bdefault{i}.name = 'waypoint';
i = indexof(bnames,'waypointgeo');
bdefault{i}.name = 'waypoint';
