0
$\begingroup$

Rosanswers logo

Hi,

I am running a simulation with jackal. I am performing some tests where I ask the jackal to run a certain distance, stop and return to (0,0). When I try to set the pose of the jackal in the odometry frame to (0,0), using /set_pose, the pose does not get reset. For example, after the robot moves for a distance of 10m, the position is (10.503, -0.0001). I want to have the robot's odometry position to be (0,0) and starting counting is position again from (0,0).

In other words, I want to be able to erase the sensor data from the odometry source in ROS for each run, so that for every run it can start as it does at startup. Is that possible through some parameters?

Please help. Regards, rsmitha.


Originally posted by rsmitha on ROS Answers with karma: 43 on 2017-04-22

Post score: 0


Original comments

Comment by Humpelstilzchen on 2017-04-24:
Suggestion: You could set the target pose in robots base frame instead odom, that is always relative to current position.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi,

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 !! Regards, rsmitha.


Originally posted by rsmitha with karma: 43 on 2017-04-27

This answer was ACCEPTED on the original site

Post score: 0


Original comments

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:
Hi,

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!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.