I start the launch file. Everything is running. Then I for example want to end the process. So I stop it. If now I want to start everything again I have to first reset the Arduino that it will start at the initialisation procedure (the beginning of the Arduino code) and then launch the launchfile. If I would not reset in between, everything gets screwed up.
You were answered correctly in reply #1.
Actually, it is a little more complex. Essentially you have no actual setup() code - it is empty.
Your loop() now comprises three parts - your old setup() code, and a new "while" loop which contains all your old loop() code and is keyed on the condition for that code to continue. After that in the old loop() comes another "while" loop with the test for a restart which when permitted lets the actual loop() to return to the beginning and perform again the actual "setup" code and start the main process again.
The criteria for the two "whiles" are the "run/ stop" for your main process, and the key for a new reset. Your outer loop now contains the overall
"start --> run --> stop --> wait --> reset"cycle.