I bought a Roboclaw controller. Since then, have looked around for other. The software support seems to be the same (to me:sad) state.

They all seem to provide Arduino code examples, however, then I guess it's up to me to find / guess about the headers?

If I don't want to use python, and instead I want to use C / C++, how to best go about doing so for a Raspberry Pi?

It would just seem to me that if I spent maybe several hundred dollars on some hardware, it shouldn't be this hard to get some use out of it.

Am I missing something here?


I looked fast Roboclaw on Pololu and there was libraries for C++. For Rapsbery you just need the underlying Wiring level (or the part which is actually used) modified to connect to RPi to its GPIO pins.

(Arduino anything is C++ with Wiring library and all sources are able to download for free on Arduino site, libraries for special HW are provided by HW suppliers.)

BTW: about hunderds dollars HW usability - did you try get source for basic libraries for some smartphone? Not mentioned for modern PC with not obsolete graphic card ... the Arduino support is light years more opened and accessible.

  • $\begingroup$ yeah.. I'm "getting it" now... guess my ignorance to all this. --- doing USB for now. Seems to be working well for me so far. thanks $\endgroup$ – ecorrales May 29 '18 at 2:38

The Roboclaw documentation is excellent.

The PDF is available for download. I never even looked at a library for something that I could just use by following the manual. The RoboClaw is an extremely powerful motor controller. It isn't just an inexpensive board where you put PWM in and get voltage out. You can use many methods for controlling the motor. This is part of the reason for the expense.

I've almost always used control by usb or serial because I'm lazy. It worked just as the manual said it would. Unfortunately this was a few years ago and the computer I used is gone. In the next few months I'm going to have to do this again, and I'll probably publish a library for Gobot (a framework for robotics written in Go). Perhaps I'll write one in Java also.

There is Colin's library in C++ for ROS. It's freely available on Github, but it says it hasn't been fully tested.

SorcererX has a C library for Linux using serial. It's also on Github.

However, there are a lot of other libraries available for the RoboClaw. Ion Motion Control (the sellers of the RoboClaw) have multiple libaries. These are meant as examples. If you don't want to use python, then just translate it into c++. Or write your own given the information in the manual.

The biggest mistake I've seen with these modules is that people will often buy the controller based on normal motor current rather than stall current. This leads to melted controllers eventually.

  • $\begingroup$ thanks for the tips. I finally did start looking at Ion Motion's Arduino C++ code and I started writing my own base RoboClaw class (with the port system calls) , and also got a lot further (forget the source at the moment). That guy uses Boost for serial comms. Youre right about the PDF.. My mindframe was - why should I come up with a low-level software for something that expensive? when others use Raspberry? Getting used to the idea. Had checked out other motor controllers and the companies do the same - C++ Arduino code.. I will be checking out the links you suggested. $\endgroup$ – ecorrales May 29 '18 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.