Fun with PWM
0.32
|
AllMyServos is a robotics app for Raspberry Pi, written in Python, to help it interface with:
The app provides a user friendly interface for configuration, a command line version for running over SSH and now supports headless operation. To get started, make sure the directory which contains this file is copied to the SD card of your Raspberry Pi, open a terminal, change to this directory and run 'sudo python GUI.py'
For more information visit:
AllMyServos has been tested with:
OS Versions:
Open a terminal on a Raspberry Pi and run the following commands:
git clone https://github.com/allmyservos/allmyservos.git
cd allmyservos
sudo python GUI.py
The first time the application runs, it performs some initial setup checks. Any problems can be resolved by clicking the accept button at the bottom of the page.
The camera module provides a user interface for all of the available settings on the Pi camera. see: TkCameraManager.TkCameraManager
The console provides a copy of anything output to the terminal in the app. see: TkConsole.TkConsole
Where parts of the app require packages to be installed, the app provides a user interface to install them all with a single click. see: TkDependencyManager.TkDependencyManager
The help section provides information about using the app. see: TkHelpManager.TkHelpManager
An Inertial Measuring Unit is a combined gyroscope and accelerometer. The app provides a suite of tools for managing and testing a connected IMU.
see:
The joystick module provides a service which registers USB or Bluetooth joysticks / gamepads as they are connected. Other objects can add a callback function which will be executed when a joystick action happens. The configure page displays all detected joysticks and their axis / buttons maps. see: TkJoystickManager.TkJoystickManager
The keyboard module provides a user interface for configuring keymaps. These are used to trigger motions or chains when keys are pressed. It also allows other modules to plugin and perform any action when a key is pressed. see: TkKeyboardManager.TkKeyboardManager
Parts of the application require measurements to be taken. Metrics can be used like variables but they can retain previous values in memory and archive them according to the time the value was set. see: TkMetricManager.TkMetricManager
When the servo configuration is complete, motions can be created which orchestrate the angles of the servos over time. see: TkMotionManager.TkMotionManager
The DC motor module provides support for several motor driver boards. Each motor reserves a set of GPIO pins on the Raspberry Pi for use with a drive board. Motors have a drive state which controls the speed and direction of the motor by setting a value between -1 and 1. The DC motor module is also integrated with the Keyboard and Joystick module. see: TkMotorManager.TkMotorManager
Stepper motors can also be connected to the Raspberry Pi using Dual H Bridge motor driver boards. These boards allow 4 input wires (from the Pi GPIO) and 4 output wires from a stepper motor to be connected. Sending a HIGH signal from a GPIO pin will cause the motor driver to energize a coil in the stepper motor with a particulary polarity. This turns the stepper motor to align with that coil. AllMyServos allows stepper motors to be configured by providing the steps per revolution and maximum revolutions per minute (normally available on the stepper motor datasheet). As with DC motors, AllMyServos allows the speed and direction of the motor to be changed by setting the drive state (-1 to 1). When editing a stepper motor, this can be done using a slider. The angle of the stepper motor is tracked by AllMyServos allowing the motor to turn to a given angle.
see: TkMotorManager.TkMotorManager
The notifier allows modules to push messages to the interface which will be displayed for at least 10 seconds before being removed. see: TkNotifier.TkNotifier
Pre flight checks are performed before any modules are loaded to ensure that the essential configuration changes have been made to enable I2C which is required to work with servos. see: TkPreFlightManager.TkPreFlightManager
The resource manager provides a user interface for monitoring system resources. see: TkResourceManager.TkResourceManager
Threaded tasks can be run on their own schedule and managed using the provided user interface. see: TkScheduleManager.TkScheduleManager
Servos are a core feature of the application. These objects represent servos connected to the Adafruit PCA9685 servo driver. see: TkServoGrid.TkServoGrid
The Setting object can be referred to anywhere a script imports it. Settings are accessed statically using Setting.get() and Setting.set('setting_name',default), the class uses SQLite to check if a value exists, if not the default value is saved. Use the menu: 'Settings' -> 'List Settings' to see any stored settings and modify their values. For example: 'motion_slow_factor' is an integer which controls how many times slower to play slow motions. Simply delete a setting to restore its default value. see: TkSettingManager.TkSettingManager
Specifications provide a way of keeping all of the information about a robot together. These can be packaged up in the application and shared as a single file. see: TkSpecificationManager.TkSpecificationManager
One method of communicating with All My Servos is using Remote Procedure Calls. The app provides a server with built in SSL support and authentication to securely accept requests from RPC clients. see: TkRPCManager.TkRPCManager
The system section of the app provides a user interface for checking information about the environment and managing the startup settings. see: TkSystemManager.TkSystemManager
When either the GUI or CLI is run, the app will attempt to add a status icon to the LXDE taskbar if it is available. see: TrayIcon.TrayIcon