Beispiel #1
0
 public bool ExecutionUntil(IBehaviorExecutionContext context)
 {
     if (context != null)
     {
         // EXECUTE_UNTIL
         // EXECUTE_UNTIL_HERE
     }
     return true;
 }
Beispiel #2
0
    public static TriggerResult CheckTrigger(IBehaviorExecutionContext context)
    {
        var result = new TriggerResult {Active = false};

        if (context != null && !ExecutionComplete)
        {
            // SET_TRIGGER_HERE
        }
        return result;
    }
Beispiel #3
0
    public static TriggerResult CheckTrigger(IBehaviorExecutionContext context)
    {
        var result = new TriggerResult {Active = false};

        if (context != null && !ExecutionComplete)
        {
            var gestureInfoList = context.GetGestureInfoList("Greet_Left");
var gestureInfo = gestureInfoList.FirstOrDefault(s=>s.Confidence > 90);
if (gestureInfo.Active && gestureInfo.Confidence > 90)
{
Console.WriteLine("Gesture trigger received : {0} - {1}", gestureInfo.Name, gestureInfo.Confidence);
result.HumanId = gestureInfo.HumanId;
result.HumanInLoop = true;
result.Active = true;
}

        }
        return result;
    }
Beispiel #4
0
 public bool ExecuteInit(IBehaviorExecutionContext context, TriggerResult trigger)
 {
     if (!InitActionsComplete)
     {
         // INIT_BLOCK
         // INIT_BLOCK_HERE
         InitActionsComplete = true;
     }
     return InitActionsComplete;
 }
Beispiel #5
0
 public bool ExecutionUntil(IBehaviorExecutionContext context)
 {
     if (context != null)
     {
         // EXECUTE_UNTIL
         return (count <= 5);
     }
     return true;
 }
Beispiel #6
0
    public void Execute(IBehaviorExecutionContext context)
    {
        // STARTUP_BLOCK
          var var_6717280f_6dd1_692b_860c_f3d59bee0edb= new BehaviorInfo{BehaviorName = "stand",RobotName = "Hiro"};

  BehaviorModuleHelper.Execute(context, var_6717280f_6dd1_692b_860c_f3d59bee0edb);
  var var_bb61d711_7af2_c618_870c_a7505dff05e5= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Hello! I am Nao!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_bb61d711_7af2_c618_870c_a7505dff05e5);
  var var_778f900e_0853_13a8_b1b6_7e19fdddcb83= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("The doctor asked me to guide your therapy today!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_778f900e_0853_13a8_b1b6_7e19fdddcb83);
  var var_0c670167_94d8_aedf_969e_a493738905fe= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("At first I will demonstrate the exercise routine", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_0c670167_94d8_aedf_969e_a493738905fe);
  var var_d666dcfe_0bac_4133_b1a5_42b8b29891eb= new BehaviorInfo{BehaviorName = "liftLeftHand",RobotName = "Hiro"};

  BehaviorModuleHelper.Execute(context, var_d666dcfe_0bac_4133_b1a5_42b8b29891eb);
  var var_ded8b18b_cca7_3037_b4dd_04885555a3b8= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Please do this exercise five times. I will count for you!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_ded8b18b_cca7_3037_b4dd_04885555a3b8);
  var var_9affd26b_d86e_7ed7_b48f_9393f29c83cf= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Make yourself comfortable", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_9affd26b_d86e_7ed7_b48f_9393f29c83cf);
  var var_fc085727_4d3e_6efc_96fa_231ffb70bae4= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Start doing the routine slowly", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_fc085727_4d3e_6efc_96fa_231ffb70bae4);
  count = 0;

    }
