Just to close the issue and inform others of the methods, if anyone else has the same requirements and are looking for answers:
I managed to reset the simulation, odom frame and the "ground-truth" (in this case, gazebo world frame) and get the odometry to forget its collected data and start from (0,0) for every iteration of the runs, by writing a bash script to cycle through the runs.
The bash script restarts the simulation in a separate terminal and launches the application using rosrun in another terminal.
The gazebo topics such as "gazebo/reset_simulation" and "gazebo/reset_world" only seem to reset the pose of the robot in simulation. The word "reset" in these topics seems to be misleading because the rest of the factors/parameters such as odometry/sensor states do not get re-initialised with reset. In order to reset practically everything, ROS has to be stopped and restarted and there is no clean way to do this from within the application.
The bash script seems to be the cleaner approach. Apart from this, there are methods where the launch files can be written to do the stop and start. However, if tests where multiple runs are being performed are being executed, the launch files would still need to be controlled from bash scripts or another application.
Hope this helps !!
Originally posted by rsmitha with karma: 43 on 2017-04-27
This answer was ACCEPTED on the original site
Post score: 0
Comment by rsmitha on 2017-04-27:
Cant accept my own answer :)
Comment by Vignesh_93 on 2021-03-19:
Is it possible to create a service to reset the sensor readings ? Not sure if that still lies in the tangibility without tampering the sensor.
Comment by Sid05 on 2022-05-24:
Can you maybe also put the bash script here ?
Or any pointers on how to write a bash script of my own ?
Thanks in advance!