Control a Robotic Arm in Python

Control a Robotic Arm in Python

View the app user interface

With Dash DAQ, you can create your own virtual controls – completely in Python – to operate the Robotic Arm Edge. Dash DAQ’s GUI components let you interface with all the robot’s motors and LED, even from a mobile device… just as if it were a real remote control! 🤖

Check out our demo app and see how we did it below!

First, we import the following. Note the Dash DAQ and the Roboarm libraries:

The Robotic Arm Edge is controlled via a USB connection made by the manufacturer but sold separately. The Roboarm library allows us to connect the USB interface to the PC. It’s an awesome API that makes the Robotic Arm Edge easy to use. We use the code below to bridge a connection between the device and the PC.

Dash DAQ’s versatile UI components make the app layout a breeze to put together. Implementing the Dash DAQ Joystick components and labels with CSS is fun and easy.

Creating this application was super simple. The Dash DAQ Joystick component has two properties that change with its movement: force and angle.  The angle of the joystick controls how the robotic arm moves, by calling different functions from the Roboarm library. When the joystick is released, the force of the joystick is 0 by default. This calls the function that stops the movement by the robotic arm:

This application can be connected via WI-FI and controlled through a mobile device, allowing the user to operate multiple joysticks for more complex movement. If you’d like to do this, simply modify your app.run_server() to be like the code below. Then, turn off your firewall and enter your IP address into your mobile browser. Please ensure you are in a protected and safe network before you do this!

This app is a simple example of the possibilities Dash DAQ offers. Dash DAQ makes it easy and fun to create an interactive GUI to control all sorts of hardware.

Play with this app online, or purchase a Dash DAQ license to get the full source code for this app and the others!