Beispiel #7
0
        public static void Execute(IBehaviorExecutionContext context, BehaviorInfo info)
        {
            if (context != null && info != null)
            {
                Log.InfoFormat("Behavior Execution : {0} - {1}", info.BehaviorName, info.FunctionName);

                context.UpdateBehaviorResponderInfo(info);
                context.SyncExecuteBehavior(info);
            }
        }
    public bool ExecuteCyclic(IBehaviorExecutionContext context, TriggerResult trigger)
    {
        if (!CyclicActionsComplete && InitActionsComplete)
        {
            // CYCLIC_BLOCK
              var var_af0d9ba5_7f8e_6560_8d24_b70a9ba0510b= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Taro, we received a stop command.", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_af0d9ba5_7f8e_6560_8d24_b70a9ba0510b);
  var var_3e5335a3_9a1f_a44a_be41_4d9a6ea6e64b= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Yes, Let us go to rest position", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_3e5335a3_9a1f_a44a_be41_4d9a6ea6e64b);
  var var_aa5dbbc8_6eea_8066_b55f_b7d1125178e2 = new List<Task>();
  var var_71a15906_a3c2_8bd7_9262_a96cf5b603aa = new Action( () =>
  {
    var var_eba9448d_1a8b_7cea_9257_b15d34f07cc1= new BehaviorInfo
    {
    BehaviorName = "Take Rest",
    RobotName = "Hiro",Parameters = new Dictionary<string, object>()
    };

    BehaviorModuleHelper.Execute(context, var_eba9448d_1a8b_7cea_9257_b15d34f07cc1);

  });
  var var_67c4371e_7f29_7ef8_83de_ba7819f3b264 = new Action( () =>
  {
    var var_189a9b7e_37dc_f4b2_9a38_b8bdbc780275= new BehaviorInfo
    {
    BehaviorName = "Take Rest",
    RobotName = "Taro",Parameters = new Dictionary<string, object>()
    };

    BehaviorModuleHelper.Execute(context, var_189a9b7e_37dc_f4b2_9a38_b8bdbc780275);

  });
  var_aa5dbbc8_6eea_8066_b55f_b7d1125178e2.Add(Task.Run(var_71a15906_a3c2_8bd7_9262_a96cf5b603aa));
  var_aa5dbbc8_6eea_8066_b55f_b7d1125178e2.Add(Task.Run(var_67c4371e_7f29_7ef8_83de_ba7819f3b264));
  Task.WaitAll(var_aa5dbbc8_6eea_8066_b55f_b7d1125178e2.ToArray());
  System.Console.WriteLine("Parallel action execution complete");

            if (ExecutionLifetime == BehaviorExecutionLifetime.once)
            {
                CyclicActionsComplete = true;
            }
            else if (ExecutionLifetime == BehaviorExecutionLifetime.until)
            {
                var complete = ExecutionUntil(context);
                CyclicActionsComplete = !complete;
            }
        }
        return CyclicActionsComplete;
    }
Beispiel #9
0
 public bool Execute(IBehaviorExecutionContext context, TriggerResult trigger)
 {
     try
     {
         ExecuteInit(context, trigger);
         ExecuteCyclic(context, trigger);
         ExecuteExit(context, trigger);
         System.Console.WriteLine(@"Lifetime: {3} Init : {0}, Cyclic: {1}, Exit: {2}", InitActionsComplete,
             CyclicActionsComplete,
             ExitActionsComplete, ExecutionLifetime);
     }
     catch (BehaviorCanceledException ex)
     {
         Console.WriteLine(@"Execution canceled : {0}, {1} ,{2}", GetUid(), ex.Message, ex.StackTrace);
     }
     return ExecutionComplete;
 }
 public void Execute(IBehaviorExecutionContext context)
 {
     // EXIT_BLOCK
     // EXIT_BLOCK_HERE
 }
 public void Execute(IBehaviorExecutionContext context)
 {
     // STARTUP_BLOCK
     // STARTUP_BLOCK_HERE
 }
