MOOS-ivp 实验七 关于Helm Autonomy的介绍(3)The Bravo UUV 任务

MOOS-ivp 实验七 关于Helm Autonomy的介绍(3)The Bravo UUV 任务

经过了一个周末没干活,而且刚刚成为剁手的尾款人,接下来一周需要好好努力,继续加油QAQ!
此篇主要介绍了固定深度的航行以及定时任务的航行规划,下面使用两个实验来具体介绍一下如何对相关文件进行配置。

七、The Bravo UUV 任务

我们的下一步是改变Bravo任务来模拟UUV而不是surface vehicle。我们需要修改uSimMarine、pMarinePID和pHelmIvP中的一些配置。当然,我们也会在任务中加入一些行为组件,这样UUV就可以俯冲了。

在此部分,我们将:

当使用UUV时,如何扩展pMarinePID、 uSimMarine、 pHelmIvP
学习使用ConstantDepth行为
学会将行为联系在一起,协调运作
学习当使用水下航行器时,如何使用 pMarineViewer
第一步是对到目前为止我们的示例中使用的几个MOOS应用程序进行修改,以支持深度。

1.修改pMarinePID配置

为了拥有一个模拟的水下航行器,修改pMarinePID配置块。注意,需要在depth_control=true的情况下进行修改。

ProcessConfig = pMarinePID
{
  AppTick    = 20
  CommsTick  = 20

  verbose       = true
  depth_control = true

  // SIM_INSTABILITY = 20

  //Pitch PID controller
  pitch_pid_kp	         = 1.5
  pitch_pid_kd                   = 0.3
  pitch_pid_ki                   = 0.004
  pitch_pid_integral_limit       = 0

  //ZPID controller
  z_to_pitch_pid_kp              = 0.12
  z_to_pitch_pid_kd              = 0.1
  z_to_pitch_pid_ki              = 0.004
  z_to_pitch_pid_integral_limit  = 0.05

  maxpitch     = 15
  maxelevator  = 13
   
  // 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.0
  speed_pid_integral_limit = 0.07

  //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 = 20
}

2.修改uSimMarine配置

为了配置模拟的水下航行器,需要配置如下内容:

//------------------------------------------
// uSimMarine config block

ProcessConfig = uSimMarine
{
  AppTick	= 4
  CommsTick	= 4

  start_x       = 0
  start_y       = -10
  start_speed   = 0
  start_heading = 180

  prefix        = NAV

  turn_rate     = 40
  thrust_map    = 0:0, 20:1, 40:2, 60:3, 80:4, 100:5

  buoyancy_rate  = 0.15
  max_depth_rate  = 5
  max_depth_rate_speed = 2.0
  default_water_depth = 400
}

3.修改pHelmIvP的结构

下面的配置增加了helm的决策空间,其包括了101种可能的深度决策。在深水航行中,可以不同深度使用不同的配置进行。

ProcessConfig = pHelmIvP
{
  MaxAppTick = 10
  AppTick    = 4
  CommsTick  = 4

  term_report_interval=0

  bhv_dir_not_found_ok = true
  ivp_behavior_dir = /Users/ddmikerb

  behaviors  = alpha.bhv
  domain     = course:0:359:360
  domain     = speed:0:4:21
  domain     = depth:0:100:101
}

4.修改pNodeReporter配置

这个修改主要是装饰性的,可以将界面上的图标显示成为水下航行器而不是一个皮艇。

// pNodeReporter config block

ProcessConfig = pNodeReporter
{
  AppTick    = 2
  CommsTick	 = 2

  platform_type   = UUV
  platform_color  = yellow
  platform_length = 4
}

5.修改pMarineViewer配置

为了使界面可以实时显示水下航行器的深度在截面配置上添加这一句

vehicles_name_mode = names+depth

添加完成后,如下所示:
在这里插入图片描述

6.增加 ConstantDepth行为配置

为了可以使水下航行器在水下运行,在行为配置文件中,我们需要添加ConstantDepth行为模块。这个行为将使得水下航行器驾驶在指定深度运行。详细可以参考 The ConstantDepth Behavior

//-----------------------------------------------
Behavior = BHV_ConstantDepth
 {
   // General Behavior Parameters
   // ---------------------------
   name         = const_dep_west   // example
   pwt          = 100                // default
   updates      = CONST_DEP_UPDATES  // example
   condition = RETURN = false
   condition = DEPLOY = true
   condition = LOITER_REGION=west
   
   // Parameters specific to this behavior
   // ------------------------------------
            basewidth = 100          // default
                depth = 30            // default
   depth_mismatch_var = DEPTH_DIFF   // example
             duration = no-time-limit          
            peakwidth = 3            // default
          summitdelta = 50           // default
 }

