I'm trying to send a specified rpm to a VESC controller using a ROS node in python. I was able to listen over the canbus while commanding RPM in the VESC Tool and tried to copy their messages. Right now I have the node make an OS call using os.system("cansend can0 {0}".format(command) where the command is "00000-insert motor id in hex-#020008-insert RPM in hex". I have it sending messages at a rate of 10hz. This seems to work for the most part but it fails when I need to stop the robot. It seems to coast to a stop when I send 0 RPM instead of braking. It also doesn't try to maintain 0 RPM and will roll down hills when it's being commanded to 0. I don't have position controls but my motor does have hall sensors so it should be able to tell it's rolling and correct due to the PID loop. Is there a better way to control RPM?
Wow! That's awesome! Aside from the whole problem. I've been looking for a good tutorial/resource on how to address each motor independently via an external source (ROS, etc). Could you point me to what resources you used?