From 6addab4f197bb6c97500d01a7d828c767d9d6cd2 Mon Sep 17 00:00:00 2001
From: Florent Lamiraux <florent@laas.fr>
Date: Thu, 22 Oct 2020 12:52:28 +0000
Subject: [PATCH] [SotLoaderBasic] parseOptions does not call initialization
 anymore.

  - initialization() should be called after initializeRosNode() since the
    former stores ROS parameter "/robot_description" in
    sot::sgl_map_name_to_robot_util (sot/tools/robot-utils.cpp), while the
    second sends the python prologue to the interpreter, and the prologue
    needs the parameter server to contain key "/robot_description".
---
 src/geometric_simu.cpp   | 4 ++++
 src/sot_loader_basic.cpp | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/geometric_simu.cpp b/src/geometric_simu.cpp
index ec6c1af..f6f7225 100644
--- a/src/geometric_simu.cpp
+++ b/src/geometric_simu.cpp
@@ -21,7 +21,11 @@ int main(int argc, char *argv[]) {
   SotLoader aSotLoader;
   if (aSotLoader.parseOptions(argc, argv) < 0) return -1;
 
+  // Advertize service "(start|stop)_dynamic_graph" and
+  // load parameter "robot_description in SoT.
   aSotLoader.initializeRosNode(argc, argv);
+  // Load dynamic library and run python prologue.
+  aSotLoader.Initialization();
 
   ros::waitForShutdown ();
   return 0;
diff --git a/src/sot_loader_basic.cpp b/src/sot_loader_basic.cpp
index 16a95a4..1b3024f 100644
--- a/src/sot_loader_basic.cpp
+++ b/src/sot_loader_basic.cpp
@@ -129,7 +129,6 @@ int SotLoaderBasic::parseOptions(int argc, char* argv[]) {
   } else
     dynamicLibraryName_ = vm_["input-file"].as<string>();
 
-  Initialization();
   return 0;
 }
 
-- 
GitLab