You are here

Getting a specified rpm via ROS node

2 posts / 0 new
Last post
Owl Robot
Offline
Last seen: 1 month 1 day ago
VESC Free
Joined: 2022-03-21 14:23
Posts: 1
Getting a specified rpm via ROS node

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?

x78163
Offline
Last seen: 3 weeks 1 day ago
Joined: 2022-06-08 17:03
Posts: 5

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?