删除了无用文件,增加了bin目录

This commit is contained in:
2023-11-24 17:58:21 +08:00
parent d422643dcf
commit 1e9b71b673
10 changed files with 0 additions and 1813 deletions

0
bin/placeholder Normal file
View File

View File

@@ -1,27 +0,0 @@
#--------------------------------------------------------
# The CMakeLists.txt for: pTaskManger
# Author(s): zjk
#--------------------------------------------------------
FILE(GLOB SRC *.cpp)
#include_directories(/usr/local/include/jsoncpp)
#link_directories(/usr/local/lib/)
include_directories(/usr/include/jsoncpp/)
link_directories(/usr/local/lib/)
ADD_EXECUTABLE(pTaskManger ${SRC})
TARGET_LINK_LIBRARIES(pTaskManger
${MOOS_LIBRARIES}
mbutil
m
pthread
jsoncpp)

File diff suppressed because it is too large Load Diff

View File

@@ -1,151 +0,0 @@
/*
* @Author: 1553836110 1553836110@qq.com
* @Date: 2023-09-28 15:45:17
* @LastEditors: zjk 1553836110@qq.com
* @LastEditTime: 2023-11-15 09:31:32
* @FilePath: /moos-ivp-pi/src/pTaskManger/TaskManger.h
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
/************************************************************/
/* NAME: zjk */
/* ORGN: MIT */
/* FILE: TaskManger.h */
/* DATE: */
/************************************************************/
#ifndef TaskManger_HEADER
#define TaskManger_HEADER
#include "MOOS/libMOOS/MOOSLib.h"
#include "MOOS/libMOOS/Thirdparty/AppCasting/AppCastingMOOSApp.h"
#include <queue>
#include <list>
#include "json/json.h"
#include "VarDataPair.h"
using namespace std;
enum TaskType{WAYPOINTS, CONSTDEPTH, CONSTSPEED, CONSTHEADING, WAYPOLYGON, NOTYPE};
enum Status{FAULT=0, UNRUN=1, MANUAL=2 ,RUN=3, CONFIG=5};
// class TaskManger : public CMOOSApp
class TaskManger : public AppCastingMOOSApp
{
public:
TaskManger();
virtual ~TaskManger();
bool OnNewMail(MOOSMSG_LIST &NewMail);
bool Iterate();
bool OnConnectToServer();
bool OnStartUp();
void RegisterVariables();
bool buildReport();
void postFaultNumber(int n);
bool setSpeed(double speed);
bool setMaxDepth(string depth);
bool setWpt(std::string wpt, string speed, string depth);
bool setWayPol(string polygon, string speed, string depth);
bool setTaskTimer(string timerCount);
bool setSafetyRules(string maxTime, string maxDepth, string minAltitude, string polygon);
bool setWayConfig(string lead, string lead_damper, string capture_line, string capture_radius,string slip_radius);
bool sendNode(const string current_node, list<string> &nodeList);
bool getWord(const string str, int ct, string &word);
string getSpeed(const string node);
string getDepth(const string node);
string getWayPoint(const string node);
string getWayPolygon(const list<string> nodeList);
string getNodeName(const string node);
string getNode(list<string> &nodelist);
string getTimeCount();
string getMaxDepth();
TaskType getTaskTpye(const string node);
int readTaskFile(string taskName);
int readSafetyRules(string fileName);
int readWayConfig(string fileName);
void postReportToSSM();
inline void clearHelmFlag(){Notify("HELM_MAP_CLEAR",0.0);}
inline void taskStart();
inline void taskFinish();
void FaultFlagClear();
inline void InitConfig();
//内部消息发布
const string UPDATE_WPT = "WPT_UPDATE";
const string UPDATE_SPD = "SPEED_UPDATE";
const string UPDATE_DEP = "DEPTH_UPDATE";
const string UPDATE_TIMER = "TIMER_UPDATES";
const string UPDATE_MAXDEP = "MAXDEEP_UPDATES";
const string UPDATE_OPREGION = "OPREGION_UPDATES";
const string UPDATE_RESETFAULT = "OPREGION_RESET";
//内部消息订阅
const string MSG_WPTFLAG = "CurrentPointComplete";
const string MSG_ENDFLAG = "END_WayPoint";
const string MSG_START = "START";
const string MSG_SENDSAFTRULES = "SendSaftRules";
const string MSG_FALUT = "TaskFault";
const string MSG_RUN = "RUN";
const string MSG_CLEARFAULT = "ClearFalut";
//交互消息
const string MSG_IN_SSM = "uMission_action_cmd";
const string MSG_TO_SSM = "uMission_task_fb";
const string MSG_TO_FH = "uMission_fault_fb";
const string MSG_IN_MAN = "uManual_enable_cmd"; //TODO: 增加手操状态
const string MSG_FAULT_LEV2 = "uFH_errorMsg2_fb";
const string MSG_FALUT_LEV3 = "uFH_errorMsg3_fb";
protected:
// 任务参数
string node_wpt;
string node_depth;
string node_speed;
// 安全规则
string maxDepth;
string maxTime;
string safePolygon;
string minAltitude="0";
// 路径参数
string lead;
string lead_damper;
string lead_to_start;
string capture_line;
string capture_radius;
string slip_radius;
string efficiency_measure;
string faultMsg;
TaskType nodeType;
list<string> nodeList;
private:
bool current_node_complete = false;
bool current_pol_complete = false;
bool start=false;
bool time_out=false;
int st=10;
int faultNumber = 0;
int readTask = 0;
string msg;
string current_node;
Status state = UNRUN;
Json::Value RepList;
Json::StreamWriterBuilder RepJsBuilder;
//任务文件参数
//TODO:动态配置任务文件等参数
string planConfigPath;
vector<string> taskList;
int taskCount;
string taskName;
//发送节点信息
Json::Value node_rpt;
};
#endif

