[Newbie] Any tips on how to restart world and my .py statemachine simultaneously?

asked 2021-01-12 09:43:46 -0500

Manipulator gravatar image

When testing my different state-machines I want to restart my tests quickly. That means turning off my state-machine process and restarting my world. When I run my simulations I have three processes in three seperate terminal windows open. One launches my world and models, one launches my controller and the last one launches my state-machine of choice. As of now I use the command line to restart my world and I use CTRL+C on my state-machine, which will sometimes take upwards of 10 seconds to escaleate to SIGKILL before turning off.

Does any of you guys know a convenient way to instantly restart world and .py state-machine with the press of a single button? Right now I'm thinking of creating a publisher/node(?) that sends a message to a subscriber which then calls reset_world and sends a SIGKILL to my state-machine. I am new to ROS, Gazebo and Linux and would greatly appreciate a push in the right direction.

Thank you.

edit retag flag offensive close merge delete