This commit is contained in:
2025-08-12 10:42:30 +08:00
parent fb6874c1e5
commit 71b44dc6b0
15 changed files with 746 additions and 61 deletions

94
missions/auv150/alpha.bhv Normal file
View File

@@ -0,0 +1,94 @@
//-------- FILE: alpha.bhv -------------
initialize DEPLOY = false
initialize RETURN = false
//----------------------------------------------
Behavior = BHV_Waypoint
{
name = waypt_survey
pwt = 100
condition = RETURN = false
condition = DEPLOY = true
endflag = RETURN = true
configflag = CRUISE_SPD = $[SPEED]
//configflag = OSPOS = $[OSX],$[OSY]
activeflag = INFO=$[OWNSHIP]
activeflag = INFO=$[BHVNAME]
activeflag = INFO=$[BHVTYPE]
cycleflag = CINFO=$[OSX],$[OSY]
wptflag = PREV=$(PX),$(PY)
wptflag = NEXT=$(NX),$(NY)
wptflag = TEST=$(X),$(Y)
wptflag = OSPOS=$(OSX),$(OSY)
wptflag_on_start = true
updates = WPT_UPDATE
perpetual = true
speed_alt = 1.2
use_alt_speed = true
lead = 8
lead_damper = 1
lead_to_start = true
speed = 12 // meters per second
capture_line = true
capture_radius = 5.0
slip_radius = 15.0
efficiency_measure = all
// points = pts={107.5,-53.5:112,-43.8:112,-46.1:111.7,-49.3:108.3,-52.7:107.7,-53.3}
polygon = 60,-40 : 60,-160 : 150,-160 : 180,-100 : 150,-40
order = normal
//repeat = 100000
repeat = 3
visual_hints = nextpt_color=yellow
visual_hints = nextpt_vertex_size=8
visual_hints = nextpt_lcolor=gray70
visual_hints = vertex_color=dodger_blue, edge_color=white
visual_hints = vertex_size=5, edge_size=1
}
//----------------------------------------------
Behavior=BHV_Waypoint
{
name = waypt_return
pwt = 100
condition = RETURN = true
condition = DEPLOY = true
condition = ((DEPLoy = true) or (alpha = one)) or (bravo = two)
perpetual = true
updates = RETURN_UPDATE
endflag = RETURN = false
endflag = DEPLOY = false
endflag = MISSION = complete
speed = 2.0
capture_radius = 2.0
slip_radius = 8.0
points = 0,-20
}
//----------------------------------------------
Behavior=BHV_ConstantSpeed
{
name = const_speed
pwt = 200
condition = SPD=true
condition = DEPLOY = true
perpetual = true
updates = SPEED_UPDATE
endflag = SPD = false
speed = 0.5
duration = 10
duration_reset = CONST_SPD_RESET=true
}

View File

@@ -0,0 +1,124 @@
// Alder mission file
ServerHost = localhost
ServerPort = 9000
Community = alpha
MOOSTimeWarp = 1
LatOrigin = 43.825300
LongOrigin = -70.330400
//------------------------------------------
// Antler config block
ProcessConfig = ANTLER
{
MSBetweenLaunches = 200
Run = MOOSDB @ NewConsole = false
//Run = pLogger @ NewConsole = false
Run = pMarineViewer @ NewConsole = false
//Run = uProcessWatch @ NewConsole = false
RUn = pShare @ NewConsole = false
}
//------------------------------------------
// pShare config block
ProcessConfig = pShare
{
AppTick = 10
CommsTick = 10
input = route = localhost:8085
output = src_name=APPCAST_REQ, route=192.168.1.200:8082
//发送消息看以下格式
//output = src_name=Y, dest_name=B, route=host:port
output = src_name=uMission_action_cmd,route=192.168.1.200:8082
output = src_name=DEPLOY, route=192.168.1.200:8082
output = src_name=RETURN, route=192.168.1.200:8082
output = src_name=MOOS_MANUAL_OVERIDE, route=192.168.1.200:8082
output = src_name=PZ, route=192.168.1.200:8082
output = src_name=LED, route=192.168.1.200:8082
//output = src_name = *, route=192.168.1.200:8082
}
//------------------------------------------
// uProcessWatch config block
ProcessConfig = uProcessWatch
{
AppTick = 4
CommsTick = 4
summary_wait = 5
nowatch = uXMS*
nowatch = uMAC*
nowatch = uPokeDB*
nowatch = uQueryDB*
nowatch = uTermCommand*
watch_all = true
}
//------------------------------------------
// pMarineViewer config block
ProcessConfig = pMarineViewer
{
AppTick = 4
CommsTick = 4
TIFF_FILE = forrest19.tif
set_pan_x = -90
set_pan_y = -280
zoom = 1
vehicle_shape_scale = 1.5
hash_delta = 50
hash_shade = 0.4
hash_viewable = true
scope = ODOMETRY_DIST
// Appcast configuration
appcast_height = 75
appcast_width = 30
appcast_viewable = true
appcast_color_scheme = indigo
nodes_font_size = medium
procs_font_size = medium
appcast_font_size = small
BUTTON_ONE = DEPLOY # DEPLOY=true
BUTTON_ONE = MOOS_MANUAL_OVERIDE=false # RETURN=false
BUTTON_TWO = RETURN # RETURN=true
BUTTON_Three = PZ # PZ=true
BUTTON_Four = LED # LED=on
cmd = label=MANUAL_FALSE, var=MOOS_MANUAL_OVERIDE, sval=false, receivers=auv150
cmd = label=MANUAL_TRUE, var=MOOS_MANUAL_OVERIDE, sval=true, receivers=auv150
}
//------------------------------------------
// pLogger config block
ProcessConfig = pLogger
{
AppTick = 10
CommsTick = 10
File = XLOG_SHORESIDE
PATH = ./
SyncLog = true @ 0.2
AsyncLog = true
FileTimeStamp = true
LogAuxSrc = true
// Log it all!!!!!
WildCardLogging = true
WildCardOmitPattern = *_STATUS
WildCardOmitPattern = DB_VARSUMMARY
WildCardOmitPattern = DB_RWSUMMARY
}

