diff --git a/examples/showcase/README.md b/examples/showcase/README.md new file mode 100644 index 0000000..b4e9a13 --- /dev/null +++ b/examples/showcase/README.md @@ -0,0 +1,26 @@ +# Yukon Micropython Showcase Examples + +This folder contains a collection of *Showcase* examples, that bring together concepts presented by individual board and module examples to create functional projects. + +- [RC Rover](#rc-rover) +- [Spider Tank](#spider-tank) + + +## RC Rover +[rover/main.py](rover/main.py) + +A showcase of Yukon as a differential drive rover. It uses two Big Motor modules, one to control the left side motors, and the other to control the right side motors. + +There is a LED Strip module controlling left and right strips that represent each side's speed as a colour from green -> blue -> red. Additionally, there is a proto module wired up to a buzzer to alert the user to the battery voltage getting too low, which also exposes the UART for connection to a bluetooth serial transceiver. + +The program receives commands from the JoyBTCommander Android App and converts them to motor speeds. it also sends the voltage, current, and temperature of Yukon back to the App. + + +## Spider Tank +[spidertank/main.py](spidertank/main.py) + +A showcase of Yukon as a hexapod robot, with 3 degrees of freedom per leg. It uses two Serial Bus Servo modules, one to control the left side servos, and the other to control the right side servos. + +There is also a proto module wired up to a buzzer to alert the user to the battery voltage getting too low. + +The program performs inverse kinematics for each leg, with the target points following a tripod walking gait. diff --git a/examples/showcase/spidertank/lib/leg_ik.py b/examples/showcase/spidertank/lib/leg_ik.py index 77dd130..f0b561a 100644 --- a/examples/showcase/spidertank/lib/leg_ik.py +++ b/examples/showcase/spidertank/lib/leg_ik.py @@ -5,6 +5,21 @@ import math from collections import namedtuple +""" +This file contains a collection of classes and functions for performing +the inverse kinematics (IK) of a 3 degree of freedom robot leg. + +The central class of this implementation is Vector3, which is used to store +3D coordinates. The axes of these coordinates follow the left hand rule: +* X = right/left +* Y = up/down +* Z = forward/back + +This IK implementation is derived from understandings gained by +Christopher "ZodiusInfuser" Parrott, during the development of: +https://github.com/ZodiusInfuser/TrueWalkSimulator +""" + Limits = namedtuple("Limits", ("min", "max")) diff --git a/examples/showcase/spidertank/main.py b/examples/showcase/spidertank/main.py index 6389433..b62b941 100644 --- a/examples/showcase/spidertank/main.py +++ b/examples/showcase/spidertank/main.py @@ -12,12 +12,15 @@ from leg_ik import Vector3, calculate_ik_3dof, Limits, rotate_y """ -This is a showcase of how Yukon can be used to drive a 3 degree of freedom hexapod robot. +A showcase of Yukon as a hexapod robot, with 3 degrees of freedom per leg. It uses two Serial Bus Servo modules, one to control the left side servos, and the other to control the right side servos. -There is also a proto module wired up to a buzzer to alert the user to the battery -voltage getting too low. +There is also a proto module wired up to a buzzer to alert the user to the +battery voltage getting too low. + +The program performs inverse kinematics for each leg, with the target +points following a tripod walking gait. Press "Boot/User" to exit the program, only if the buzzer is not sounding. If the buzzer sounds, disconnect power as soon as possible!