Skip to content
Snippets Groups Projects
Commit dc3101db authored by Detailleur's avatar Detailleur
Browse files

[NRRPLT-8288] useless mock files deleted, running-simulation-service test corrected

parent 6209bb04
No related branches found
No related tags found
No related merge requests found
<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
<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
[
{
"webkitRelativePath": "./mock_experiment_configuration.exc",
"type": "exc"
},
{
"webkitRelativePath": "./mock_bibi_configuration.bibi",
"type": "bibi"
}
]
\ No newline at end of file
......@@ -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 () => {
......
......@@ -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) {
......
......@@ -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);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment