<aside> 💡 조립은 잘 완료하셨나요?! 😕 조립 등 실제 로봇에서 발생되는 여러 문제점들은 22강에서 다시 한 번 다뤄질 예정이니 너무 스트레스받지 않으셔도 좋습니다. 😇
</aside>
# [0]~[2] : 왼쪽 앞 다리 // [3]~[5] : 오른쪽 앞 다리 // [6]~[8] : 왼쪽 뒷 다리 // [9]~[11] : 오른쪽 뒷 다리
# centered position perpendicular to the ground
self._servo_offsets = [170, 85, 90, 1, 95, 90, 172, 90, 90, 1, 90, 95]
def main(id, command_status):
jointAngles = []
while True:
xr = 0.0
yr = 0.0
ir=xr/(math.pi/180)
d=time.time()-rtime
# robot height
height = 40
# calculate robot step command from keyboard inputs
result_dict = command_status.get()
print(result_dict)
command_status.put(result_dict)
# wait 3 seconds to start
if result_dict['StartStepping']:
currentLp = trotting.positions(d-3, result_dict)
robot.feetPosition(currentLp)
else:
robot.feetPosition(Lp)
roll=0
robot.bodyRotation((roll,math.pi/180*((joy_x)-128)/3,-(1/256*joy_y-0.5)))
bodyX=50+yr*10
robot.bodyPosition((bodyX, 40+height, -ir))
# Get current Angles for each motor
jointAngles = robot.getAngle()
print(jointAngles)
# First Step doesn't contains jointAngles
if len(jointAngles):
# Real Actuators
controller.servoRotate(jointAngles)
# # Plot Robot Pose into Matplotlib for Debugging
# TODO: Matplotplib animation
# kn.initFK(jointAngles)
# kn.plotKinematics()
robot.step()
consoleClear()
이전에 실습했던 t값들이 있다면 다시 한 번 실제 로봇을 가지고 실습해보세요!!!