Ask Your Question

Revision history [back]

It really shouldn't be any different for ROS1 or ROS2 -- the math is the exact same. Its just about using the ROS2 version of the ROS1 toolset to publish that information. Your code sample looks about right -- you need to take your wheel ticks / speed and convert them into relative motion.

You should look at the ROS2 tutorials, there is still a bunch of things that are not converted to ROS2 yet (e.x. anything with namespace ros::), you're not properly name spacing the messages, you're using the TF1 API, etc. All of these things are covered with the basic ROS2 tutorials. I'd drop this task for a couple of days and learn that stuff first and then revisit it once you're more familiar with ROS2.