[Fawkes Git] branch/fzwilling/jaco-better-error-message: created (0.5.0-3368-gf94a1fe)

Frederik Zwilling zwilling at kbsg.rwth-aachen.de
Thu Nov 17 17:24:06 CET 2016


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, fzwilling/jaco-better-error-message has been created
        at  f94a1fe6e5f4fd422d83d274d0ee668fa140d398 (commit)

http://git.fawkesrobotics.org/fawkes.git/fzwilling/jaco-better-error-message

- *Log* ---------------------------------------------------------------
commit f94a1fe6e5f4fd422d83d274d0ee668fa140d398
Author:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
AuthorDate: Thu Nov 17 17:21:49 2016 +0100
Commit:     Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
CommitDate: Thu Nov 17 17:23:37 2016 +0100

    jaco: better exception message when jaco name is wrong

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

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


- *Summary* -----------------------------------------------------------


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

- *commit* f94a1fe6e5f4fd422d83d274d0ee668fa140d398 - - - - - - - - - -
Author:  Frederik Zwilling <zwilling at kbsg.rwth-aachen.de>
Date:    Thu Nov 17 17:21:49 2016 +0100
Subject: jaco: better exception message when jaco name is wrong

 src/plugins/jaco/arm_kindrv.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/jaco/arm_kindrv.cpp b/src/plugins/jaco/arm_kindrv.cpp
index 609ecab..eafeef7 100644
--- a/src/plugins/jaco/arm_kindrv.cpp
+++ b/src/plugins/jaco/arm_kindrv.cpp
@@ -52,6 +52,8 @@ JacoArmKindrv::JacoArmKindrv(const char *name)
   // trim tailing whitespaces
   __name.erase(__name.find_last_not_of(" ")+1);
 
+  std::string found_names = "'" + __name + "'";
+
   if( name!=NULL ) {
     // Check all connected arms until the right one is found.
     std::vector<KinDrv::JacoArm*> arms;
@@ -61,6 +63,7 @@ JacoArmKindrv::JacoArmKindrv(const char *name)
         __arm = new KinDrv::JacoArm();
         __name = __arm->get_client_config(true).name;
         __name.erase(__name.find_last_not_of(" ")+1);
+        found_names += ", '" + __name + "'";
       } catch(KinDrvException& e) {
         // don't throw yet, we need to delete the occupied arms first.
         __arm = NULL;
@@ -75,7 +78,9 @@ JacoArmKindrv::JacoArmKindrv(const char *name)
   }
 
   if( __arm==NULL )
-    throw fawkes::Exception("Could not connect to Jaco arm with libkindrv");
+  {
+    throw fawkes::Exception("Could not connect to Jaco arm '%s' with libkindrv. But I found the following arms: %s", name, found_names.c_str());
+  }
 
   __initialized = false;
   __final = true;




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list