reinitialize a publisher node in ROS C++
hello everyone,
Can someone help me to reinitialize a publisher node in ROS. In fact I want to start to publish data departing from initial values ( data will be modified of course) and I want after a period of time to reinitialize the data in order to take the initial values. Thanks everyone for your help.
Sincerely. Hamza
Asked by Hamza on 2018-10-09 09:53:57 UTC
Comments
you talk about data published to a topic? What you could do is store the data published in a rosbag file and keep them for reuse. and then start the node a again with the same initial values
Asked by MasterTsoutsos on 2018-10-09 10:11:16 UTC
Thank you for your quick response, In fact My problem is as follow: I have a robot fixed at (X0,Y0) initially and then will move. My node publish the new position X and position Y. After a while, i want to reinitialize my node without shutting it down and my robot come back to initial position X0 Y0
Asked by Hamza on 2018-10-09 10:35:09 UTC
What are you actually doing ? Navigating a robot ? You can just store the intial values and if you can determine when is "after a while" you can set the new goal to the values you have sotred.
Asked by Delb on 2018-10-10 02:09:55 UTC
Thank you for your reply. I'm trying to control a follower rover which must follow the leader while always staying at a safe distance from it. That's why, I need to test a configuration of control parameters and then try to reinitialize my node. this will be done many times.
Asked by Hamza on 2018-10-10 04:04:13 UTC
You can write a function that would be called when you need to reinitialize everything that send a goal to the init pose and clear whatever you need to be cleared.
Asked by Delb on 2018-10-10 04:11:59 UTC