Skip to content
Snippets Groups Projects
Commit df968c06 authored by Viktor Vorobev's avatar Viktor Vorobev
Browse files

Merged in NRRPLT-8629-error-when-trying-to-determi (pull request #151)

NRRPLT-8629 error when trying to determine the timeout left

Approved-by: Ugo Albanese
parent 96a6bd2b
No related branches found
No related tags found
No related merge requests found
...@@ -37,4 +37,4 @@ bibi_configuration.xsd ...@@ -37,4 +37,4 @@ bibi_configuration.xsd
ExDConfFile.xsd ExDConfFile.xsd
environment_model_configuration.xsd environment_model_configuration.xsd
robot_model_configuration.xsd robot_model_configuration.xsd
.vscode .vscode
\ No newline at end of file
...@@ -188,13 +188,12 @@ class SimulationServer(object): ...@@ -188,13 +188,12 @@ class SimulationServer(object):
logger.warning( logger.warning(
"Trying to publish state even though no simulation is active") "Trying to publish state even though no simulation is active")
return return
if self.timeout_type == TimeoutType.REAL: self.get_remaining()
self.get_remaining()
message = self._create_state_message() message = self._create_state_message()
message['simulationTime'] = int(self.simulation_time) message['simulationTime'] = int(self.simulation_time)
message['timeout_type'] = self.timeout_type message['timeout_type'] = self.timeout_type
message['state'] = self.__lifecycle.state message['state'] = self.__lifecycle.state
message['timeout'] = self.__remaining message['timeout'] = self.__remaining_time
logger.debug(json.dumps(message)) logger.debug(json.dumps(message))
self._notificator.publish_state(json.dumps(message)) self._notificator.publish_state(json.dumps(message))
# pylint: disable=broad-except # pylint: disable=broad-except
...@@ -217,9 +216,9 @@ class SimulationServer(object): ...@@ -217,9 +216,9 @@ class SimulationServer(object):
if remaining <= 1e-8: # it is not 0 due to a numeric precision issue if remaining <= 1e-8: # it is not 0 due to a numeric precision issue
self.__lifecycle.stopped(in_loop=True) self.__lifecycle.stopped(in_loop=True)
self.__remaining = max(0, int(remaining)) self.__remaining_time = max(0, int(remaining))
else: else:
self.__remaining = 0 self.__remaining_time = 0
def shutdown(self): def shutdown(self):
""" """
......
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