ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to write a motor controller driver?

asked 2014-09-04 16:28:27 -0600

anonymous user

Anonymous

Hi All,

I need to interface with Orion Robotics' RoboClaw motor controllers and so require some kind of driver. More info on the device here.

I will have several of them connected via USB and need to talk to them individually.

I would like to write the generic driver and create a new instance for each physical device.

I was thinking that I will need a node to run to maintain the connection to the device...? But should requests be received using services or messages?

Thanks for any help,

Chris.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2014-09-07 11:57:00 -0600

I recently wrote a python ROS node for Roboclaw that runs on Indigo. I'm cleaning it up for release but it didn't take too long to get a basic driver working with pyserial. My biggest issue has been read errors that sometimes need to trigger a reset of the port connection. You'll want to subscribe to a /cmd_vel topic with geometry_msgs/Twist message type to handle your linear and angular velocity commands, if that's suitable with your use case. I read encoder values and publish them on /odom for odometry.

Service calls would make sense if you want to change change PID parameters, voltage cutouts, etc.

edit flag offensive delete link more

Comments

Hello, I was just about doing the same thing. Do you plan to publish your work ? Using Twist messages sounds fine for a differential robot powered by the RoboClaw, but what about using it as a 2 independent motors controller ? Twist messages don't make that much sense here. What would you use ?

epascual gravatar image epascual  ( 2015-01-12 14:55:37 -0600 )edit

I am maintaining the roboclaw driver now, let me know if you have any problems with it. https://github.com/sonyccd/roboclaw_ros

sonyccd gravatar image sonyccd  ( 2016-03-21 07:43:32 -0600 )edit
2

answered 2014-09-05 19:21:21 -0600

SL Remy gravatar image

Setting the voltages and (possibly even) getting feedback from the Integrated dual quadrature decoders are tasks that make sense using topics (publishing and subscribing). If there are configuration changes (control options?) this seems to be a task that is reasonable for service calls.

edit flag offensive delete link more
1

answered 2014-09-05 18:46:37 -0600

tfoote gravatar image

It sounds like you're on the right track. Typically for anything which will be continuous streaming over a topic is recommended. Including controlling motors.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-09-04 16:28:27 -0600

Seen: 3,202 times

Last updated: Sep 07 '14