CKBot Software Interface ======================== The CKBot software interface developed at ModLab (http://modlabupenn.org) provides a convient means for programming a CKBot modular robot using (primarily) the Python programming language. Status ------ This is the first public release of the interface. Although we have tested the code on both ubuntu Linux Lucid and Windows 7, expect this to be beta software. All comments and feedback are greatly appreciated. Overview -------- There are two main interfaces of interest to users: the ckbot.logical.Cluster class, and the JoyApp application framework. The former provides a programming interface for a cluster of modules connected to a single bus; the latter provides a complete application framework based on pygame for controlling a robot from a computer, possibly using one or more game controllers. JoyApp also provides a bridge to the Scratch visual programming environment, allowing kids and non-programmers to control a robot through visual programming constructs. Many examples for using the JoyApp framework have been provided in the demos directory. Files ----- Core components ~~~~~~~~~~~~~~~ joy.py : JoyApp framework and Plan classes scratch.py : interface classes for communication with Scratch ckbot/can.py : low-level interface classes ckbot/logical.py : main interface classes Configuration files ~~~~~~~~~~~~~~~~~~~ JoyApp.yml : default configuration file (YAML format) for JoyApp applications od_names.txt : name table of Object Dictionary entries Tutorial Demos ~~~~~~~~~~~~~~ demos/demo-stickFilter.py : Using a StickFilter plan to read joystick events and provide velocity control or filtered signals. demos/demo-multiClick.py : Using a MultiClick plan to detect multi-button or multi-key gestures. demos/demo-plans.sb : Scratch 'client' used for several demos -- cat sprite moves around under control of the catX and catY sensors, that are written to by the python code. demos/M4ModLab.csv demos/demo-simpleGaitCyclePlan.py : Read a 'gait' from M4ModLab.csv and send it to Scratch demo-plans to be plotted out. demos/shave.csv demos/haircut.csv demos/demo-shavenhaircut.py : Demonstrate how Plan behaviors can be used in parallel and/or as components of other plans. Also demostrates how property specification strings can be used to control output bindings of a Plan -- to debug messages, Scratch demo-plans or actual robot modules. Complete Robot Controllers ~~~~~~~~~~~~~~~~~~~~~~~~~~ demos/demo-arm.py : Control a multi-segment planar arm with a gripper. The arm controller is encapsulated in a Plan subclass, allowing it to be easily copied into other JoyApp applications. This also allows multiple arms to be controlled by having multiple instances of the arm Plan with different bindings. demos/inchworm.csv demos/demo-makeInchwormCSV.py demos/demo-inchworm.py : Inchworm gait for a 5-module "worm", combined with a "joystick control" mode which allows control of the individual degrees of freedom. Tools ~~~~~ ckbot/gui.py : wxPython based GUI for editing node properties botscan.py : tool for scanning which robot nodes are on the bus demos/demo-calibPlan.py : tool for module calibration (DEVELOPER USE ONLY) demos/demo-scratchBridge.sb demos/demo-scratchBridge.py : bridge application allowing all modules properties to be controlled from Scratch, and associated Scratch project demostrating how this is used. demos/demo-settingRecords.py : record module poses to a CSV file. Only works with ver 1.3 modules. See [beta0.1-nofeedback] in release notes. canudp/can2udp : low-level CAN sniffer (converts to UDP packets, also allows hex-dumping) Additional Demos ~~~~~~~~~~~~~~~~ demos/demo-sheetPlan.py : A sequential (non-cyclic) gait table is a SheetPlan. demos/demo-cyclePlan.py : A CyclePlan is a cyclic gait that is not specified in tabular form. Instead it is a collection of function calls tied to specific phases. demos/demo-dof-selector.py : A tool allowing dozens of DOF to be controlled from the game controller in position mode. Each single button selects a net set of bindings. Multi-button gestures are used to configure the program. demos/demo-gaitCyclePlan.py : A more advanced gait-cycle demo allowing frequency to be changed. demos/demo-joyToScratch.py demos/demo-joyToScratch.sb : Controlling a Scratch sprite by moving a robot joint (Only works with ver 1.3 modules. See [beta0.1-nofeedback] in release notes.) demos/demo-scratchMyBot.py demos/demo-scratchMyBot.sb : Controlling a robot module by moving a Scratch object Internals ~~~~~~~~~ canudp/can2udp.c : CAN to UDP bridge source code canudp/README-can2udp : documentation of CAN to UDP bridge canudp/sockit.h : utility functions for UDP sockets ckbot/ ckbot/__init__.py : CKBot interface package ckbot/pcanopener.py : interface generator; creates pcan.py from c library headers ckbot/pcan_abstract.py ckbot/pcan_linux.py ckbot/pcan_win.py ckbot/pcan.py : auto-generated interface to the local PCAN library ckbot/rb.py : low-level robotics bus functions ckbot/resolver.py : code for using od_names.txt test_joy.py : tests of the JoyApp functionality (DEVELOPER USE ONLY) License ------- This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. The library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.