View File

@@ -0,0 +1,134 @@
// Alder mission file
ServerHost = localhost
ServerPort = 9000
Community = auv150
MOOSTimeWarp = 1
LatOrigin = $(LatOrigin)
LongOrigin = $(LongOrigin)
//------------------------------------------
// Antler config block
ProcessConfig = ANTLER
{
MSBetweenLaunches = 200
Run = MOOSDB @ NewConsole = false
Run = pNodeReporter @ NewConsole = false
//Run = pLogger @ NewConsole = false
Run = uProcessWatch @ NewConsole = false
Run = pHelmIvP @ NewConsole = false
Run = pAUV150 @ NewConsole = false
Run = pShare @ NewConsole = false
}
//------------------------------------------
// pShare config block
ProcessConfig = pShare
{
AppTick = 10
CommsTick = 10
//UUV 信息
//output = src_name = NODE_REPORT*, route = 192.168.137.7:8085
//App 信息
//output = src_name = APPCAST*, route = 192.168.137.7:8085
//路径点信息
//output = src_name = VIEW*, route = 192.168.137.7:8085
output = src_name = *, route = 192.168.1.100:8085
//调试端输入端口
input = route = localhost:8082
}
//------------------------------------------
// uProcessWatch config block
ProcessConfig = uProcessWatch
{
AppTick = 4
CommsTick = 4
summary_wait = 5
nowatch = uXMS*
nowatch = uMAC*
nowatch = uPokeDB*
nowatch = uQueryDB*
nowatch = uTermCommand*
watch_all = true
}
//------------------------------------------
// pHelmIvP config block
ProcessConfig = pHelmIvP
{
AppTick = 4
CommsTick = 4
Behaviors = gly_1.bhv
Verbose = quiet
Domain = course:0:359:360
Domain = speed:0:4:21
Domain = depth:0:100:101
//IVP_BEHAVIOR_DIR = ../../lib
ok_skew = any
start_in_drive = false
}
//------------------------------------------
// pNodeReporter config block
ProcessConfig = pNodeReporter
{
AppTick = 2
CommsTick = 2
platform_length = 2 // meters
//platform_beam = 0.2 // meters
platform_type = auv
platform_color = dodger_blue
//vessel_type = auv
}
//------------------------------------------
// pAUV150 config block
ProcessConfig = pAUV150
{
AppTick = 10
CommsTick = 10
server_host = $(server_host)
LatOrigin = $(LatOrigin)
LongOrigin = $(LongOrigin)
ControlFrequency = 10
}
//------------------------------------------
// pLogger config block
ProcessConfig = pLogger
{
AppTick = 10
CommsTick = 10
File = XLOG_SHORESIDE
PATH = ./
SyncLog = true @ 0.2
AsyncLog = true
FileTimeStamp = true
LogAuxSrc = true
// Log it all!!!!!
WildCardLogging = true
WildCardOmitPattern = *_STATUS
WildCardOmitPattern = DB_VARSUMMARY
WildCardOmitPattern = DB_RWSUMMARY
}

74
missions/auv150/gly_1.bhv Normal file
View File

