%function bstruct = waypointgeo(latitude,longitude,depth,rpm)
%function bstruct = waypointgeo(latitude,longitude,depth,rpm,duration)
%function bstruct = waypointgeo(latitude,longitude,vertical,speed,duration, ...
%	captureradius,circlemode,verticalmode,speedmode)
function bstruct = waypointgeo(latitude,longitude,vertical,speed,duration, ...
	captureradius,circlemode,verticalmode,speedmode)
[bdefaults,bnames] = behaviorDefaults;
bstruct = bdefaults{indexof(bnames,'waypointgeo')};

if nargin <= 5,
	captureradius = 10;
	circlemode = 'True';
	verticalmode = 'depth';
	speedmode = 'rpm';
end

bstruct = rmfield(bstruct,'verticalblock');
bstruct = rmfield(bstruct,'speedblock');
bstruct = setfield(bstruct,'latitude',latitude);
bstruct = setfield(bstruct,'longitude',longitude);
bstruct = setfield(bstruct,'captureradius',captureradius);
bstruct = setfield(bstruct,'circlemode',circlemode);
bstruct = setfield(bstruct,'verticalmode',verticalmode);
bstruct = setfield(bstruct,verticalmode,vertical);
bstruct = setfield(bstruct,'speedmode',speedmode);
bstruct = setfield(bstruct,speedmode,speed);
if nargin == 4, return, end
bstruct = setfield(bstruct,'duration',duration);