Beispiel #12
0
    public bool ExecuteCyclic(IBehaviorExecutionContext context, TriggerResult trigger)
    {
        if (!CyclicActionsComplete && InitActionsComplete)
        {
            // CYCLIC_BLOCK
              var var_e13f4a25_80e3_f7f2_a729_20d6aee5d4ba= new BehaviorInfo
  {
  BehaviorName = "Move To",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"translation", BehaviorModuleHelper.CreateBehaviorParameterOptions("0", false, "float")},
  {"rotation", BehaviorModuleHelper.CreateBehaviorParameterOptions("1", false, "float")},
  {"human", BehaviorModuleHelper.CreateBehaviorParameterOptions("1", false, "float")},
  {"dist", BehaviorModuleHelper.CreateBehaviorParameterOptions(1.50, false, "float")},
  {"x", BehaviorModuleHelper.CreateBehaviorParameterOptions(0.0, true, "float")},
  {"y", BehaviorModuleHelper.CreateBehaviorParameterOptions(0.0, true, "float")},
  {"theta", BehaviorModuleHelper.CreateBehaviorParameterOptions(0.0, true, "float")}
  }
  };

  if (context.RefreshApproachParameters(var_e13f4a25_80e3_f7f2_a729_20d6aee5d4ba, trigger)) {
  BehaviorModuleHelper.Execute(context, var_e13f4a25_80e3_f7f2_a729_20d6aee5d4ba);
  }
  var var_32c9179f_0614_11f8_bd1a_a0649c1d0667= new BehaviorInfo
  {
  BehaviorName = "Move To",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"translation", BehaviorModuleHelper.CreateBehaviorParameterOptions("1", false, "float")},
  {"rotation", BehaviorModuleHelper.CreateBehaviorParameterOptions("0", false, "float")},
  {"human", BehaviorModuleHelper.CreateBehaviorParameterOptions("1", false, "float")},
  {"dist", BehaviorModuleHelper.CreateBehaviorParameterOptions(1.50, false, "float")},
  {"x", BehaviorModuleHelper.CreateBehaviorParameterOptions(1.50, true, "float")},
  {"y", BehaviorModuleHelper.CreateBehaviorParameterOptions(0.0, true, "float")},
  {"theta", BehaviorModuleHelper.CreateBehaviorParameterOptions(0.0, true, "float")}
  }
  };

  if (context.RefreshApproachParameters(var_32c9179f_0614_11f8_bd1a_a0649c1d0667, trigger)) {
  BehaviorModuleHelper.Execute(context, var_32c9179f_0614_11f8_bd1a_a0649c1d0667);
  }
  var var_d2a5e02f_8c19_33cc_b240_3413036630d9= new BehaviorInfo{BehaviorName = "wish",RobotName = "Hiro"};

  BehaviorModuleHelper.Execute(context, var_d2a5e02f_8c19_33cc_b240_3413036630d9);
  var var_4330a2d9_5d64_7429_b18b_06083d44a70c= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("I am Nao! Welcome to Edo-Tokyo museum.", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_4330a2d9_5d64_7429_b18b_06083d44a70c);
  var var_dcbc2f6b_2259_fd93_8d04_797fa191107c= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("The Edo-Tokyo museum is a museum of the history of Tokyo during the Edo period", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_dcbc2f6b_2259_fd93_8d04_797fa191107c);
  var var_d6b52600_4ab0_f757_af15_6dd8587e5942= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("It was established in 1993", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_d6b52600_4ab0_f757_af15_6dd8587e5942);
  var var_22bdaaf8_a7e1_dca9_b981_f684fe9a8dc3= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("It has lifetime replica of the Nihonbashi, which was the bridge leading into Edo", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_22bdaaf8_a7e1_dca9_b981_f684fe9a8dc3);
  var var_6bb0f235_782b_5862_b6ac_80bd1345d345= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("It also has scaled down models of towns and building from the Edo, Meiji and Showa periods", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_6bb0f235_782b_5862_b6ac_80bd1345d345);
  var var_37cdbb14_89b3_3d26_a4a5_a1d9bc2ec861= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("The museum was designed by Kiyonori Kikutake", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_37cdbb14_89b3_3d26_a4a5_a1d9bc2ec861);
  var var_2c28ab2f_d8fa_9b1f_820e_bd3f802bf637= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("I hope you will enjoy your visit to Edo-Tokyo museum", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_2c28ab2f_d8fa_9b1f_820e_bd3f802bf637);
  var var_c76e0ccc_3577_ba62_9f4d_394436f0b6cc= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Have a nice day!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_c76e0ccc_3577_ba62_9f4d_394436f0b6cc);


            if (ExecutionLifetime == BehaviorExecutionLifetime.once)
            {
                CyclicActionsComplete = true;
            }
            else if (ExecutionLifetime == BehaviorExecutionLifetime.until)
            {
                var complete = ExecutionUntil(context);
                CyclicActionsComplete = !complete;
            }
        }
        return CyclicActionsComplete;
    }
    public void Execute(IBehaviorExecutionContext context)
    {
        // STARTUP_BLOCK
          var var_862fef01_d556_1537_a12a_be89ce762dfd = new List<Task>();
  var var_aca01bc5_b6ef_6c67_aa3c_f065ee993a92 = new Action( () =>
  {
    var var_3641a8a3_6179_2204_b150_d7359fe9260c= new BehaviorInfo{BehaviorName = "Greet",RobotName = "Hiro"};

    BehaviorModuleHelper.Execute(context, var_3641a8a3_6179_2204_b150_d7359fe9260c);

  });
  var var_853bcb58_acf7_ceb1_ab72_ee040ea19571 = new Action( () =>
  {
    var var_5ab5d4fd_7fe4_ff71_bc15_6f483055047c= new BehaviorInfo{BehaviorName = "Greet",RobotName = "Taro"};

    BehaviorModuleHelper.Execute(context, var_5ab5d4fd_7fe4_ff71_bc15_6f483055047c);

  });
  var_862fef01_d556_1537_a12a_be89ce762dfd.Add(Task.Run(var_aca01bc5_b6ef_6c67_aa3c_f065ee993a92));
  var_862fef01_d556_1537_a12a_be89ce762dfd.Add(Task.Run(var_853bcb58_acf7_ceb1_ab72_ee040ea19571));
  Task.WaitAll(var_862fef01_d556_1537_a12a_be89ce762dfd.ToArray());
  System.Console.WriteLine("Parallel action execution complete");var var_bf59f011_690d_eb2a_9701_a0bdf52ee6bd= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("I am Hiro", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_bf59f011_690d_eb2a_9701_a0bdf52ee6bd);
  var var_c01098b4_a9e2_468c_8b91_f8829c4d6fa3= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("And I am Taro", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_c01098b4_a9e2_468c_8b91_f8829c4d6fa3);
  var var_567e0153_ac87_6f4d_9b5d_bf0c1d2ddb8a= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("We want to introduce Indriya system. Taro, you want to start?", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_567e0153_ac87_6f4d_9b5d_bf0c1d2ddb8a);
  var var_ec1499f8_bafe_1869_a3da_24666d86581a= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Yes sure.", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_ec1499f8_bafe_1869_a3da_24666d86581a);
  var var_1c66ef30_587d_b0fa_8fc9_1078f8201e7f= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Indriya helps to design interaction scenario based on human behaviors", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_1c66ef30_587d_b0fa_8fc9_1078f8201e7f);
  var var_f3e0ffd0_259b_cec5_b455_c81c99bb5039= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("That's right! You can design program to respond to a gesture", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_f3e0ffd0_259b_cec5_b455_c81c99bb5039);
  var var_4eb698cb_6291_358a_b56d_7fe3c5a78cdf= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("And also to a voice command from the user", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_4eb698cb_6291_358a_b56d_7fe3c5a78cdf);
  var var_f119e276_0793_879e_80de_6ad27c0761d2= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("You can also program two robots operate in parallel", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_f119e276_0793_879e_80de_6ad27c0761d2);
  var var_62cddfa4_0f75_ef4a_8abe_531b414a056e= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("And finally you can design behaviors with priority", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_62cddfa4_0f75_ef4a_8abe_531b414a056e);
  var var_08335cda_77da_928e_8cc1_c80cc61c2753= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("If you want both of us to dance together, wave your right or left hand", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_08335cda_77da_928e_8cc1_c80cc61c2753);
  var var_8d75c052_b97a_1a4b_adea_5ab215014397= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Taro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("If you want to interrupt at any time, say STOP loudly", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_8d75c052_b97a_1a4b_adea_5ab215014397);

    }
    public bool ExecuteCyclic(IBehaviorExecutionContext context, TriggerResult trigger)
    {
        if (!CyclicActionsComplete && InitActionsComplete)
        {
            // CYCLIC_BLOCK
              var var_ebbaffde_15bc_9860_a6bf_509b6d6a59a6 = new List<Task>();
  var var_c9a06f4b_8778_dcec_bbc4_38221887afe2 = new Action( () =>
  {
    var var_58933fdd_5ef9_050e_8b8c_4bbd0c74246c= new BehaviorInfo{BehaviorName = "Dance",RobotName = "Hiro"};

    BehaviorModuleHelper.Execute(context, var_58933fdd_5ef9_050e_8b8c_4bbd0c74246c);

  });
  var var_b0843968_09f4_bf69_b462_30f80c3d6d92 = new Action( () =>
  {
    var var_73dea3ca_51c6_79be_8608_d6d0d2e3743b= new BehaviorInfo{BehaviorName = "Dance",RobotName = "Taro"};

    BehaviorModuleHelper.Execute(context, var_73dea3ca_51c6_79be_8608_d6d0d2e3743b);

  });
  var_ebbaffde_15bc_9860_a6bf_509b6d6a59a6.Add(Task.Run(var_c9a06f4b_8778_dcec_bbc4_38221887afe2));
  var_ebbaffde_15bc_9860_a6bf_509b6d6a59a6.Add(Task.Run(var_b0843968_09f4_bf69_b462_30f80c3d6d92));
  Task.WaitAll(var_ebbaffde_15bc_9860_a6bf_509b6d6a59a6.ToArray());
  System.Console.WriteLine("Parallel action execution complete");

            if (ExecutionLifetime == BehaviorExecutionLifetime.once)
            {
                CyclicActionsComplete = true;
            }
            else if (ExecutionLifetime == BehaviorExecutionLifetime.until)
            {
                var complete = ExecutionUntil(context);
                CyclicActionsComplete = !complete;
            }
        }
        return CyclicActionsComplete;
    }