View File

@@ -1,65 +0,0 @@
/*
* @Author: zjk 1553836110@qq.com
* @Date: 2023-09-28 15:45:17
* @LastEditors: zjk 1553836110@qq.com
* @LastEditTime: 2023-10-24 15:13:22
* @FilePath: /moos-ivp-extend/src/pTaskManger/TaskMangerMain.cpp
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
/************************************************************/
/* NAME: zjk */
/* ORGN: MIT */
/* FILE: TaskMangerMain.cpp */
/* DATE: */
/************************************************************/
#include <string>
#include "TaskManger.h"
#include "ColorParse.h"
#include "MBUtils.h"
using namespace std;
int main(int argc, char *argv[])
{
string mission_file;
string run_command = argv[0];
for(int i=1; i<argc; i++) {
string argi = argv[i];
if((argi=="-v") || (argi=="--version") || (argi=="-version"))
// showReleaseInfoAndExit();
cout << " Version : 0.01" << endl;
else if((argi=="-e") || (argi=="--example") || (argi=="-example"))
// showExampleConfigAndExit();
cout << " example : NULL" << endl;
else if((argi=="-h") || (argi == "--help") || (argi=="-help"))
// showHelpAndExit();
cout << " Low leave Control for UUV " << endl;
else if((argi=="-i") || (argi == "--interface"))
// showInterfaceAndExit();
cout << " UUV Motion Control " << endl;
else if(strEnds(argi, ".moos") || strEnds(argi, ".moos++"))
mission_file = argv[i];
else if(strBegins(argi, "--alias="))
run_command = argi.substr(8);
else if(i == 2)
run_command = argi;
}
if(mission_file == "")
// showHelpAndExit();
cout << termColor("green");
cout << "pTaskManger launching as " << run_command << endl;
cout << termColor() << endl;
TaskManger TaskMangerApp;
TaskMangerApp.Run(run_command.c_str(), mission_file.c_str(), argc, argv);
return(0);
}

View File

