Asked
Resolved Resolved by Athena AI!

Roboclaw Packet Serial Comm

Has anyone written a skill or script that will support the RoboClaw Packet Serial Mode communications? Specificly, a skill/script that can set the motor speed, direction, and read the encoder using the CRC16 check defined by Motion Control for use with their RoboClaw Solo 30A motor controller?


Related Hardware EZ-B IoTiny

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

PRO
Synthiam
#25  

Okay - i'll take a look at the library and make something for you. Stay tuned

PRO
USA
#26  

Looking forward to seeing it and learning from what you do.  Thank you very much !

PRO
Synthiam
#27  

Ugh, I'm torn on how to implement this with the least effort. They could have done a better job at providing libraries for serial and USB together. You see, the Arduino library is the only one that does serial communication to the roboclaw. The Python and c# libraries use USB, not serial/uart. It appears that they were expecting you to only communicate via serial if using an Arduino. But if you're limited only to Arduino, the robot cannot do much unless you use the Arduino as an intermediate controller between the RobotClaw and EZB/PC.

C# Library -> USB Python Library -> USB Arduino Library -> Serial/UART

The dilemma I'm up against is that if I spend a bunch of time implementing a robot skill for USB, then it'll require twice as much effort to implement the UART version on top of that. So, I need to figure out a few things without spending too much time on it.

Even loading the Python library into ARC won't work because you'll still be limited to a USB connection.

PRO
Synthiam
#28   — Edited

Okay, I have a proposed solution for separating communication ability between the libraries that causes a disconnect of limiting USB and Serial connectivity together. The only library that seems easiest to manipulate is the Arduino library. I will port the C++ Arduino library to c# and create a dynamic class using a communication stream.

The stream could then be assigned to a serial/usb or ezb uart. That way, it'll be dynamic for either communication type. And because of that, we'll be able to create robot skills using the available commands in the library. I also have a new ControlCommand utility that generates commands based on public methods of a class. So we can have the entire new roboclaw library available as a ControlCommand to experiment with. That will provide enough flexibility to understand the commands necessary to build a robot skill that does what you want.

C++ and C# are close enough that it doesn't take too long. The challenge is that enums are referenced differently, so that's a lot of copying and pasting. Also, variable types are different as well. And small formatting things, precisely variable arguments for methods.

PRO
USA
#29   — Edited

That sounds like a fantastic solution! I can’t wait to see it in action. I did not realize the C# and Python libraries were limited to USB. That’s really limited and would not work in my case since I don’t have USB available in the robot’s waist. I hope it doesn't take up too much of your time, but I sure there are a lot of people who would benefit from this work. Having another motor controller (especially as powerful as the RoboClaws) is a great addition to ARC.

In the meantime, I have a working Arduino library version running on the ESP32 board. The difference is that I use the ARC software to send serial text commands to the ESP32, which then reads the command (and any parameters needed) and then calls the RoboClaw Arduino functions which then send the serial command to the motor controller. There is no c# code on the ARC side to build skills with. So it is harder to be able to provide it to others (since it is a modified version of your ESP32/EZB firmware, also limits it to ESP32 cards).

Your version would be a more efficient way to go, plus being able to build robot skills for others to use is great.

PRO
USA
#30  

@DJSures, How's the Roboclaw port coming along?  Is this going to require an ARC update?

PRO
Synthiam
#31  

Should have something soon. Because I’m approaching this skill a bit differently, it’s dependent on something we had been working on for the ControlCommand engine. It’s going to expose their library methods so you can use what’s needed.

We have another ARC update with new stuff in a few days that’s dependent on it as well.

PRO
USA
#32  

@DJSures, I'm curioius as to how the Roboclaw port coming along? I'm thinking of using a second one in my B9 robot, that's why I'm asking. I'm not trying to add presure to you or your team, just wondering. This second Roboclaw setup would replace the Sabertooth/Kangaroo setup I currently have, which is troublesome and limited in the number of turns I can do.