Beispiel #15
0
    public bool ExecuteCyclic(IBehaviorExecutionContext context, TriggerResult trigger)
    {
        if (!CyclicActionsComplete && InitActionsComplete)
        {
            // CYCLIC_BLOCK
              if (count == 1) {
    var var_4cb4bb22_b20c_ffff_82d4_9a629b6d9712= string.Format("You have completed the exercise {0}  time!",count);
    var var_aab31148_d989_dbc4_99a9_607c437ff1f9= new BehaviorInfo
    {
    BehaviorName = "Say Expressively",
    RobotName = "Hiro",Parameters = new Dictionary<string, object>
    {
    {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions(var_4cb4bb22_b20c_ffff_82d4_9a629b6d9712, true, "string")},
    }
    };

    BehaviorModuleHelper.Execute(context, var_aab31148_d989_dbc4_99a9_607c437ff1f9);
  } else {
    var var_474e66e3_dfef_9670_b4a0_9dca1102d7ba= string.Format("You have completed the exercise {0}  times!",count);
    var var_64f27bb6_60e3_0d16_b68b_52c3ee3e11ed= new BehaviorInfo
    {
    BehaviorName = "Say Expressively",
    RobotName = "Hiro",Parameters = new Dictionary<string, object>
    {
    {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions(var_474e66e3_dfef_9670_b4a0_9dca1102d7ba, true, "string")},
    }
    };

    BehaviorModuleHelper.Execute(context, var_64f27bb6_60e3_0d16_b68b_52c3ee3e11ed);
  }



            if (ExecutionLifetime == BehaviorExecutionLifetime.once)
            {
                CyclicActionsComplete = true;
            }
            else if (ExecutionLifetime == BehaviorExecutionLifetime.until)
            {
                var complete = ExecutionUntil(context);
                CyclicActionsComplete = !complete;
            }
        }
        return CyclicActionsComplete;
    }