@@ -1,181 +0,0 @@
//-------- FILE: alpha.bhv -------------
initialize RUN = false
initialize TaskNum=t1
initialize SendTask=false
//--------------模式判断------------------------
set MODE = ACTIVE{
RUN=true
} INACTIVE
set MODE = T1{
MODE=ACTIVE
TaskNum = t1
}
//----------路径点任务----------------------------
Behavior = BHV_Waypoint
{
name = waypt_survey
pwt = 100 //优先权重
condition = MODE==T1
//endflag = START=false
endflag = END_WayPoint=true
configflag = CRUISE_SPD = $[SPEED]
//configflag = OSPOS = $[OSX],$[OSY]
activeflag = INFO=$[OWNSHIP]
activeflag = INFO=$[BHVNAME]
activeflag = INFO=$[BHVTYPE]
//cycleflag = CINFO=$[OSX],$[OSY]
wptflag = CurrentPointComplete=true
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
templating = spawn
// speed_alt = 1.2
//use_alt_speed = true
lead = 8
lead_damper = 1
lead_to_start = false
speed = 1 // meters per second
capture_line = true
capture_radius = 5.0
slip_radius = 15.0
efficiency_measure = all
polygon = 60,-40
order = normal
//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_ConstantDepth
{
name = const_depth
pwt = 100
//condition = DEPLOY = true
condition = MODE==T1
duration = no-time-limit
updates = DEPTH_UPDATE
depth = 0
}
//--------------定向任务--------------------
Behavior=BHV_ConstantHeading
{
name = const_heading
pwt = 100
//condition = START_TURN = true
//condition = DEPLOY = true
condition = MODE==T3
perpetual = true
activeflag = TURN = started
//endflag = TURN = done
//endflag = RETURN = true
//endflag = START_TURN = false
endflag = START=false
heading = 225
complete_thresh = 5
duration = no-time-limit
}
//--------------定速任务--------------------
Behavior=BHV_ConstantSpeed
{
name = const_speed
pwt = 1000
condition = MODE==T1
perpetual = true
updates = SPEED_UPDATE
//endflag = START=false
speed = 5
duration = no-time-limit
//peakwidth = 0.5
//basewidth = 0.5
}
//----------------安全模式-----------------------
//----------------计时器---------------------
Behavior = BHV_Timer
{
name = mtime
condition = MODE==T1
pwt = 100
templating = spawn
//duration_status = MSTATUS
//duration = 10
endflag = TIME_OUT=true
updates = TIMER_UPDATES
//perpetual = true
}
//-------------最大深度限制--------------------------
Behavior = BHV_MaxDepth
{
name = maxdepth
pwt = 200
condition = MODE==ACTIVE
updates = MAXDEEP_UPDATES
max_depth = 20
tolerance = 0
duration = no-time-limit
}
//--------------安全区域设置-----------------------
Behavior = BHV_OpRegion
{
// General Behavior Parameters
// ---------------------------
name = op_region // example
pwt = 300 // default
condition = MODE==TN
updates = OPREGION_UPDATES // example
// Parameters specific to this behavior
// ------------------------------------
max_time = 20 // default (seconds)
max_depth = 25 // default (meters)
min_altitude = 0 // default (meters)
reset_var = OPREGION_RESET // example
trigger_entry_time = 1 // default (seconds)
trigger_exit_time = 0.5 // default (seconds)
polygon = pts={-80,-00:-30,-175:150,-100:95,25}
breached_altitude_flag = TaskFault = AltitudeOut
breached_depth_flag = TaskFault = DepthOut
breached_poly_flag = TaskFault = RegionOut
breached_time_flag = TaskFault = TimeOut
visual_hints = vertex_color = brown // default
visual_hints = vertex_size = 3 // default
visual_hints = edge_color = aqua // default
visual_hints = edge_size = 1 // default
}

View File

@@ -1,269 +0,0 @@
//-------------------------------------------------
// NAME: M. Benjamin, MIT CSAIL
// FILE: alpha.moos
//-------------------------------------------------
ServerHost = localhost
ServerPort = 9000
Community = pi
MOOSTimeWarp = 1
// Forest Lake
LatOrigin = 43.825300
LongOrigin = -70.330400
// MIT Sailing Pavilion (use this one)
// LatOrigin = 42.358456
// LongOrigin = -71.087589
//------------------------------------------
// Antler configuration block
ProcessConfig = ANTLER
{
MSBetweenLaunches = 200
Run = MOOSDB @ NewConsole = false
//Run = pLogger @ NewConsole = false
Run = uSimMarineV22 @ NewConsole = false
Run = pMarinePIDV22 @ NewConsole = false
Run = pHelmIvP @ NewConsole = false
Run = pMarineViewer @ NewConsole = false
Run = uProcessWatch @ NewConsole = false
Run = pNodeReporter @ NewConsole = false
Run = pRealm @ NewConsole = false
Run = pTaskManger @ NewConsole = false
//Run = uTimerScript @ NewConsole = false
}
//------------------------------------------
// pLogger config block
ProcessConfig = pTaskManger
{
AppTick = 8
CommsTick = 8
planConfigPath = /home/zjk/Desktop/project/moos-ivp-extend/PlanConfigure.json
}
ProcessConfig = pLogger
{
AppTick = 8
CommsTick = 8
AsyncLog = true
// For variables that are published in a bundle on their first post,
// explicitly declare their logging request
//Log = IVPHELM_LIFE_EVENT @ 0 NOSYNC
//Log = REPORT @ 0 NOSYNC
//Log = BHV_SETTINGS @ 0 NOSYNC
Log = OPREGION_RESET @ 0 NOSYNC
LogAuxSrc = true
WildCardLogging = true
WildCardOmitPattern = *_STATUS
WildCardOmitPattern = DB_VARSUMMARY
WildCardOmitPattern = DB_RWSUMMARY
WildCardExclusionLog = true
}
//------------------------------------------
// uProcessWatch config block
ProcessConfig = uProcessWatch
{
AppTick = 4
CommsTick = 4
watch_all = true
nowatch = uPokeDB*
nowatch = uQueryDB*
nowatch = uXMS*
nowatch = uMAC*
}
//------------------------------------------
// uSimMarineV22 config block
ProcessConfig = uSimMarineV22
{
AppTick = 4
CommsTick = 4
start_pos = x=0, y=-20, heading=180, speed=5
prefix = NAV
turn_rate = 40
thrust_map = 0:0, 20:1, 40:2, 60:3, 80:4, 100:5
//thrust_reflect = true
buoyancy_rate = 0.075
max_depth_rate = 5
max_depth_rate_speed = 2.0
default_water_depth = 400
}
//------------------------------------------
// pHelmIvP config block
ProcessConfig = pHelmIvP
{
AppTick = 4
CommsTick = 4
behaviors = alpha.bhv
domain = course:0:359:360
domain = speed:0:10:101
domain = depth:0:100:101
park_on_allstop = false
//park_on_allstop = true
}
//------------------------------------------
// pMarinePID config block
ProcessConfig = pMarinePIDV22
{
AppTick = 20
CommsTick = 20
verbose = true
depth_control = true
// SIM_INSTABILITY = 20
// Yaw PID controller
yaw_pid_kp = 1.2
yaw_pid_kd = 0.0
yaw_pid_ki = 0.3
yaw_pid_integral_limit = 0.07
// Speed PID controller
speed_pid_kp = 1.0
speed_pid_kd = 0.0
speed_pid_ki = 0.1
speed_pid_integral_limit = 0.07
maxpitch = 15
maxelevator = 13
pitch_pid_kp = 1.5
pitch_pid_kd = 0
pitch_pid_ki = 1.0
pitch_pid_integral_limit = 0
z_to_pitch_pid_kp = 0.12
z_to_pitch_pid_kd = 0
z_to_pitch_pid_ki = 0.004
z_to_pitch_pid_integral_limit = 0.05
//MAXIMUMS
maxrudder = 100
maxthrust = 100
// A non-zero SPEED_FACTOR overrides use of SPEED_PID
// Will set DESIRED_THRUST = DESIRED_SPEED * SPEED_FACTOR
speed_factor = 0
simulation = true
}
//------------------------------------------
// pMarineViewer config block
ProcessConfig = pMarineViewer
{
AppTick = 4
CommsTick = 4
tiff_file = forrest19.tif
//tiff_file = MIT_SP.tif
vehicles_name_mode = names+depth //+shortmode
set_pan_x = -90
set_pan_y = -280
zoom = 0.65
vehicle_shape_scale = 1.5
hash_delta = 50
hash_shade = 0.22
hash_viewable = true
trails_point_size = 1
//op_vertex = x=-83, y=-47, lwidth=1,lcolor=yellow,looped=true,group=moa
//op_vertex = x=-46.4, y=-129.2, lwidth=1,lcolor=yellow,looped=true,group=moa
//op_vertex = x=94.6, y=-62.2, lwidth=1,lcolor=yellow,looped=true,group=moa
//op_vertex = x=58, y=20, lwidth=1,lcolor=yellow,looped=true,group=moa
// Appcast configuration
appcast_height = 75
appcast_width = 30
appcast_viewable = true
appcast_color_scheme = indigo
nodes_font_size = xlarge
procs_font_size = xlarge
appcast_font_size = large
// datum_viewable = true
// datum_size = 18
// gui_size = small
// left_context[survey-point] = DEPLOY=true
// left_context[survey-point] = MOOS_MANUAL_OVERRIDE=false
// left_context[survey-point] = RETURN=false
right_context[return] = DEPLOY=true
right_context[return] = MOOS_MANUAL_OVERRIDE=false
right_context[return] = RETURN=false
scope = RETURN
scope = WPT_STAT
scope = VIEW_SEGLIST
scope = VIEW_POINT
scope = VIEW_POLYGON
scope = MVIEWER_LCLICK
scope = MVIEWER_RCLICK
//button_one = START # START=true
button_one = START # uMission_action_cmd={"taskName":"east_waypt_survey","action":"start"}
//button_one = MOOS_MANUAL_OVERRIDE=false
button_two = STOP # START=false
//button_two = MOOS_MANUAL_OVERRIDE=true
button_three = FaultClear # ClearFalut = true
button_four = SendSecurityZone # SendSaftRules = true
action = MENU_KEY=deploy # DEPLOY = true # RETURN = false
action+ = MENU_KEY=deploy # MOOS_MANUAL_OVERRIDE=false
action = RETURN=true
action = UPDATES_RETURN=speed=1.4
}
//------------------------------------------
// pNodeReporter config block
ProcessConfig = pNodeReporter
{
AppTick = 2
CommsTick = 2
//platform_type = kayak
//更改显示形状为uuv
platform_type = UUV
platform_color = red
platform_length = 4
}
ProcessConfig = uTimerScript
{
AppTick = 4
CommsTick = 4
condition = DEPLOY = true
randvar = varname = RND_DEPTH, min=20, max=80, key=at_reset
event = var = DEPTH_UPDATE, val=depth=$[RND_DEPTH], time=120
reset_max = nolimit reset_time = all-posted
}

View File

@@ -1,37 +0,0 @@
#!/bin/bash
#--------------------------------------------------------------
# Script: clean.sh
# Author: Michael Benjamin
# Date: June 2020
#----------------------------------------------------------
# Part 1: Declare global var defaults
#----------------------------------------------------------
VERBOSE=""
#-------------------------------------------------------
# Part 2: Check for and handle command-line arguments
#-------------------------------------------------------
for ARGI; do
if [ "${ARGI}" = "--help" -o "${ARGI}" = "-h" ] ; then
echo "clean.sh [SWITCHES] "
echo " --verbose "
echo " --help, -h "
exit 0;
elif [ "${ARGI}" = "--verbose" -o "${ARGI}" = "-v" ] ; then
VERBOSE="-v"
else
echo "clean.sh: Bad Arg:" $ARGI
exit 1
fi
done
#-------------------------------------------------------
# Part 2: Do the cleaning!
#-------------------------------------------------------
if [ "${VERBOSE}" = "-v" ]; then
echo "Cleaning: $PWD"
fi
rm -rf $VERBOSE MOOSLog_* XLOG_* LOG_*
rm -f $VERBOSE *~ *.moos++
rm -f $VERBOSE targ_*
rm -f $VERBOSE .LastOpenedMOOSLogDirectory

View File

@@ -1,39 +0,0 @@
#!/bin/bash -e
#----------------------------------------------------------
# Script: launch.sh
# Author: Michael Benjamin
# LastEd: May 20th 2019
#----------------------------------------------------------
# Part 1: Set Exit actions and declare global var defaults
#----------------------------------------------------------
TIME_WARP=1
COMMUNITY="alpha"
GUI="yes"
#----------------------------------------------------------
# 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 "
exit 0;
elif [ "${ARGI}" = "--nogui" ] ; then
GUI="no"
elif [ "${ARGI//[^0-9]/}" = "$ARGI" -a "$TIME_WARP" = 1 ]; then
TIME_WARP=$ARGI
else
echo "launch.sh Bad arg:" $ARGI " Exiting with code: 1"
exit 1
fi
done
#----------------------------------------------------------
# Part 3: Launch the processes
#----------------------------------------------------------
echo "Launching $COMMUNITY MOOS Community with WARP:" $TIME_WARP
pAntler $COMMUNITY.moos --MOOSTimeWarp=$TIME_WARP >& /dev/null &
uMAC -t $COMMUNITY.moos
kill -- -$$

View File

@@ -1,12 +0,0 @@
// MOOS file
ServerHost = localhost
ServerPort = 9000
ProcessConfig = pTaskManger
{
AppTick = 10
CommsTick = 10
planConfigPath = /home/zjk/Desktop/project/moos-ivp-extend/PlanConfigure.json
}