@@ -0,0 +1,74 @@
//-------- FILE: gly_1.bhv -------------
initialize DEPLOY = false
initialize RETURN = false
//----------------------------------------------
Behavior = BHV_Waypoint
{
name = waypt_survey
pwt = 100
condition = RETURN = false
condition = DEPLOY = true
//endflag = RETURN = true
endflag = MISSION = complete
configflag = CRUISE_SPD = $[SPEED]
//configflag = OSPOS = $[OSX],$[OSY]
activeflag = INFO=$[OWNSHIP]
activeflag = INFO=$[BHVNAME]
activeflag = INFO=$[BHVTYPE]
cycleflag = CINFO=$[OSX],$[OSY]
wptflag = PREV=$(PX),$(PY)
wptflag = NEXT=$(NX),$(NY)
wptflag = TEST=$(X),$(Y)
wptflag = OSPOS=$(OSX),$(OSY)
wptflag_on_start = true
updates = WPT_UPDATE
// perpetual = true
speed_alt = 1.2
use_alt_speed = true
lead = 8
lead_damper = 1
lead_to_start = true
speed = 2 // meters per second
capture_line = true
capture_radius = 5.0
slip_radius = 15.0
efficiency_measure = all
// points = pts={107.5,-53.5:112,-43.8:112,-46.1:111.7,-49.3:108.3,-52.7:107.7,-53.3}
// polygon = -50,-100: -50,-300: 25, -300: 25, -100: 100, -100: 100, -300: 175, -300: 175, -100
polygon = -50,-100: 0,-300: 50, -287.5: 0, -87.5: 50, -75: 100, -275: 150, -262.5: 100, -62.5
// polygon = -50,-100: -50,-170.71: 0,-220.71: 70.71,-220.71: 120.71,-170.71: 120.71,-100: 70.71,-50: 0,-50: -50,-100
// polygon = -50,-100: -50,-300
order = normal
repeat = 0
visual_hints = nextpt_color=yellow
visual_hints = nextpt_vertex_size=8
visual_hints = nextpt_lcolor=gray70
visual_hints = vertex_color=dodger_blue, edge_color=white
visual_hints = vertex_size=5, edge_size=1
}
//----------------------------------------------
Behavior = BHV_ConstantDepth
{
name = bhv_const_depth
pwt = 100
condition = DEPLOY = true
perpetual = true
updates = DEPTH_VALUE
depth = 2
duration = no-time-limit
peakwidth = 8
basewidth = 12
summitdelta = 10
}

74
missions/auv150/gly_2.bhv Normal file
View File

@@ -0,0 +1,74 @@
//-------- FILE: gly_1.bhv -------------
initialize DEPLOY = false
initialize RETURN = false
//----------------------------------------------
Behavior = BHV_Waypoint
{
name = waypt_survey
pwt = 100
condition = RETURN = false
condition = DEPLOY = true
//endflag = RETURN = true
endflag = MISSION = complete
configflag = CRUISE_SPD = $[SPEED]
//configflag = OSPOS = $[OSX],$[OSY]
activeflag = INFO=$[OWNSHIP]
activeflag = INFO=$[BHVNAME]
activeflag = INFO=$[BHVTYPE]
cycleflag = CINFO=$[OSX],$[OSY]
wptflag = PREV=$(PX),$(PY)
wptflag = NEXT=$(NX),$(NY)
wptflag = TEST=$(X),$(Y)
wptflag = OSPOS=$(OSX),$(OSY)
wptflag_on_start = true
updates = WPT_UPDATE
// perpetual = true
speed_alt = 1.2
use_alt_speed = true
lead = 8
lead_damper = 1
lead_to_start = true
speed = 2 // meters per second
capture_line = true
capture_radius = 5.0
slip_radius = 15.0
efficiency_measure = all
// points = pts={107.5,-53.5:112,-43.8:112,-46.1:111.7,-49.3:108.3,-52.7:107.7,-53.3}
// polygon = -50,-100: -50,-300: 25, -300: 25, -100: 100, -100: 100, -300: 175, -300: 175, -100
polygon = -50,-100: 0,-300: 50, -287.5: 0, -87.5: 50, -75: 100, -275: 150, -262.5: 100, -62.5
// polygon = -50,-100: -50,-170.71: 0,-220.71: 70.71,-220.71: 120.71,-170.71: 120.71,-100: 70.71,-50: 0,-50: -50,-100
// polygon = -50,-100: -50,-300
order = normal
repeat = 0
visual_hints = nextpt_color=yellow
visual_hints = nextpt_vertex_size=8
visual_hints = nextpt_lcolor=gray70
visual_hints = vertex_color=dodger_blue, edge_color=white
visual_hints = vertex_size=5, edge_size=1
}
//----------------------------------------------
Behavior = BHV_ConstantDepth
{
name = bhv_const_depth
pwt = 100
condition = DEPLOY = true
perpetual = true
updates = DEPTH_VALUE
depth = 2
duration = no-time-limit
peakwidth = 8
basewidth = 12
summitdelta = 10
}