Beispiel #16
0
 public bool ExecuteExit(IBehaviorExecutionContext context, TriggerResult trigger)
 {
     if (!ExitActionsComplete && CyclicActionsComplete)
     {
         // EXIT_BLOCK
         // EXIT_BLOCK_HERE
         ExitActionsComplete = true;
     }
     return ExitActionsComplete;
 }
Beispiel #17
0
    public bool ExecuteCyclic(IBehaviorExecutionContext context, TriggerResult trigger)
    {
        if (!CyclicActionsComplete && InitActionsComplete)
        {
            // CYCLIC_BLOCK
            // CYCLIC_BLOCK_HERE

            if (ExecutionLifetime == BehaviorExecutionLifetime.once)
            {
                CyclicActionsComplete = true;
            }
            else if (ExecutionLifetime == BehaviorExecutionLifetime.until)
            {
                var complete = ExecutionUntil(context);
                CyclicActionsComplete = !complete;
            }
        }
        return CyclicActionsComplete;
    }
Beispiel #18
0
    public void Execute(IBehaviorExecutionContext context)
    {
        // EXIT_BLOCK
          var var_75eef517_3148_a1f8_9ac8_3401e951ac76= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("You did a great job today!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_75eef517_3148_a1f8_9ac8_3401e951ac76);
  var var_11dadac2_feb0_e652_9e9a_9aeded062c88= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("I am looking forward to guide you next time.", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_11dadac2_feb0_e652_9e9a_9aeded062c88);
  var var_57f046be_007c_da14_877a_07dc80a6e261= new BehaviorInfo
  {
  BehaviorName = "Say Expressively",
  RobotName = "Hiro",Parameters = new Dictionary<string, object>
  {
  {"msg", BehaviorModuleHelper.CreateBehaviorParameterOptions("Thank you and have a nice day!", true, "string")}
  }
  };

  BehaviorModuleHelper.Execute(context, var_57f046be_007c_da14_877a_07dc80a6e261);

    }
    public static TriggerResult CheckTrigger(IBehaviorExecutionContext context)
    {
        var result = new TriggerResult {Active = false};

        if (context != null && !ExecutionComplete)
        {
            var voiceCommand = context.GetVoiceCommand("STOP");
if (voiceCommand.Active && voiceCommand.Confidence > 80)
{
Console.WriteLine("Voice trigger received : {0} - {1}", voiceCommand.Name, voiceCommand.Confidence);
result.Active = true;
}

        }
        return result;
    }