Control Loop and Communication Loop Synchronization (sep. nodes)
Hello, everyone,
My goal: I would like to find a standard way to allow control loops to be developed separately from the CAN communication. This would allow for easy interfacing with the hand without considering the communication. If this seems impossible, or would take more work than it is worth, please advise.
Background: I am currently building a ROS stack to accompany a 16 DOF robotic hand sold by my company. Packages within currently handle CAN communication and provide some demo control code.
I would like to implement a CAN communication node which publishes raw data (in this case encoder values) and subscribes to torque commands.
In a separate node, I would like to implement a controller that subscribes to the encoder readings and publishes the control torque values. Currently I'm running into problems because the loops do not run at the exact same frequency (333.33Hz, off by about 0.1Hz max).
I am new to ROS, so I have not yet learned some of the more sophisticated practices.
Thank you for your support.