39
missions/auv150/kill.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash -e
# 查找并杀死由launch.sh启动的进程
# 假设launch.sh启动的进程包含特定的标识符比如mission名称
# 定义进程标识符根据实际launch.sh启动的程序进行调整
#!/bin/bash -e
# Kill all processes launched by launch.sh
echo "Killing AUV150 mission processes..."
# Kill processes by name patterns
pkill -f "pAntler.*targ_vehicle.moos" 2>/dev/null || true
pkill -f "uMAC.*targ_vehicle.moos" 2>/dev/null || true
pkill -f "pNodeReporter" 2>/dev/null || true
pkill -f "uProcessWatch" 2>/dev/null || true
pkill -f "pHelmIvP" 2>/dev/null || true
pkill -f "pAUV150" 2>/dev/null || true
pkill -f "pShare" 2>/dev/null || true
pkill -f "pMarineViewer" 2>/dev/null || true
pkill -f "MOOSDB" 2>/dev/null || true
# Wait a moment for processes to terminate
echo "Waiting for processes to terminate..."
sleep 2
# Force kill any remaining processes
pkill -9 -f "pAntler.*targ_vehicle.moos" 2>/dev/null || true
pkill -9 -f "uMAC.*targ_vehicle.moos" 2>/dev/null || true
pkill -9 -f "pNodeReporter" 2>/dev/null || true
pkill -9 -f "uProcessWatch" 2>/dev/null || true
pkill -9 -f "pHelmIvP" 2>/dev/null || true
pkill -9 -f "pAUV150" 2>/dev/null || true
pkill -9 -f "pShare" 2>/dev/null || true
pkill -9 -f "pMarineViewer" 2>/dev/null || true
pkill -9 -f "MOOSDB" 2>/dev/null || true
echo "All AUV150 processes have been terminated."

68
missions/auv150/launch.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/bash -e
#----------------------------------------------------------
# Script: launch.sh
# Author: Michael Benjamin
# LastEd: May 17th 2019
#----------------------------------------------------------
# Part 1: Set global var defaults
#----------------------------------------------------------
# 注意书写格式,不能有空格
TIME_WARP=1
JUST_MAKE="no"
LatOrigin="39.0935"
LongOrigin="117.5361"
server_host="192.168.1.88"
#----------------------------------------------------------
# Part 2: Check for and handle command-line arguments
#----------------------------------------------------------
for ARGI; do
if [ "${ARGI}" = "--help" -o "${ARGI}" = "-h" ]; then
echo "launch.sh [SWITCHES] [time_warp] "
echo " --help, -h Show this help message "
echo " --just_make, -j Just create targ files, no launch "
echo " --fast, -f Init positions for fast encounter "
exit 0;
elif [ "${ARGI//[^0-9]/}" = "$ARGI" -a "$TIME_WARP" = 1 ]; then
TIME_WARP=$ARGI
elif [ "${ARGI}" = "--just_make" -o "${ARGI}" = "-j" ] ; then
JUST_MAKE="yes"
elif [ "${ARGI}" = "--fast" -o "${ARGI}" = "-f" ] ; then
START_POS1="170,-80,270"
START_POS2="-30,-80,90"
LOITER_POS1="x=0,y=-95"
LOITER_POS2="x=125,y=-65"
else
echo "launch.sh Bad arg:" $ARGI " Exiting with code: 1"
exit 1
fi
done
#----------------------------------------------------------
# Part 3: Create the .moos and .bhv files.
#----------------------------------------------------------
nsplug alpha_vehicle.moos targ_vehicle.moos -i -f WARP=$TIME_WARP \
LatOrigin=$LatOrigin \
LongOrigin=$LongOrigin \
server_host=$server_host
# nsplug meta_vehicle.bhv targ_gilda.bhv -i -f VNAME=$VNAME2 \
# START_POS=$START_POS2 LOITER_POS=$LOITER_POS2
if [ ${JUST_MAKE} = "yes" ] ; then
echo "Files assembled; nothing launched; exiting per request."
exit 0
fi
#----------------------------------------------------------
# Part 4: Launch the processes
#----------------------------------------------------------
echo "Launching Shoreside MOOS Community. WARP is" $TIME_WARP
pAntler targ_vehicle.moos >& /dev/null &
uMAC targ_vehicle.moos
kill -- -$$