Controlling Robot in Python

Good evening,
I am looking into controlling my newly purchased SQ3 Symmetric Quadrapod (lynxmotion.com/p-885-symmetr … tudio.aspx) with Python.
Once I connect my computer to the Bluetooth module that it came with, how do I send commands to it? I looked at a guide, but it did not inform me of any required software. Do I need to import anything? Does anything need to be downloaded besides Python IDLE?

Is there any sample code available for controlling my quadrapod with Python?

Thanks,
Christopher Caligiuri

Hi Christopher,

Here are answers to your questions/comments:

The RB-Lyn-671 uses the older SSC-32 RB-Lyn-100] for controls of the motors and the Droid SAS Xbee board RB-Dro-03] & Bluetooth Bee RB-Dfr-95] pair for communication. Once you have the SSC-32 connected by Bluetooth to the DFR module and your computer connected to the USB dongle, simply pair the too to create a virtual serial port. How to access it depends on the OS & drivers, typically it will be a COM port under Windows and a file under Linux, Unix and OSX. For other platforms than those, please consult their documentation and support.

With both side of the Bluetooth channel connected to the SSC-32 and computer and the two modules paired properly, you simply need to access the “serial port” that is created by the Bluetooth pair.

Which guide did you look at. Please provide a URL to the guide in your reply. If the guide is quite big, make sure to mention which section(s)/chapter(s) are relevant.

To use serial ports in python, you probably want to use pySerial, as mentioned here.

We assume you mean IDE? Most people typically program Python in a text editor. Since the code is interpreted, it is easy to simple save a file and run the newly modified Python script using a keyboard. Of course, for larger software, an IDE might be helpful. You can find some online, such as a helpful comparison article here. But, for just starting out, you really only need a basic Python install and pySerial.

No, there is no Python code for the quadruped kits at this time. If you do end up finding or developing something that works, though (even if it is beta/prototype-ish), we’d be glad to have a look and add it to the Lynxmotion GitHub repositories! All the code we currently have available for quadrupeds is here.

We hope this helps.

Sincerely,

Thank you for the information; it is very helpful.

I used this guide: lynxmotion.com/images/html/b … tm#comform.
Are there any other instruction manuals or guides that you would recommend?

I will let you know if I have any additional questions when I work on this tonight.

Thanks again,
Christopher

Hi,

If you already have the Bluetooth / serial interface figured out then all that’s left is sending serial commands to the SSC-32 following the protocol guide.

All commands (as you may have noticed) are sent as ASCII strings to the SSC-32 and therefore should be simple to send easily in most programming languages/environments, Python included.

Also, since we discuss protocols, examples and Python, you may want to have a look at the two examples available here. They were both tested on a Raspberry Pi* connected to an SSC-32U**.

They are meant to control the Lynxmotion AL5 robotic arms, but they should serve as a reference/starting point to help getting you up and running.

Sincerely,

*: should work fine on a regular computer too, though, since Python is supported pretty much everywhere
**: protocol-wise, the two are basically identical and those examples should only use basic position commands, which are compatible with both the older and newer boards

Good evening,

The Bluetooth module that it came with does not support Mac OSX. Is the Bluetooth module required for proper communication and control of the robot or can I just connect directly to my MacBook?
It seems I am able to establish a connection but after about 10 seconds it disconnects. I have tried accessing the serial port (/dev/tty.Bluetooth_Bee_V2-DevB) during the brief time it is actually ‘connected’ to my laptop with no luck.
A couple questions: 1) What should the jumper configuration on the SSC-32 TX/RX and GND settings be? 2) What should I be using for the baud rate, I have tried both 9600 and 38400? 3) Any ideas on how I can keep the Bluetooth connection established between my MacBook and the Bluetooth BEE for longer than 10 seconds? 4) Is there any documentation describing the lights (colors/blinking/etc) on the DFR?

Thanks again for all of your help, it is very much appreciated!

Christopher

Hey,

That sounds most unfortunate, but somewhat not expected. Do you have any other details about what makes you suspect it to not be compatible? The more details you can provide about this, the higher the chance we can find a solution. In the meantime, we will contact the manufacturer of the module concerning this and see if there is any known issues or a fix for your situation and post again here when we have more details about this.

