Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, timn/clips-agent has been updated
        to  a703a0b53d15de1dbf63e48277b6b08f98d5a5c6 (commit)
      from  8c813828ee32610a262653d357b23443d8ab4cf2 (commit)

http://git.fawkesrobotics.org/fawkes.git/timn/clips-agent

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit a703a0b53d15de1dbf63e48277b6b08f98d5a5c6
Author:     Tim Niemueller <niemuel...@kbsg.rwth-aachen.de>
AuthorDate: Mon Jan 14 15:41:28 2013 +0100
Commit:     Tim Niemueller <niemuel...@kbsg.rwth-aachen.de>
CommitDate: Mon Jan 14 15:41:28 2013 +0100

    clips-agent: do not open skiller interface in sim mode
    
    Do neither open skiller interface nor try to acquire exclusive skiller
    control in sim mode. This allows to run the agent completely without the
    skiller.

http://git.fawkesrobotics.org/fawkes.git/commit/a703a0b
http://trac.fawkesrobotics.org/changeset/a703a0b

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/plugins/clips-agent/clips_agent_thread.cpp |   51 +++++++++++++-----------
 1 files changed, 28 insertions(+), 23 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* a703a0b53d15de1dbf63e48277b6b08f98d5a5c6 - - - - - - - - - -
Author:  Tim Niemueller <niemuel...@kbsg.rwth-aachen.de>
Date:    Mon Jan 14 15:41:28 2013 +0100
Subject: clips-agent: do not open skiller interface in sim mode

 src/plugins/clips-agent/clips_agent_thread.cpp |   51 +++++++++++++-----------
 1 files changed, 28 insertions(+), 23 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-agent/clips_agent_thread.cpp 
b/src/plugins/clips-agent/clips_agent_thread.cpp
index af059e6..74399fa 100644
--- a/src/plugins/clips-agent/clips_agent_thread.cpp
+++ b/src/plugins/clips-agent/clips_agent_thread.cpp
@@ -50,6 +50,8 @@ ClipsAgentThread::~ClipsAgentThread()
 void
 ClipsAgentThread::init()
 {
+  skiller_if_ = NULL;
+
   cfg_auto_start_ = false;
   cfg_assert_time_each_loop_ = false;
   cfg_skill_sim_time_ = 2.0;
@@ -71,15 +73,17 @@ ClipsAgentThread::init()
 
   cfg_clips_dir_ = std::string(SRCDIR) + "/clips/";
 
-  skiller_if_ = blackboard->open_for_reading<SkillerInterface>("Skiller");
+  if (! cfg_skill_sim_) {
+    skiller_if_ = blackboard->open_for_reading<SkillerInterface>("Skiller");
 
-  if (! skiller_if_->has_writer()) {
-    blackboard->close(skiller_if_);
-    throw Exception("Skiller has no writer, aborting");
-    
-  } else if (skiller_if_->exclusive_controller() != 0) {
-    blackboard->close(skiller_if_);
-    throw Exception("Skiller already has a different exclusive controller");
+    if (! skiller_if_->has_writer()) {
+      blackboard->close(skiller_if_);
+      throw Exception("Skiller has no writer, aborting");
+      
+    } else if (skiller_if_->exclusive_controller() != 0) {
+      blackboard->close(skiller_if_);
+      throw Exception("Skiller already has a different exclusive controller");
+    }
   }
 
   switch_if_ = blackboard->open_for_reading<SwitchInterface>("Clips Agent 
Start");
@@ -128,21 +132,22 @@ ClipsAgentThread::finalize()
 void
 ClipsAgentThread::loop()
 {
-  skiller_if_->read();
-
-  if (! cfg_skill_sim_ &&
-      (skiller_if_->exclusive_controller() == 0) && skiller_if_->has_writer())
-  {
-    if (ctrl_recheck_) {
-      logger->log_info(name(), "Acquiring exclusive skiller control");
-      SkillerInterface::AcquireControlMessage *msg =
-        new SkillerInterface::AcquireControlMessage();
-      skiller_if_->msgq_enqueue(msg);
-      ctrl_recheck_ = false;
-    } else {
-      ctrl_recheck_ = true;
+  if (! cfg_skill_sim_) {
+    skiller_if_->read();
+
+    if ((skiller_if_->exclusive_controller() == 0) && 
skiller_if_->has_writer())
+    {
+      if (ctrl_recheck_) {
+       logger->log_info(name(), "Acquiring exclusive skiller control");
+       SkillerInterface::AcquireControlMessage *msg =
+         new SkillerInterface::AcquireControlMessage();
+       skiller_if_->msgq_enqueue(msg);
+       ctrl_recheck_ = false;
+      } else {
+       ctrl_recheck_ = true;
+      }
+      return;
     }
-    return;
   }
 
   if (! started_) {
@@ -162,7 +167,7 @@ ClipsAgentThread::loop()
 
   Time now(clock);
   if (! active_skills_.empty()) {
-    skiller_if_->read();
+    if (! cfg_skill_sim_)  skiller_if_->read();
 
     std::list<std::string> finished_skills;
     std::map<std::string, SkillExecInfo>::iterator as;




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org
_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to