ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Robot Localization: How to set velocity using a service?

asked 2019-03-08 16:08:18 -0500

gandhigauri gravatar image

Hi! I am using the robot localization pkg and my application requires to run multiple rosbags in a loop. The agent in all the bags does not necessarily start from 0 velocity. Is it possible to reset the velocity along with the pose every time there is a new bag encountered? Is it possible to have a rosservice to set the full state?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-19 06:33:41 -0500

Tom Moore gravatar image

Any time you set the pose, the non-pose variables should also get reset. This is the code for the setPoseCallback:

  1. Create a measurement that is the size of the entire state
  2. Zero it out
  3. Update only the pose portion to non-zero values
  4. Reset the filter state
edit flag offensive delete link more


Thanks Tom! Is there any way to set the non-pose portions to non-zero values?

gandhigauri gravatar image gandhigauri  ( 2019-03-19 13:46:22 -0500 )edit

Not right now, but it would be a straightforward change to add a set_state service that takes a nav_msgs/Odometry message instead, if you are so inclined.

Tom Moore gravatar image Tom Moore  ( 2019-03-20 02:46:27 -0500 )edit

Thanks Tom! I added the new service and that gives me the desired output.

gandhigauri gravatar image gandhigauri  ( 2019-03-20 13:25:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-03-08 16:08:18 -0500

Seen: 239 times

Last updated: Mar 19 '19