Using a topic subscription inside a cpp hardware interface plugin

I am trying to use a topic subscription inside a hardware interface plugin code, for reading the status of the wheels, I am doing everything as per documentation but the subscription callback never gets called.

Maybe because the plugin doesn’t get executed as a normal node, although I am inheriting the rclcpp::Node class and using its functions.

Based on this post it can be done using executers but I couldn’t figure out how…

Hi, although I’d say much of creating a hardware interface with ROS 2 control falls outside this course, what that post is talking about is using multi-threaded executors, which means that you can have more than one callback function without them blocking each other. This could be the reason your subscription callback never gets called.

Unit 5 of the course deals with this topic, I recommend going through it and then see if it can help.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.