Real-Time 3d Robotics UI (Python)

Click the link to view the code on GitHub:


Screen shot 2013-06-20 at 1.57.04 PMThis user interface is intended for real-time control of a robotic arm. It is written in Python for the internal game engine of the open source program called Blender. Features include:

  • Inverse Kinematics (with constrained joints and speed control).
  • Recording and playback of motion applied to the end-effector of the inverse kinematics solver.
  • Real-time generation and editing of (Bezier style) animation curves in 3d space.

Components such as generation of Bezier curve segments (with workable control handles), mouse-over detection, and camera orbiting and zooming were designed from scratch (by me). All involved calculations were implemented (ground-up) in Python. Intuitive drag-and-drop control is applied to areas like moving the end-effector, editing animation curve controls, and rotating/translating the camera in the scene.

Screen shot 2013-06-20 at 1.57.27 PMThe visual setting of the program is arranged so that a 3d robotic arm with a claw sits at the origin. A control object (visualized as a set of x/y/z axes) is placed at the tip of the claw. The user is able to grab the control object (click and drag) and move it to a new location in the 3d space. The arm uses inverse kinematics to follow the red cube (the end-effector of the IK solver) to its new location and touch the tip of the claw to the cube again.

Screen shot 2013-06-20 at 2.02.16 PM

Although the user is able to drag the cube (end-effector) as fast as they like, all joints are constrained to user-defined maximum speeds. Thus, when the user moves the control object, the arm will do its best to touch the cube again at its max speed, but max speeds will not be overridden or surpassed by the influence of the inverse kinematics solver (i.e. no snapping or jerking). These speed constraints prevent the program’s outputs from conflicting with the physical limitations of connected hardware (servos).

Screen shot 2013-06-20 at 1.59.58 PMThe user can also record key positions of the end-effector and play them back in sequence. The target is moved, keyed (using the keyboard), moved again, keyed, etc. As key positions are set, a Bezier animation curve (with control handles) is dynamically generated in 3d space between all keys. The end-effector can be snapped to the animation curve during playback of keys. All key positions and control handles can be manipulated using the mouse (drag and drop style), even during real-time playback.

Screen shot 2013-06-20 at 2.01.51 PM

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: