Hello.
There are many ways you could do what you want to do. If the Maestro serial protocol is compatible with your gyro system’s protocol, the simplest plan is to set the Maestro’s serial mode to USB Chained and write a program that sends and receives bytes on the Maestro’s virtual serial port (specifically the Command Port, which is usually /dev/ttyACM0). Sometimes it would send and receive bytes from the gyro, and sometimes it would send Set Target commands to the Maestro to control the servos.
One disadvantage of this plan is that the speed at which you can send commands to the Maestro’s servos will be limited by the baud rate you use to communicate with the gyro. If that is an issue, you can use USB Dual Port mode instead.
Here are three resources that can help you:
- The “Writing PC Software to Control the Maestro” section in the Maestro User’s Guide
- The “Serial Interface” section in the Maestro User’s Guide.
- A post about Sending serial commands to the Maestro using the virtual COM port
Here are some other potentially useful resources, if you want to use libusb:
- A post about sending native USB commands to the Maestro using libusb
- A post about sending serial commands to the Maestro using libusb
I think it is possible to connect to the Maestro using libusb after you have opened one of the serial ports in Linux, but I’m not totally sure.
–David
