diff --git a/src/mocks/mock_bibi_configuration.bibi b/src/mocks/mock_bibi_configuration.bibi deleted file mode 100644 index 5cf47527e7fb56a7212b821f7912536609e11d0a..0000000000000000000000000000000000000000 --- a/src/mocks/mock_bibi_configuration.bibi +++ /dev/null @@ -1,15 +0,0 @@ -<ns1:bibi - xmlns:ns1="http://schemas.humanbrainproject.eu/SP10/2014/BIBI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ns1:brainModel> - <ns1:file>braitenberg.py</ns1:file> - <ns1:populations from="0" population="sensors" to="5" xsi:type="ns1:Range" /> - <ns1:populations from="5" population="actors" to="8" xsi:type="ns1:Range" /> - <ns1:populations from="0" population="record" to="8" xsi:type="ns1:Range" /> - </ns1:brainModel> - <ns1:bodyModel robotId="husky">husky_model/model.sdf</ns1:bodyModel> - <ns1:transferFunction src="all_neurons_spike_monitor.py" xsi:type="ns1:PythonTransferFunction" /> - <ns1:transferFunction src="left_wheel_neuron_rate_monitor.py" xsi:type="ns1:PythonTransferFunction" /> - <ns1:transferFunction src="linear_twist.py" xsi:type="ns1:PythonTransferFunction" /> - <ns1:transferFunction src="eye_sensor_transmit.py" xsi:type="ns1:PythonTransferFunction" /> -</ns1:bibi> \ No newline at end of file diff --git a/src/mocks/mock_experiment_configuration.exc b/src/mocks/mock_experiment_configuration.exc deleted file mode 100644 index c818ddfdf805b3f8ce72f84337db5b538a83bd0b..0000000000000000000000000000000000000000 --- a/src/mocks/mock_experiment_configuration.exc +++ /dev/null @@ -1,26 +0,0 @@ -<ExD - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://schemas.humanbrainproject.eu/SP10/2014/ExDConfig" xsi:schemaLocation="http://schemas.humanbrainproject.eu/SP10/2014/ExDConfig ../ExDConfFile.xsd"> - <name>Holodeck Husky Braitenberg experiment</name> - <thumbnail>ExDXMLExample.jpg</thumbnail> - <description>This experiment loads the Husky robot from Clearpath Robotics in the Holodeck environment. - If the user starts the experiment, the Braitenberg vehicle network is executed - and the robot will turn around itself in place, until the camera detects a red color. Then, - the robot will move towards the colored object. In this experiment, the user can interact - and change the color of both screens by clicking on them with the right mouse button.</description> - <tags>husky robotics holodeck braitenberg</tags> - <timeout>840</timeout> - <configuration type="3d-settings" src="ExDXMLExample.ini" /> - <configuration type="brainvisualizer" src="brainvisualizer.json" /> - <configuration type="user-interaction-settings" src="ExDXMLExample.uis" /> - <maturity>production</maturity> - <environmentModel src="virtual_room.sdf"> - <robotPose robotId="husky" x="0.0" y="0.0" z="0.5" roll="0.0" pitch="-0.0" yaw="3.14159265359" /> - </environmentModel> - <bibiConf src="bibi_configuration.bibi" /> - <cameraPose> - <cameraPosition x="5.056825994369357" y="-1.0210998541555323" z="2.697598759953974" /> - <cameraLookAt x="0" y="0" z="0.49999" /> - </cameraPose> - <cloneDate>2021-07-05T15:20:29</cloneDate> -</ExD> \ No newline at end of file diff --git a/src/mocks/mock_husky_event.json b/src/mocks/mock_husky_event.json deleted file mode 100644 index 89e1ad9cb985355da42a7619574084fd65ae3516..0000000000000000000000000000000000000000 --- a/src/mocks/mock_husky_event.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "webkitRelativePath": "./mock_experiment_configuration.exc", - "type": "exc" - }, - { - "webkitRelativePath": "./mock_bibi_configuration.bibi", - "type": "bibi" - } -] \ No newline at end of file diff --git a/src/services/experiments/execution/__tests__/running-simulation-service.test.js b/src/services/experiments/execution/__tests__/running-simulation-service.test.js index d93d97310c081ab0c30da23c0466b4985907a2de..12fc0bc083cc8f8ea88b41f1be446fc42d2e6dda 100644 --- a/src/services/experiments/execution/__tests__/running-simulation-service.test.js +++ b/src/services/experiments/execution/__tests__/running-simulation-service.test.js @@ -109,32 +109,32 @@ test('register for ROS status information', () => { }); let progressMessageCallback = jest.fn(); - // we register twice to check that original sub is destroyed and re-created without error + // we register twice to check that the original sub is conserved without error RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback); RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback); - expect(RoslibService.instance.getConnection.mock.calls.length).toBe(2); - expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(1); + expect(RoslibService.instance.getConnection.mock.calls.length).toBe(1); + expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(0); // send status update with task info let rosStatusData = { - progress: { - task: 'test-some-task', - subtask: 'test-some-subtask' - } + task: 'test-some-task', + subtask: 'test-some-subtask' }; statusUpdateCallback({ data: JSON.stringify(rosStatusData) }); expect(progressMessageCallback).toHaveBeenCalledWith({ - main: rosStatusData.progress.task, - sub: rosStatusData.progress.subtask + task: rosStatusData.task, + subtask: rosStatusData.subtask }); // send status update indicating we're done - rosStatusData.progress.done = true; + rosStatusData = { + done: true + } statusUpdateCallback({ data: JSON.stringify(rosStatusData) }); expect(progressMessageCallback).toHaveBeenCalledWith({ - main: 'Simulation initialized.' + done: true }); - expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(2); + expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(0); }); test('can retrieve the state of a simulation', async () => { diff --git a/src/services/experiments/execution/experiment-execution-service.js b/src/services/experiments/execution/experiment-execution-service.js index 54f01f6c885fc4e83afa7d2011f2715c906859d8..58f512d7206bc3584a2a1004a7ec43e7a9a44038 100644 --- a/src/services/experiments/execution/experiment-execution-service.js +++ b/src/services/experiments/execution/experiment-execution-service.js @@ -60,7 +60,6 @@ class ExperimentExecutionService extends HttpService { let brainProcesses = launchSingleMode ? 1 : experiment.configuration.brainProcesses; - //TODO: placeholder, register actual progress callback later let progressCallback = (msg) => { if (msg && msg.progress) { if (msg.progress.done) { diff --git a/src/services/experiments/execution/running-simulation-service.js b/src/services/experiments/execution/running-simulation-service.js index 49590e59742ef8619c01e60db8c6c9a1da149aaa..c4df84c6c573b09787157b9e2ecb2e2269e329a8 100644 --- a/src/services/experiments/execution/running-simulation-service.js +++ b/src/services/experiments/execution/running-simulation-service.js @@ -126,7 +126,6 @@ class SimulationService extends HttpService { // remove the progress bar callback only, unsubscribe terminates the rosbridge // connection for any other subscribers on the status topic - statusTopic.unsubscribe(); // fully disconnects rosbridge statusTopic.removeAllListeners(); rosStatusTopics.delete(rosbridgeWebsocket); }