The SSC-32 can also be used by connecting it directly by the DE-9 RS-232 port, if your computer has one. If you do not have such a port, you can use a RS-232 to USB adapter (such as RB-Sha-14). We do know that less expensive adapters exists, but many of those have weird connectivity issues, typically due to using counterfeit chips. The RB-Sha-14 is the one we use internally for our own tests and did not have any issues with it up to now.

We assume this is also related to the first comment about OSX support for the module? If so, we’ll do our best and try to see why that is happening to you and how to resolve it.

You can see images of all the configurations in the SSC-32 manual here. The image in the fourth column, third row shows how to use the DE-9 connector for RS-232 interfacing with the SSC-32. To use that interface, those two jumpers need to be in place. Of course, you cannot use both the Bluetooth interface the the RS-232 at the same time.
As for “GND settings”, we are unsure what you mean. Please provide us more details about this in your reply.

Most Bluetooth modules are set to 9600 by default, so that is what we would recommend in this case to prevent compatibility and connectivity issues.

See the two answers above. This looks like a highly unusual situation.

All the information we currently have on the RB-Dfr-95 can be found on the product page. More specifically, you should have a look at the datasheet available under Useful Links for more details.

Sincerely,

Hi,
The Bluetooth module’s packaging says “Only Compatible With Windows.” Moreover, when I plug in the module to my computer, the light on the module but nothing occurs. When I look at my ports, it says that nothing is connected.
Is there another module that you can purchase for me that will work with OSX?

Thanks,
Christopher

Hi Christopher,

You are absolutely right. We came to the same conclusion rather quickly that it is most likely only compatible with Windows by default (without special drivers for OSX, which prob. do not exist).

We do have plenty of other Bluetooth devices, but here is a recommendation that may offer better results for you:

  1. If you wish to keep using the RB-Dfr-95, we would normally recommend using the following USB adapter: RB-Dfr-309. Unfortunately, the datasheet for this one specifies the following: “PC: Bluetooth Virtual Serial Port”, which seems to imply that there is no virtual serial port available on MAC drivers, which would basically cause the same issue that you already have.
  2. Alternatively, you could try this pair of Bee socket and USB dongle:

USB dongle: RB-Dfr-610; it actually specifies the following: “USB BLE - the LINK is the communication module based on Bluetooth 4.0. It uses a USB package which is compact and compatible with MAC & Windows. Now you could use this adapter to receive/transmit data”. This seems to be exactly what you would need.
Bluetooth BLE Bee: RB-Dfr-546, which would replace your RB-Dfr-95.

All of this considered, we’d also recommend to contact our support center here (choose exchanges & returns). In your message, please provide the following information:

]Your invoice or order number/:m]
]A link to this topic for reference/:m]
]Mention you would like your RB-Dfr-95/RB-All-10 exchanged with RB-Dfr-546/RB-Dfr-610 since you use a MAC and the ones that come with the kit are only compatible with Windows./:m]

We hope this helps!

Sincerely,

I tried testing the Bluetooth module on Windows. The Bluetooth module still lost connection after 10 seconds.
When I plug in the module, do I need to connect to the device differently? Currently, I am going to “Add New Device” in control panel and connecting to it that way.

If I want to order the part through customer service, can I do it this weekend after doing some more testing?
How long will it take to arrive?

Hi Christopher,

Concerning the Bluetooth module, it is rather bizarre that is also does the same issue on a Windows platform. For the exact procedure, it may differ depending on which version of Windows you are using. We recommend that you make a quick online search along the lines of “windows XYZ pair bluetooth module”, where XYZ is the version of windows you are using (XP, 7, 8, 10, etc.).

Assuming the parts are in stock when this is resolved, we typically ship the same day or very next morning. In this case, the delay really depends on where you are in the world and which shipping method is used. For more details about shipping delays, it would be best to contact our customer service.

You can do more testing first, that is completely fine. Just note the following two things: it is most likely too late for today for a new shipment. It would only ship on Monday regardless, since we do not ship packages outside of business hours. Secondly, if you do contact us outside of business hours, you will receive a reply the next open business day, in this case Monday morning (EDT).

Sincerely,