Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Action START has no effect #32

Open
dmronga opened this issue Apr 24, 2018 · 6 comments
Open

Control Action START has no effect #32

dmronga opened this issue Apr 24, 2018 · 6 comments

Comments

@dmronga
Copy link
Contributor

dmronga commented Apr 24, 2018

Hi,

me again. Still using Rock/Mars master on Ubuntu 16.04. When I send the value PAUSE on the control_action input port of the Mars Task, the simulation pauses. But then, when I send START it does not start again, but keeps being paused. Am I missing something or is there something wrong with the method startStopTrigger() used here

simulatorInterface->startStopTrigger();
?

Best,
Dennis

@planthaber
Copy link
Member

Hi, looks like the bug is withing the Mars:
https://github.com/rock-simulation/mars/blob/master/sim/src/core/Simulator.cpp#L470
The state is not set to Stopped there.

But the Simulator also has these methods directly:

virtual void StartSimulation() = 0;
virtual void StopSimulation() = 0;

so perhaps it would be better to use them.

@planthaber
Copy link
Member

rock-simulation/mars#83

@malter
Copy link
Member

malter commented Apr 24, 2018

The simulation status is changed to stopped in the simulation thread after the current processed simulation step ends. If this is not happening, a simulation plugin might blocks the thread. Maybe one of the orogen MARS plugins is not returning from the update call?

@malter
Copy link
Member

malter commented Apr 24, 2018

Maybe the status is set but the simulation is not waking up, you can try to add
stepping_wc.wakeAll(); in line 471 of the simulation/mars/sim/src/core/Simulator.cpp

@dmronga
Copy link
Contributor Author

dmronga commented Apr 24, 2018

@planthaber I already tried that and it works for me.

But I don' t know if using StartSimulation() / StopSimulation() directly in the Mars orogen component might have some unintended side effects. E.g. when I sent PAUSE, RESET and START quickly after each other, the Mars component crashed after I applied this change.

@malter
Copy link
Member

malter commented Apr 27, 2018

I added the wakeAll() call in the develop branch of MARS. Did it solve your problem? If not, there must be something blocking the simulation thread, and I will spend a closer look into your specific setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants