I am a happy user of the Trex Jr combined with the USB input module and am now planning to use the Jrk (excellent that you put them together like this- I always thought it was silly that I had to buy two separate items to get what I needed running).
I would like to command the Jrk directly through the USB. I see all the serial protocol information in the user’s manual and I assume I use a virtual COMM port to connect to the Jrk and send/receive info. However, I am building a bit of a complex set up with Robotis motors already being controlled via USB and their Dynamixel communication code combined with my C++ code (that already runs). Robotis requires changes to the FTDI COMM port settings. I am also planning to do some analog and digital I/O using a Labjack U3 on USB as well (I have used these for some time now and have had good success with their programming interface).
So now adding the Jrk gives me three entirely different systems all talking via USB. The other two come with nice libraries (including all the source code) to make it simple to communicate with them while the Jrk appears to be bare metal, i.e. I have to put together the low level serial communications using the info in the manual.
So here is my question: Is there a communication library available from Pololu and I just missed it on your website ? If not, is the source code for the config utility available since that would pretty much cover everything I’d need anyhow.
These really are nicely integrated units you are making. I just don’t want to fiddle with the low level serial communications if I can at all help it.
BTW, having every USB device want to install its own USB drivers gives me the willies at times. I have had issues with different versions of FTDI drivers being installed and breaking other devices as well as the Robotis COMM mods causing problems for other devices. I hope your drivers play nice with all the others I have installed now (obviously I haven’t gotten to bringing your controller up yet to find out).
I installed the Jrk software and can drive a motor using speed control mode using the Jrk Configuration program while at the same time commanding Robotis motors using their Dynamixel Manager program. I also fired up the Labjack test app can could talk to it with both of these running as well. So obviously you can mix controllers on USB that are all talking to different virtual serial ports at once. So that part is encouraging-- looks like I can mix them in my own program.
Now if Pololu can hopefully supply sample code (C or C++ please…) for programming the Jrk, I will be good. Otherwise, I will have to do the low level stuff as I mentioned in the previous message
We definitely understand the advantages of using a real USB interface instead of through the virtual COM port, and we are working on putting together a version of the jrk interface library that we can release. It is going to be in C# and cross-platform, with a version using Winusb.dll (that’s the way the jrk configuration utility is currently built) and another linking to linux’s libusb via a very simple library.
I think I can send you some kind of library in a day or two, if you are willing to deal with poor documentation and not much of a build process. Would this kind of thing be useful to you? If nothing else, you should be able to browse code to find the exact USB commands to use if you want to write your own code to interface to it.
I just noticed that you were specifically asking for C/C++. I should clarify that the C# that we use is really just arranged to send parameters to functions in system C libraries, so using that as an example to write your own C code should be trivial.
Sorry for taking so much time to do this! I have sent each of you a PM with a pre-release version of the code - it is not ready to be put up on our web site, but I want you guys to be able to start trying it out and see if you can make any sense of it. How about you post your questions about the code to this thread so we can get a discussion going in a single place?
You are welcome to use the code for whatever you like, but we ask that you credit us if you use it in your work, for example with a link back to www.pololu.com.
We don’t have a C or C++ version of the Jrk library. However, it is definitely possible to control the jrk from a C or C++ program using either the native USB interface or the virtual COM port. Here is the part of the Pololu USB SDK README file that explains those two options a little more:
If you’re using Windows, then you are probably better off using the Virtual COM port because WinUSB and SetupAPI are pretty tricky to figure out. If you are using Linux, you should probably use libusb because you get the advantages of using the native USB interface, and libusb is easy to work with.