Working code for computing odometry from decoder ticks
We're building our own robot and are at the point where we're debugging our python code which receives decoder ticks and generate odometry messages. There are no shortage of examples on GitHub and google; the problem is that your mileage may vary.
I'm wondering whether there's a ros.org tested, generally accepted version of this code. It seems like it's a few pages of somewhat intricate code but extremely standardized in the case of differential drive robots. There are a few parameters (wheel diameter, wheel spacing, what else?) and the rest is "just math", Being "intricate" there's lots of room for a greater than being switched for a less than or off by one errors, overflow etc. So I am looking for actual working code, debugged and mainstream. I gotta believe it's out there but I've not been able to find it.
My go-to would be the diff_drive_controller of
ros_control
, but I'm not sure whether you'd be comfortable creating ahardware_interface
for your robot.@gvdhoorn comes through again! By the way, I guess vdhoorn is van der hoorn from which is guess that you are in the Netherlands...?
But back to the point. This looks like exactly the direction I was looking for. I don't see mention of hardware_interface in the linked page though. I see this: https://github.com/ros-controls/ros_c... . Is that what you were referring to?
Yes.
All
ros_control
controllers are used with ahardware_interface
.I find the explanations for how to write a hardware_interface not sufficient without reading all its code. I am looking for something with more explanations?
I'm not aware of any more extensive documentation about this.
I'd suggest to lookup some examples of such
hardware_interface
s. There are a nr of Q&As on this site about the same topic, and you could take a look at code for Clearpath Husky, Jackal and more recent robots. Thediff_drive_controller
page lists a few more robots using this, and the Used By section of the Package Links box on the same wiki page has a few more.This seems highly relevant: https://github.com/PickNikRobotics/ro...