//-----------------------------------------------
Behavior = BHV_ConstantDepth
 {
   // General Behavior Parameters
   // ---------------------------
   name         = const_dep_east   // example
   pwt          = 100                // default
   updates      = CONST_DEP_UPDATES  // example
   condition = RETURN = false
   condition = DEPLOY = true
   condition = LOITER_REGION=east
   
   // Parameters specific to this behavior
   // ------------------------------------
            basewidth = 100          // default
                depth = 10            // default
   depth_mismatch_var = DEPTH_DIFF   // example
             duration = no-time-limit          
            peakwidth = 3            // default
          summitdelta = 50           // default
 }
//-----------------------------------------------------------

其中可以通过对condition的不同条件以及depth进行配置,当水下航行器航行在west任务中时,更改depth为30,此时航行器航行在水深30m的状态下。其他参数基本都为默认配置无需进行其他修改,任务运行时间此时设置的是no-time-limit 表示不设置具体的运行时间。具体其他参数配置可以参考以上给的网址来进行详细了解。

二、Bravo UUV Surface任务

这项任务包括对Bravo示例任务的最后修改。在这次任务中,航行器将周期性地浮出水面,以零速度在水面等待数秒,然后俯冲并继续执行任务。这大概是为了模拟偶尔需要浮出水面进行GPS定位以重新设置导航解决方案的UUV所发生的情况。你的目标是:

利用Helm的Timer行为来增加你的任务,让你的vehicle周期性的停下来,然后浮出水面(每200秒一次)。利用另一个计时器行为开始时,vehicle在表面,等待60秒之前,让vehicle再次潜水。

1.增加Timer行为配置

关于Timer行为的详细配置可以参看网站The Timer Behavior
Timer行为某种程度来说是一种相当独特的行为,其不会产生任何目标函数。
下面第一个Timer行为是每200s水下航行器浮出水面进行一次gps定位。当200s计时到达时发布一个标志endflag = GPS_FIX=true ,触发第二个计时器开始计时,使得此时水下航行器浮在水面保持静止,持续60s后,第二个计时器发布标志endflag = GPS_FIX=false ,使得水下航行器重新进入深度航行状态。

代码如下(示例):

Behavior = BHV_Timer
 {
   // General Behavior Parameters
   // ---------------------------
   name         = bhv_timer_gps_fix     
   condition    = DEPLOY=true    //Deploying as usual
   condition    = GPS_FIX =false
   
   duration     = 200                  // After 200 s
   endflag      = GPS_FIX=true         // Get a gps fix
   updates      = GPS_FIX_UPDATES        
   perpetual    = true
   duration_idle_decay = false
   
   // Parameters specific to this behavior
   // ------------------------------------
   // None
 }

//-----------------------------------------------------------


Behavior = BHV_Timer
 {
   // General Behavior Parameters
   // ---------------------------
   name         = bhv_timer_at_surface     // default
   condition    = GPS_FIX=true    // At surface, waiting for GPS fix
   condition    = NAV_DEPTH=0 
  
   duration     = 60                  // Wait 60 s
   endflag      = GPS_FIX=false          // No longer need GPS fix
   updates      = AT_SURFACE_UPDATES        // example
   perpetual    = true
   duration_idle_decay = false

   // Parameters specific to this behavior
   // ------------------------------------
   // None
 }

因为需要用航行器发布的标志来限制ConstantDepth行为,所以需要在ConstantDepth行为的配置模块上增加一些条件

condition  = GPS_FIX =false

如图所示:
在这里插入图片描述
以此来限制水下航行器在某一深度的航行时间

2.显示界面

在某一处进行上浮,静止60s
在这里插入图片描述
接下来继续执行任务
在这里插入图片描述


总结

到这里实验七就结束了,实验七总体上让我们了解如何对.BHV文件进行基本的配置。将常用的behaviour行为进行了大概的介绍,通过几个实验让我们对.moos和.bhv文件的配置都有了一定的熟悉。其中涉及到了的行为有
BHV_Loiter、BHV_Waypoint、BHV_ConstantDepth、BHV_Timer。涉及到的.moos模块有uSimMarine、pMarinePID、pHelmIvP、pMarineViewer、uProcessWatch、pNodeReporter。通过对这些模块的不同配置,我们可以实现各种指定功能,比如按照预定轨迹行驶,按照固定深度行驶,按照任务规定时间行驶,以及这三种方式的各种组合。由此,水下航行的路线规划有着更多种的搭配。

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值