双轴机器臂建模

做者:卓晴博士,清华大学自动化系
更新时间:2020-08-18 Tuesday
 

 

01运动数据采集


1.肩关节运动

▲ 肩关节运动

▲ 肩关节运动

▲ 肩关节角度

▲ 肩关节角度

2.肘关节运动

▲ 肘关节运动

▲ 肘关节运动

▲ 肘关节角度变化

▲ 肘关节角度变化

 

※ CODE


#!/usr/local/bin/python
# -*- coding: gbk -*-
#============================================================
# TEST1.PY -- by Dr. ZhuoQing 2020-08-18
#
# Note:
#============================================================
from headm import *
from tsmodule.tsstm32       import *
stm32cmd("CLEAR")
stm32cmd('step2 -1000')
time.sleep(0.01)
stm32cmd('showa2 400')
time.sleep(6)
val = stm32memo(1)
angle = val[0:-1]
costtime = val[-1]
timedim = linspace(0, costtime/1000, len(angle), endpoint=True)
tspsavenew('measure2', t=timedim, angle=angle)
plt.plot(timedim, angle)
plt.xlabel("Time(s)")
plt.ylabel("Angle")
plt.grid(True)
plt.tight_layout()
plt.show()
#------------------------------------------------------------
# END OF FILE : TEST1.PY
#============================================================