From 2da57d09833a6040d45a52f29a29f30adf56127c Mon Sep 17 00:00:00 2001
From: lguyot <luc.guyot@epfl.ch>
Date: Thu, 31 May 2018 17:05:04 +0200
Subject: [PATCH] [NRRPLT-6557] - Implements the (missing) method
 _create_robot_adapters - Changes NRP_MODELS_DIRECTORY into NRP_SIMULATION_DIR
 as required

Change-Id: I94a3e6efde1627d1d2099da91ae84819046ceafb
---
 .../launch/DistributedNestProcess.py                     | 9 +++++++++
 .../hbp_nrp_distributed_nest/launch/NestBrainProcess.py  | 4 ++--
 .../hbp_nrp_music_interface/launch/MUSICCLEProcess.py    | 9 +++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedNestProcess.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedNestProcess.py
index a487d12..62a860a 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedNestProcess.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/DistributedNestProcess.py
@@ -34,6 +34,7 @@ import hbp_nrp_cle.brainsim.pynn_nest # pylint: disable=unused-import
 import logging
 
 from hbp_nrp_cleserver.server.CLEGazeboSimulationAssembly import CLEGazeboSimulationAssembly
+from hbp_nrp_cleserver.server.ServerConfigurations import robot_gazebo_ros_adapters
 from hbp_nrp_distributed_nest.cle.DistributedPyNNCommunicationAdapter \
        import DistributedPyNNCommunicationAdapter
 from hbp_nrp_distributed_nest.cle.DistributedPyNNControlAdapter \
@@ -61,6 +62,14 @@ class DistributedCLESimulationAssembly(CLEGazeboSimulationAssembly):
         """
         super(DistributedCLESimulationAssembly, self).__init__(sim_id, exc, bibi_model, **par)
 
+    def _create_robot_adapters(self):
+        """
+        Creates the adapter components for the robot side
+
+        :return: A tuple of the communication and control adapter for the robot side
+        """
+        return robot_gazebo_ros_adapters()
+
     def _create_brain_adapters(self):
         """
         Creates the adapter components for the neural simulator
diff --git a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
index a94e1cf..72dad3d 100644
--- a/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
+++ b/hbp_nrp_distributed_nest/hbp_nrp_distributed_nest/launch/NestBrainProcess.py
@@ -72,9 +72,9 @@ class NestBrainProcess(object):
         pop_dict = get_all_neurons_as_dict(self._bibi.brainModel.populations)
 
         # load the models path on this node and set absolute bibi path
-        models_path = os.environ.get('NRP_MODELS_DIRECTORY')
+        models_path = os.environ.get('NRP_SIMULATION_DIR')
         if models_path is None:
-            raise Exception("Unable to determine bibi path, NRP_MODELS_DIRECTORY is not "
+            raise Exception("Unable to determine bibi path, NRP_SIMULATION_DIR is not "
                             "defined on target node!")
         brain_file = os.path.join(models_path, self._bibi.brainModel.file)
 
diff --git a/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICCLEProcess.py b/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICCLEProcess.py
index 4b26c5a..cb149af 100644
--- a/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICCLEProcess.py
+++ b/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICCLEProcess.py
@@ -29,6 +29,7 @@ import logging
 import sys
 
 from hbp_nrp_cleserver.server.CLEGazeboSimulationAssembly import CLEGazeboSimulationAssembly
+from hbp_nrp_cleserver.server.ServerConfigurations import robot_gazebo_ros_adapters
 from hbp_nrp_music_interface.cle.MUSICPyNNCommunicationAdapter import MUSICPyNNCommunicationAdapter
 from hbp_nrp_music_interface.cle.MUSICPyNNControlAdapter import MUSICPyNNControlAdapter
 
@@ -56,6 +57,14 @@ class MusicCLESimulationAssembly(CLEGazeboSimulationAssembly):
         """
         super(MusicCLESimulationAssembly, self).__init__(sim_id, exc, bibi_model, **par)
 
+    def _create_robot_adapters(self):
+        """
+        Creates the adapter components for the robot side
+
+        :return: A tuple of the communication and control adapter for the robot side
+        """
+        return robot_gazebo_ros_adapters()
+
     def _create_brain_adapters(self):
         """
         Creates the adapter components for the neural simulator
-- 
GitLab