Skip to content

Commit

Permalink
Added IBA Files
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zechmair committed Dec 18, 2019
1 parent ec63f39 commit 64f790e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from hbp_nrp_commons.sim_config.SimConfig import ResourceType
from hbp_nrp_commons.workspace.SimUtil import SimUtil
from hbp_nrp_cleserver.server.GazeboSimulationAssembly import GazeboSimulationAssembly
from hbp_nrp_cle.externalsim.ExternalModuleManager import ExternalModuleManager
from hbp_nrp_commons.ZipUtil import ZipUtil

# These imports start NEST.
Expand Down Expand Up @@ -121,10 +122,14 @@ def _initialize(self, except_hook):
# load the brain
braincontrol, braincomm, brainfile, brainconf = self._load_brain()

#load external modules
externalmodulearray = ExternalModuleManager()

# initialize the cle server and services
logger.info("Preparing CLE Server")
self.cle_server.cle = self.__load_cle(robotcontrol, robotcomm, braincontrol, braincomm,
brainfile, brainconf, robot_poses, models, lights)
brainfile, brainconf, externalmodulearray,
robot_poses, models, lights)
self.cle_server.prepare_simulation(except_hook)

# load transfer functions
Expand Down Expand Up @@ -344,7 +349,7 @@ def _create_brain_adapters(self): # pragma: no cover

# pylint: disable=too-many-arguments
def __load_cle(self, roscontrol, roscomm, braincontrol, braincomm,
brain_file_path, neurons_config,
brain_file_path, neurons_config, externalmodulearray,
robot_poses, models, lights):
"""
Load the ClosedLoopEngine and initializes all interfaces
Expand Down Expand Up @@ -380,9 +385,9 @@ def __load_cle(self, roscontrol, roscomm, braincontrol, braincomm,
# initialize CLE
self._notify("Initializing CLE")

cle = DeterministicClosedLoopEngine(roscontrol, roscomm,
braincontrol, braincomm,
tfmanager, timestep)
cle = DeterministicClosedLoopEngine(roscontrol, roscomm, braincontrol,
braincomm, tfmanager,
externalmodulearray, timestep)

if brain_file_path:
cle.initialize(brain_file_path, **neurons_config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from hbp_nrp_cleserver.server.CLEGazeboSimulationAssembly import CLEGazeboSimulationAssembly
from hbp_nrp_cleserver.server.LuganoVizClusterGazebo import XvfbXvnError
from hbp_nrp_cle.mocks.robotsim import MockRobotControlAdapter, MockRobotCommunicationAdapter
from hbp_nrp_cle.mocks.externalsim.MockExternalModuleManager import MockExternalModuleManager
import hbp_nrp_cle.tf_framework as tfm
from hbp_nrp_cle.robotsim.RobotManager import Robot
from hbp_nrp_commons.MockUtil import MockUtil
Expand Down Expand Up @@ -81,6 +82,8 @@ class SomeWeirdTFException(Exception):
@patch("hbp_nrp_cleserver.server.CLEGazeboSimulationAssembly.os.listdir", new=Mock(return_value=[]))
@patch("hbp_nrp_cleserver.server.GazeboSimulationAssembly.rospy", new=MagicMock())
@patch("hbp_nrp_cleserver.server.GazeboSimulationAssembly.rosnode", new=MagicMock())
@patch("hbp_nrp_cleserver.server.CLEGazeboSimulationAssembly.ExternalModuleManager", new=MockExternalModuleManager)

class TestCLELauncherInit(unittest.TestCase):

@patch("hbp_nrp_cleserver.server.GazeboSimulationAssembly.LocalGazeboServerInstance")
Expand Down

0 comments on commit 64f790e

Please sign in to comment.