# Spot-Micro-Control-and-Animation
Inverse Kinematics based control and animation of Spotmicro developped in Python for Raspeberry Pi
This first version is a "simulator" of Spot Micro that runs under Python 3 and requires the Pygame Library in order to display animation and use the xbox one (or any similar) controller. I developped it with on a Raspberry Pi 4 but it runs successfully also on a Windows 10 PC.
The SW does not include any function to control the servos PWM. I chose to do so as this part is very dependent on the HW set-up (type of µC board, servos type, ...)
However, the SW includes all the functions that enable Spot Micro to walk, sit, give the paws, lie, twist and even lift the hind leg...
All these features are based upon Inverse Kinematics.
* In the main program Spot_Micro_Control_v01.py:
-Line 57 to 72: set-up of the XBOX One (or similar) controller. You can use the attached utility Essai_Joystick_01.py to identify the parameters.
-Line 565: This is the best place where you could place the call to your own servo control function.
Based upon the paws to body position, the Inverse Kinematics functions calculates 4 sets of 3 angles (x shoulder, y shoulder, y elbow/knee): thetalf, thetarf, thetarr, thetalr:
-lf: left front leg
-rf : right front leg
-rr : right rear leg
-lr : left rear leg
I expect that it is not necessary to understand exactly how the SW works providing that finally only these generated angles are necessary to control Spot Micro.
When adapting to your own servos, please pay attention to zero setting of the servos and the tuning of the angles range so that actual angles correspond to the calculated ones.
I attached a pdf file that gives some details about how inverse kinematics is built-up and correspondance between calculated angles and servos angles.
Attached Libraries:
* Spotmicro_Inverse_Kinematics_and_Position_Library_v01.py: This file contains a class of paramaters and functions to calculate Spot micro position. It includes:
-The main dimensions of Spot micro
-The center of gravity position and weight of each spotmicro limbs and body
-The forward kinematics function
-The forward kinematics functions
-The function that generates walking positions
-The function that generates positions from known start and end positionsThis library contains a class of functions to calculate the center of gravity position
and distance to the support polygon edge
* Spotmicro_Gravity_Center_Library_v01.py: This file contains a class of functions to calculate the center of gravity position and distance to the support polygon edge
* Spotmicro_Animation_Library_v01.py:
This file contains a class of functions to generate the animation frames
Please make sure that all these files are located in the same folder.
* Essai_Joystick_01.py: This utility was copied from https://www.pygame.org/docs/ref/joystick.html. It is helpfull to identify the controller / joystick parameters
I will release soon a full version corresponding to my HW for information or for persons willing to apply the same of very close set-up.
Actual S/W includes the control of IMU, voltage sensor, LCD display and ultrasonic range sensors
It also includes features in order to toggle animation display and servos motion. This is very usefull to test movements prior to apply them in real life.
I connect to the Raspberry Pi with VNC viewer through Wifi (and sometimes LAN Cable).
My own Spot Micro version uses:
-Raspberry Pi 4
-PCA9685 shield (I2c) modified in order to separate servos power supply (6V) and 5V logic supply
-12 x 30 kg.cm servos
-MPU 6050 (I2c) IMU
-ADS 1015 (I2c) for voltage measurement (with a simpe resistors voltage divider)
-2x16 characters LCD display (I2c)
-2 HC-SR04 untrasonic range sensors
-20 A SBEC supply (servos) set at 6V
-5 A SBEC supply for the RPi and shields logic circuits
-2S 4000 mAh LiPo Battery
I hope you will enjoy playing with this software and build-up your own walking Spot Micro !
Arnaud Villeneuve
December 2020
好家伙VCC
- 粉丝: 2331
- 资源: 9142
最新资源
- 散装物料卸船机step全套技术开发资料100%好用.zip
- MSS市场专项考试题库
- (174756810)跨年烟花代码python
- (175424836)JSP企业电子投票系统(源代码+论文+开题报告+外文翻译+文献综述).rar
- (175470002)JSP企业电子投票系统(源代码+论文+开题报告+外文翻译+文献综述)
- (175759628)贪吃蛇.zip
- (175833246)JSP企业电子投票系统(源代码+论文+开题报告+外文翻译+文献综述).rar.tar.gz
- 自行车、汽车、猫、狗、人类、入侵者检测39-YOLO(v5至v11)、COCO数据集合集.rar
- (175860660)基于51单片机直流电压电流表设计LCD1602液晶实训仿真
- (175931624)基于jsp的投票管理系统源码数据库论文.doc
- 在ARM9核心板KNM1001上实现uIP FTP及TFTP客户端
- (176056440)zotero 插件分享 茉莉花压缩包
- Overview of the Scalable Video Coding Extension of the H.264/AVC Standard
- 汽车之家计量学分析.zip
- (176074624)EPLAN P8部件库:包含低压电气控制系统设计常用品Pai型号 导入单个文件很小几十M,简单易用
- (176333852)《数据库原理及应用教程(微课版)》关系数据库思维导图源文件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