Add service to reset odometry#564
Add service to reset odometry#564alcantara09 wants to merge 2 commits intoros-controls:melodic-develfrom
Conversation
matthew-reynolds
left a comment
There was a problem hiding this comment.
This looks reasonable, but I don't think we can accept it into ros1 since it will break ABI. I'm not sure how much of an issue ABI compatibility is when using pluginlib though... @bmagyar @ipa-mdl thoughts?
| #include <tf/tfMessage.h> | ||
| #include <std_srvs/Trigger.h> |
There was a problem hiding this comment.
Nit: Please alphabetize
a9d5c21 to
1231672
Compare
|
I have two points:
Additionally: services are generally not preferred for any deployment where you want to record/monitor the behaviour of the system. |
|
friendly ping, would be nice having this feature on melodic |
|
@alcantara09 @caioaamaral |
|
Hi @bmagyar, |
|
I want to know if this "reset odom" method is feasible. How should I use it to solve the problem? Can it be used on the Husky robot with Melodic? |
Why:
The odometry state relies on the assumption that the node that implements the controller_manager interface has the same life cycle as it. In other words is assumes that the internal state is zero and any incoming messages are due robot movement. However this is not true when restarting the nodes but not the actual physical system. In this case the first reading of encoder position will be the current encoder position of the controller, what will be interpreted as being a valid input and will generate a spike in velocity, moving the internal state to a position far way from the origin.
How:
This PR exposes a service to reset the odometry state of the diff_drive_controller. This allow us to reset the odometry in cases when you have to restart your system, but the actual controller is not resetted.
To overcome the initialization issue, the first reading of the controller will also be considered as an offset. This also ensures that no jump will occur when resetting the odometry state.