# data[].attributes.body
from roboid import *

robot = Raccoon()

def e_pawn_w():

robot.lock_vert()

robot.degree_to(-90,20,None,None)

wait(100)

robot.degree_to(None,-20,-100,None)

robot.open_gripper()

robot.close_gripper()

robot.move_by(4,0, 0)

robot.open_gripper()

robot.move_by(-4, 0, 10)

robot.unlock()

def e_pawn_black():

robot.lock_horz()

robot.move_by(7, 0, -10)

robot.degree_to(3, -70)

robot.close_gripper()

robot.degree_to(None,-60,-60,None)

robot.move_by(-6,0,0)

robot.open_gripper()

robot.degree_to(2,20)

robot.lock_vert()

def N_w():

robot.lock_vert()

robot.degree_to(1,-120)

robot.degree_to(None, 0,-120,None)

robot.close_gripper()

robot.degree_to(-100,30,-100,None)

wait(100)

robot.degree_to(None,-30,-75,None)

robot.open_gripper()

robot.degree_by(2,30)

e_pawn_w()

while True:

key = Keyboard.read()

wait(100)

if key == Keyboard.ENTER:

print("백차례")

break

N_w()

wait(50000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

def pick(x,y,z):

robot.move_to(x,y,10)

robot.move_to(x,y,z)

robot.move_to(x,y,10)

def put(x,y,z):

robot.move_to(x,y,10)

robot.move_to(x,y,z)

robot.move_to(x,y,10)

robot.lock_horz()

robot.open_gripper()

pick(0,15,10)

robot.close_gripper()

put(7,0,10)

wait(2500)

put(10,15,10)

robot.open_gripper()

pick(0,5,10)

pick(-10,15,10)

robot.close_gripper()

put(0,15,10)

wait(18200)

put(10,15,10)

robot.open_gripper()

pick(0,5,10)

wait(11500)

pick(-10,15,10)

robot.close_gripper()

put(0,15,10)

robot.open_gripper()

put(0,5,10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

def pick(x,y,z) :

robot.move_to(x,y,10)

robot.open_gripper()

robot.move_to(x,y,z)

robot.close_gripper()

robot.move_to(x,y,10)

def place(x,y,z) :

robot.move_to(x,y,10)

robot.move_to(x,y,z)

robot.open_gripper()

robot.move_to(x,y,10)

robot.lock_horz()

wait(5000)

pick(-10,15,10)

place(0,15,10) #c에서 b로

wait(1000)

robot.close_gripper()

pick(6,0,10)

wait(5500)

place(10,15,11) #b에서 a로

robot.move_to(3,3,10)

wait(100)

robot.move_to(0,5,10)

wait(100)

pick(-10,15,10)

robot.move_to(-6,0,10)

robot.move_to(-5,5,10)

place(0,15,10)

robot.move_to(0,5,10)

pick(0,15,10)

robot.move_to(7,0,10)

wait(3000)

place(10,15,10)

robot.move_to(3,3,10)

robot.move_to(0,5,10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

wait(5000)

robot.lock_horz()

while True :

key = Keyboard.read()

if key == 'a' :

robot.velocity(1,30)

elif key== 'd' :

robot.velocity(1,-30)

elif key== 'o' :

robot.open_gripper()

elif key== 'p' :

robot.close_gripper()

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

elif key== 's' :

robot.velocity(2,30)

robot.velocity(3,-50)

elif key== 'n' :

robot.velocity(4,-30)

elif key== 'w' :

robot.velocity(2,-30)

robot.velocity(3,50)

elif key== 'm' :

robot.velocity(4,300)

elif key== 'z' :

robot.velocity(3,-50)

elif key== 'x' :

robot.velocity(3,50)

wait(1000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

def pick(x,y,z):

robot.move_to(x,y,10)

robot.open_gripper()

robot.move_to(x,y,z)

robot.close_gripper()

robot.move_to(x,y,10)

def put(x,y,z):

robot.move_to(x,y,10)

robot.move_to(x,y,z)

robot.open_gripper()

robot.move_to(x,y,10)

robot.lock_horz()

pick(7,0,2.5)

put(0,7,5)

wait(1000)

history = []

while True :

key = Keyboard.read()

print(key)

if key=='h':

history.append(robot.encoder(-1))

elif key=='p':

for data in history:

if data=='o':

robot.open_gripper()

elif data=='c':

robot.close_gripper()

else :

robot.degree_to(data[0], data[1],data[2],data[3],30)

if key=='z':

robot.velocity(1,30)

elif key=='x':

robot.velocity(1,-30)

elif key==" " :

robot.velocity(-1,0)

elif key=='w':

robot.velocity(2,30)

elif key=='a' :

robot.velocity(2,-30)

elif key=='s':

robot.velocity(3,30)

elif key=='d' :

robot.velocity(3,-30)

elif key=='q':

robot.velocity(4,30)

elif key=='e' :

robot.velocity(4,-30)

elif key=='f':

robot.close_gripper()

history.append('o')

elif key=='g' :

robot.open_gripper()

history.append('c')

if key==Keyboard.ESC :

break

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

robot.lock_horz()

def put1() :

robot.move_to(0,8,15)

robot.move_to(0,8,2.5)

robot.open_gripper()

robot.move_to(0,8,15)

def put2() :

robot.move_to(0,8,15)

robot.move_to(0,8.3,5)

robot.open_gripper()

robot.move_to(0,8,15)

def put3() :

robot.move_to(0,8,15)

robot.move_to(0,8.7,7.5)

robot.open_gripper()

robot.move_to(0,8,15)

def pick3() :

robot.open_gripper()

robot.move_to(7,0,15)

robot.move_to(7,0,2.5)

robot.close_gripper()

robot.move_to(8,0,15)

def pick2() :

robot.open_gripper()

robot.move_to(7,0,15)

robot.move_to(7,0,5)

robot.close_gripper()

robot.move_to(8,0,15)

def pick1() :

robot.open_gripper()

robot.move_to(7,0,15)

robot.move_to(7,0,7.5)

robot.close_gripper()

robot.move_to(8,0,15)

while True :

key = Keyboard.read()

print(key)

if key=='a':

robot.velocity(1,30)

elif key=='d':

robot.velocity(1,-30)

elif key=='0':

put3()

elif key=='9':

put2()

elif key=='8':

put1()

elif key=='3':

pick3()

elif key=='2':

pick2()

elif key=='1':

pick1()

elif key==" ":

robot.velocity(-1,0)

elif key=='w':

robot.velocity(3,30)

elif key=='s':

robot.velocity(3,-30)

elif key=='w':

robot.velocity(3,30)

elif key=='s':

robot.velocity(3,-30)

elif key=='e':

robot.velocity(2,-30)

elif key=='q':

robot.velocity(2,30)

elif key=='z':

robot.velocity(4,-30)

elif key=='x':

robot.velocity(4,30)

elif key=='o':

robot.open_gripper()

elif key=='p':

robot.close_gripper()

elif key=='/':

pick1()

put1()

pick2()

put2()

pick3()

put3()

if key==Keyboard.ESC :

break

# data[].attributes.body
from roboid import *

robot = Raccoon()

robot.open_gripper()

robot.degree_to(1,-90)

robot.degree_to(2,20)

robot.degree_to(4, -10)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(1, -38)

robot.open_gripper()

wait(1000)

robot.lock_horz()

robot.degree_to(1, 45)

robot.degree_to(2, -65)

wait(1000)

robot.close_gripper()

wait(1000)

robot.degree_to(2,0)

robot.degree_to(1, -45)

wait(1000)

robot.open_gripper()

robot.degree_to(1,0)

robot.unlock()

robot.degree_to(4, -5)

robot.degree_to(2, -10)

wait(1000)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(1, -45)

wait(1000)

robot.open_gripper()

robot.degree_to(1, 90)

robot.degree_to(4, -5)

robot.degree_to(2, -10)

wait(1000)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(1, -45)

wait(1000)

robot.open_gripper()

robot.degree_to(1,-55)

robot.degree_to(2,20)

wait(1000)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(3,-55)

wait(1000)

robot.open_gripper()

robot.degree_to(3,-140)

wait(1000)

robot.degree_to(1,-90)

robot.open_gripper()

robot.degree_to(4, -5)

robot.degree_to(2, -10)

wait(1000)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(3,-120)

wait(1000)

robot.degree_to(1,45)

robot.open_gripper()

robot.degree_to(4,10)

robot.degree_to(2,30)

robot.degree_to(3,-120)

wait(1000)

robot.degree_to(1,-45)

wait(1000)

robot.degree_to(2,15)

robot.close_gripper()

wait(1000)

robot.degree_to(2,30)

robot.degree_to(3,-95)

robot.degree_to(1,45)

wait(1000)

robot.degree_to(3,-130)

robot.degree_to(1,35)

robot.degree_to(1,55)

robot.degree_to(1,35)

robot.degree_to(1,55)

wait(1000)

robot.degree_to(3,-95)

robot.degree_to(1,-90)

robot.open_gripper()

wait(5000)

dispose()

# data[].attributes.body
history = []
speed = 30
while True :
key = Keyboard.read()
if key 'h':
history.append(robot.encoder(-1))
elif key 'p':
for data in history:
if data Keyboard.UP:
robot.open _gripper()
elif data Keyboard.DOWN:
robot.close_gripper()
else:
robot.degree_to(data[0], data[1], data[2], data[3], 30)
print(key)
if key=='z':
robot.velocity(1,30)
elif key=='a':
robot.velocity(1,-30)
elif key=='x':
robot.velocity(2,30)
elif key=='s':
robot.velocity(2,-30)
elif key=='c':
robot.velocity(3,30)
elif key=='d':
robot.velocity(3,-30)
elif key=='v':
robot.velocity(4,30)
elif key=='f':
robot.velocity(4,-30)
elif key==" " :
robot.velocity(-1,0)
elif key==Keyboard.ESC :
break
elif key==Keyboard.UP :
robot.open_gripper()
history.append(Keyboard.UP)
elif key==Keyboard.DOWN :
history.append(Keyboard.DOWN)
robot.close_gripper()

def pick(x,y,z):
robot.move_to(x,y,10)
robot.open_gripper()
robot.move_to(x,y,z)
robot.close_gripper()
robot.move_to(x,y,10)

def put(x,y,z):
robot.move_to(x,y,10)
robot.move_to(x,y,z)
robot.open_gripper()
robot.move_to(x,y,10)

# data[].attributes.body
from roboid import *

robot = Raccoon()

def dwaste():

robot.move_by(0,0,10)

robot.degree_by(1,90)

robot.degree_by(2,-85)

robot.degree_by(4,15)

def bwaste():

robot.move_by(0,0,10)

robot.degree_by(2,-85)

robot.degree_by(4,15)

def ewaste():

robot.move_by(0,0,10)

robot.degree_by(1,-90)

robot.degree_by(2,-85)

robot.degree_by(4,15)

while True:

a = input("쓰레기 위치(D,B,E) 또는 종료하려면 exit 입력:")

if a == "exit":

print("종료")

wait(3000)

dispose()

if a == "D":

dwaste()

elif a == "B":

bwaste()

elif a == "E" :

ewaste()

else:

print("다시 입력하십시오")

continue

b = int(input("과일이면 1, 원통형 쓰레기면 2:"))

if b == 1:

robot.move_by(0,0,-1)

robot.open_gripper()

robot.close_gripper()

robot.degree_to(2,85)

robot.degree_to(1,45)

robot.degree_by(4,-60)

robot.degree_by(3,-35)

robot.open_gripper()

robot.close_gripper()

robot.move_by(0,0,20)

robot.degree_to(0,-10,-140,60)

robot.open_gripper()

elif b == 2:

robot.open_gripper()

robot.close_gripper()

robot.degree_to(2,85)

robot.degree_to(1,-45)

robot.degree_by(4,-60)

robot.degree_by(3,-35)

robot.open_gripper()

robot.close_gripper()

robot.move_by(0,0,20)

robot.degree_to(0,-10,-140,60)

robot.open_gripper()

# data[].attributes.attachment_link.readable_text
import roboidai as ai
from roboid import *
import math

class Picker:
    def __init__(self):
        self.aruco = ai.ArucoDetector()
    
    def init(self, image, id1, id2):
        if self.aruco.detect(image):
            pt1 = self.aruco.get_xy(id1)
            pt2 = self.aruco.get_xy(id2)
            if pt1 is not None and pt2 is not None:
                dx = pt2[0] - pt1[0]
                dy = pt1[1] - pt2[1]
                dist = math.sqrt(dx*dx + dy*dy)
                self.scale = 16 / dist
                th = math.atan2(dy, dx)
                self.cth = math.cos(th)
                self.sth = math.sin(th)
                self.tx = pt1[0]
                self.ty = pt1[1]
                return True
        return False
    
    def transform(self, x, y):
        x -= self.tx
        y -= self.ty
        y = -y
        x = self.scale * x
        y = self.scale * y
        x2 = x * self.cth + y * self.sth
        y2 = -x * self.sth + y * self.cth
        x2 -= 8
        y2 += 8
        return x2, y2
    
    def compensate(self, x, y, th):
        th = math.radians(th)
        y -= 8 * math.cos(th)
        x += 8 * math.sin(th)
        return x, y

picker = Picker()


cam = ai.Camera('usb0')
robot = Raccoon()

color = ai.ColorDetector()

state = 0
while True:
    image = cam.read()
    if state == 0:
        if picker.init(image, 1, 2):
            print('Ready')
            state = 1
    elif state == 1:
        if color.detect(image):
            pt = color.get_xy('red')
            if pt is not None:
                x, y = picker.transform(pt[0], pt[1])
                state = 2
    else:
        robot.open_gripper()
        robot.move_to(x, y, 18)
        x, y = picker.compensate(x, y, robot.encoder(1))
        robot.move_to(x, y, 18)
        robot.lock_horz()
        wait(3000)
        robot.move_to(x, y, 1.5)
        robot.close_gripper()
        robot.move_to(x, y, 18)
        robot.move_to(14, -8, 18)
        robot.lock_vert()
        wait(3000)
        robot.open_gripper()
        print('DONE')
        break
        
    cam.show(image)
    if cam.check_key(10) == 'esc': break

cam.hide()
wait(1000)

# data[].attributes.headline
동시에 작동하기(멀티쓰레드)

# data[].attributes.subject
동시에 작동하기(멀티쓰레드)

# data[].attributes.body
from roboid import *

import threading

robot = Raccoon()

run=0

def pick():

if run==0: robot.move_to(10,0,10)

if run==0: robot.move_to(-10,0,10)

def key_input():

while True:

key = Keyboard.read()

if key==' ':

robot.stop()

run=1

elif key=='a':

run=0

elif key=='s':

break

p1 = threading.Thread(target=pick)

p2 = threading.Thread(target=key_input)

p1.start()

p2.start()

wait(5000)

dispose()

# data[].attributes.body
1. (시작) - anaconda prompt 실행

2. (도스창) pip install -U roboid

3. spdyer 실행

# data[].attributes.headline
1일차 코드(관절 각도 저장 및 플레이)

# data[].attributes.subject
1일차 코드(관절 각도 저장 및 플레이)

# data[].attributes.body
from roboid import *

robot = Raccoon()

history = []

speed=30

while True :

key = Keyboard.read()

if key=='s':

history.append(robot.encoder(-1))

elif key=='p':

for data in history:

if data=='o':

robot.open_gripper()

elif data=='c':

robot.close_gripper()

else :

robot.degree_to(data[0], data[1],data[2],data[3],30)

elif key=='z': # joint 1

robot.velocity(1, speed)

elif key=='x': # joint 1

robot.velocity(1, -speed)

elif key==" " : #space -> stop

robot.velocity(-1,0)

elif key=='o':

robot.open_gripper()

history.append('o')

elif key=='c':

robot.close_gripper()

history.append('c')

elif key==Keyboard.UP :

speed = speed+10

elif key==Keyboard.ESC :

break

dispose()

# data[].attributes.attachment_link.title
The AI workspace that works for you. | Notion

# data[].attributes.attachment_link.description
A tool that connects everyday work into one space. It gives you and your teams AI tools—search, writing, note-taking—inside an all-in-one, flexible workspace.

# data[].attributes.body
from roboid import *

import random

robot = Raccoon()

robot.lock_vert()

# robot.lock_horz()

# robot.lock_unlock()

history = []

loc_A = []

loc_B = []

loc_C = []

final = []

robot.degree_to(0, 0, -30, -90)

A = [(44.42, -42.54, -81.91, -55.5), (44.42, -35.07, -78.22, -66.8), (44.42, -28.91, -72.51, -78.4), (44.42, -29.71, -58.27, -92.02)]

B = [(0, -24.08, -113.29, -42.4), (0, -14.5, -108.28, -57.13), (0, -7.47, -101.34, -71.45), (0, -4.925, -90.445, -84.7)]

C = [(-44.42, -42.54, -81.91, -55.5), (-44.42, -35.07, -78.22, -66.8), (-44.42, -28.91, -72.51, -78.4), (-44.42, -29.71, -58.27, -92.02)]

def pick(l, v):

robot.degree_to(l[v-1][0], l[v-1][1], l[v-1][2], l[v-1][3])

robot.close_gripper()

robot.degree_to(0, 0, -30, -90)

def down(l, v):

robot.degree_to(l[v-1][0], l[v-1][1], l[v-1][2], l[v-1][3])

robot.open_gripper()

robot.degree_to(0, 0, -30, -90)

def finding():

global target

if loc_B.count(target) != 0:

count = len(loc_B)

index = loc_B.index(target)+1

for i in range(count-index):

pick(B, len(loc_B))

down(A, len(loc_A)+1)

loc_A.append(loc_B[-1])

loc_B.remove(loc_B[-1])

print(loc_C,loc_B,loc_A)

pick(B, len(loc_B))

down(C, len(loc_C)+1)

loc_C.append(loc_B[-1])

loc_B.remove(loc_B[-1])

target -= 1

print(loc_C,loc_B,loc_A)

elif loc_A.count(target) != 0:

count = len(loc_A)

index = loc_A.index(target)+1

for i in range(count-index):

pick(A, len(loc_A))

down(B, len(loc_B)+1)

loc_B.append(loc_A[-1])

loc_A.remove(loc_A[-1])

pick(A, len(loc_A))

down(C, len(loc_C)+1)

loc_C.append(loc_A[-1])

loc_A.remove(loc_A[-1])

target -= 1

x=input("현재 탑 순서(1층,2층,...) : ").split()

for i in range(len(x)):

final.append(len(x)-i)

for i in range(len(x)):

x[i] = int(x[i])

loc_B = x

target = max(x)

print(loc_A,loc_B,loc_C)

while loc_C != final:

finding()

wait(100)

print(final)

print(loc_A,loc_B,loc_C)

while True :

key = Keyboard.read()

if key == 'a':

robot.velocity(30,0,0,0)

elif key== 'd' :

robot.velocity(-30,0,0,0)

elif key== 'w' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== Keyboard.UP :

robot.velocity(0,0,30,0)

elif key== Keyboard.DOWN :

robot.velocity(0,0,-30,0)

elif key== '2' :

robot.velocity(0,0,0,30)

elif key== '8' :

robot.velocity(0,0,0,-30)

elif key=='[':

history.append('close')

robot.close_gripper()

elif key==']':

history.append('open')

robot.open_gripper()

elif key=='r':

history.append(robot.encoder())

print(history)

elif key=='p':

for data in history:

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
https://drive.google.com/drive/folders/1w0iOnT2Ah_KVIOrpbVKo8-AWvoHQj_Tl?usp=sharing

# data[].attributes.body
picker.py

# data[].attributes.attachment_link.readable_text
import roboidai as ai
from roboid import *
import math

class Picker:
    def __init__(self):
        self.aruco = ai.ArucoDetector()
    
    def init(self, image, id1, id2):
        if self.aruco.detect(image):
            pt1 = self.aruco.get_xy(id1)
            pt2 = self.aruco.get_xy(id2)
            if pt1 is not None and pt2 is not None:
                dx = pt2[0] - pt1[0]
                dy = pt1[1] - pt2[1]
                dist = math.sqrt(dx*dx + dy*dy)
                self.scale = 16 / dist
                th = math.atan2(dy, dx)
                self.cth = math.cos(th)
                self.sth = math.sin(th)
                self.tx = pt1[0]
                self.ty = pt1[1]
                return True
        return False
    
    def transform(self, x, y):
        x -= self.tx
        y -= self.ty
        y = -y
        x = self.scale * x
        y = self.scale * y
        x2 = x * self.cth + y * self.sth
        y2 = -x * self.sth + y * self.cth
        x2 -= 8
        y2 += 8
        return x2, y2
    
    def compensate(self, x, y, th):
        th = math.radians(th)
        y -= 8 * math.cos(th)
        x += 8 * math.sin(th)
        return x, y

picker = Picker()




# data[].attributes.headline
개별 프로젝트 설문조사(마포고)

# data[].attributes.subject
개별 프로젝트 설문조사(마포고)

# data[].attributes.body
https://docs.google.com/forms/d/e/1FAIpQLSdQ2cXgiw5G9ELC_4EwrfNeGrmGx42vf75sIxNkVQzZdcTzZg/viewform?usp=dialog

# data[].attributes.body
https://docs.google.com/forms/d/e/1FAIpQLSf2RNcaz1tI__DMghCMPFidqmwvsvh_pgNk7mzE39WxYigyow/viewform?usp=send_form

# data[].attributes.headline
한 위치에서 다른 위치로 이동

# data[].attributes.subject
한 위치에서 다른 위치로 이동

# data[].attributes.body
from roboid import *

def move(xy, z, speed=100):

z=z*2.6+7.45

th1, th2, th3 = robot._calc_inv_kinematics(xy[0], xy[1], z)

robot._angle_to(th1, th2, th3, None, speed, True)

AX=-10.90

AY=10.20

A=(AX,AY)

BX=-0.55

BY=10.80

B=(BX,BY)

CX=10.25

CY=10.90

C=(CX,CY)

DX=-10.80

DY=-0.45

D=(DX,DY)

EX=10.85

EY=0.45

E=(EX,EY)

loc={'a':A,'b':B,'c':C,'d':D,'e':E}

robot = Raccoon()

robot.lock_vert()

robot.open_gripper()

robot.move_to(0,5,20)

cnt={}

cnt['a'],cnt['b'],cnt['c'],cnt['d'],cnt['e']=map(int,input().split())

while True :

s,e=input().split()

if cnt[s]>0:

move(loc[s],4)

move(loc[s],cnt[s])

robot.close_gripper()

move(loc[s],4)

cnt[s]-=1

move(loc[e],4)

move(loc[e],cnt[e]+1)

robot.open_gripper()

move(loc[e],4)

cnt[e]+=1

# data[].attributes.body
from roboid import *

import json

with open(r'C:\Users\COM\Desktop\temporary robot\angle.json') as json_file:

json_data = json.load(json_file)

robot = Raccoon()

f = open(r"C:\Users\COM\Desktop\t1.txt", "w")

opened = True

cur_blocks = [1, 1, 1, 1, 1]

map_pos = {'A':0, 'B':1, 'C':2, 'D':3, 'E':4}

cur_pos = 'B'

def autoStack(s, e):

global cur_blocks, map_pos, cur_pos

start_height = cur_blocks[map_pos[s]]

end_height = cur_blocks[map_pos[e]]

if start_height 0 or end_height 2:

print("invalid move")

return

cur_usafe = json_data[cur_pos + "_usafe"]

robot.degree_to(cur_usafe[0], cur_usafe[1], cur_usafe[2], cur_usafe[3])

wait(100)

start_usafe = json_data[s + "_usafe"]

end_usafe = json_data[e + "_usafe"]

start_layer = json_data[s + "_layer" + str(cur_blocks[map_pos[s]])]

temp = cur_blocks[map_pos[e]] + 1

end_layer = json_data[e + "_layer" + str(temp)]

robot.degree_to(start_usafe[0], start_usafe[1], start_usafe[2], start_usafe[3])

wait(100)

robot.degree_to(start_layer[0], start_layer[1], start_layer[2], start_layer[3])

wait(100)

robot.close_gripper()

wait(100)

robot.degree_to(start_usafe[0], start_usafe[1], start_usafe[2], start_usafe[3])

wait(100)

robot.degree_to(end_usafe[0], end_usafe[1], end_usafe[2], end_usafe[3])

wait(100)

robot.degree_to(end_layer[0], end_layer[1], end_layer[2], end_layer[3])

wait(100)

robot.open_gripper()

wait(100)

robot.degree_to(end_usafe[0], end_usafe[1], end_usafe[2], end_usafe[3])

wait(100)

cur_pos = e

cur_blocks[map_pos[s]] = start_height-1

cur_blocks[map_pos[e]] = end_height+1

while True:

key = Keyboard.read()

if key == 'i':

s, e = input("시작 위치, 목표 위치: ").split()

wait(100)

autoStack(s, e)

elif key == 's':

f.write(str(robot.encoder()))

elif key == ' ':

if opened:

robot.close_gripper()

opened = False

else:

robot.open_gripper()

opened = True

elif key == Keyboard.ESC:

break

wait(100)

f.close()

wait(5000)

dispose()

# data[].attributes.body
robot = Raccoon()

#robot.lock_vert()

# robot.lock_horz()

# robot.lock_unlock()

history =[]

while True :

key = Keyboard.read()

if key == 'z':

robot.velocity(30,0,0,0)

elif key== 'x' :

robot.velocity(-30,0,0,0)

elif key== 'q' :

robot.velocity(0,30,0,0)

elif key== 'w' :

robot.velocity(0,-30,0,0)

elif key== 'e' :

robot.velocity(0,0,30,0)

elif key== 'r' :

robot.velocity(0,0,-30,0)

elif key== 't' :

robot.velocity(0,0,0,30)

elif key== 'y' :

robot.velocity(0,0,0,-30)

elif key=='u':

history.append('open')

robot.open_gripper()

elif key=='i':

history.append('close')

robot.close_gripper()

elif key=='o' :

history.append(robot.encoder())

print(history)

elif key=='p' :

for data in history :

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

history = []

입력과 상관없이 open 과 close 가 연이어 일어남

# data[].attributes.body
from roboid import *

robot = Raccoon()

history = []

while True :

key = Keyboard.read()

if key == 'a':

robot.velocity(1,100)

elif key== 'd' :

robot.velocity(1,-100)

elif key== 's' :

robot.velocity(2,-100)

elif key== 'w' :

robot.velocity(2,100)

elif key== 'l' :

robot.velocity(3,-100)

elif key== 'j' :

robot.velocity(3,100)

elif key== 'k' :

robot.velocity(4,-100)

elif key== 'i' :

robot.velocity(4,100)

elif key=='f':

history.append('open')

robot.open_gripper()

elif key=='g':

history.append('close')

robot.close_gripper()

elif key== ' ' :

history.append(robot.encoder())

robot.stop()

elif key=='p' :

history.clear()

break

elif key == 'r':

for data in history:

if data == 'open':

robot.open_gripper()

elif data == 'close':

robot.close_gripper()

else:

robot.degree_to(data[0], data[1], data[2], data[3], 50)

wait(1)

wait(2500)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

robot.lock_horz()

history = []

while True :

key = Keyboard.read()

if key == 'a':

robot.velocity(50,0,0,0)

elif key== 'd' :

robot.velocity(-50,0,0,0)

elif key== 'w' :

robot.velocity(0,50,0,0)

elif key== 's' :

robot.velocity(0,-50,0,0)

elif key== 'i' :

robot.velocity(0,0,50,0)

elif key== 'k' :

robot.velocity(0,0,-50,0)

elif key== 'j' :

robot.velocity(0,0,0,50)

elif key== 'l' :

robot.velocity(0,0,0,-50)

elif key=='q':

history.append('open')

robot.open_gripper()

print(history)

elif key=='e':

history.append('close')

robot.close_gripper()

print(history)

elif key =='r':

history.append(robot.encoder())

print(history)

elif key == 't':

for data in history :

if data=='open':robot.open_gripper()

elif data=='close':robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

history = []

while True :

key = Keyboard.read()

if key == 'a':

robot.velocity(30,0,0,0)

elif key== 'd' :

robot.velocity(-30,0,0,0)

elif key== 'w' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== 'e' :

robot.velocity(0,0,30,0)

elif key== 'q' :

robot.velocity(0,0,-30,0)

elif key== 'c' :

robot.velocity(0,0,0,30)

elif key== 'z' :

robot.velocity(0,0,0,-30)

elif key=='g':

history.append('open')

robot.open_gripper()

elif key=='f':

history.append('close')

robot.close_gripper()

elif key=='r' :

history.append(robot.encoder())

print(history)

elif key=='p' :

for data in history :

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

robot.lock_vert()

# robot.lock_horz()

# robot.lock_unlock()

history = []

for data in [(0.263671875, 1.93359375, -90.0, -91.93359375), (89.82421875, 1.93359375, -90.0, -91.93359375), (89.82421875, -26.3671875, -114.521484375, -39.287109375), 'close', (89.82421875, -26.279296875, -114.169921875, -39.462890625), (89.82421875, -2.4609375, -87.626953125, -90.17578125), (-89.384765625, -2.4609375, -87.626953125, -90.17578125), (-89.296875, -26.3671875, -114.08203125, -39.7265625), 'open', (-89.296875, -26.455078125, -114.08203125, -39.638671875), (-89.296875, 0.087890625, -88.59375, -91.318359375)]:

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

while True :

key = Keyboard.read()

if key == 'a':

robot.velocity(30,0,0,0)

elif key== 'd' :

robot.velocity(-30,0,0,0)

elif key== 'w' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== Keyboard.UP :

robot.velocity(0,0,30,0)

elif key== Keyboard.DOWN :

robot.velocity(0,0,-30,0)

elif key== '2' :

robot.velocity(0,0,0,30)

elif key== '8' :

robot.velocity(0,0,0,-30)

elif key=='[':

history.append('close')

robot.close_gripper()

elif key==']':

history.append('open')

robot.open_gripper()

elif key=='r':

history.append(robot.encoder())

print(history)

elif key=='p':

for data in history:

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

history=[]

while True :

key = Keyboard.read()

if key == 'z':

robot.velocity(30,0,0,0)

elif key== 'x' :

robot.velocity(-30,0,0,0)

elif key== 'a' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== 'q' :

robot.velocity(0,0,30,0)

elif key== 'w' :

robot.velocity(0,0,-30,0)

elif key== 'd' :

robot.velocity(0,0,0,30)

elif key== 'f' :

robot.velocity(0,0,0,-30)

elif key=='g':

history.append('open')

robot.open_gripper()

elif key=='h':

history.append('close')

robot.close_gripper()

elif key=='r':

history.append(robot.encoder())

print(history)

elif key=='p':

for data in history:

if data=='open':robot.open_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(5000)

dispose()

# data[].attributes.body
robot.velocity(관절번호) : 속도

robot.degree_to( 관절번호) : 절대값 각도

robot.degree_by(관절번호) : 상대값 각도

robot.move_to(x,y,z) : 절대값 좌표이동(cm단위)

robot.move_by(x,y,z) : 상대값 좌표이동(cm단위)

robot.encoder(관절번호) : 현재 관절 각도

robot.open_gripper()

robot.close_gripper()

robot.lock_horz()

robot.lock_vert()

robot.unlock()

# data[].attributes.body
from roboid import *

robot = Raccoon()

history = []

while True :

key = Keyboard.read()

if key == 'z':

robot.velocity(30,0,0,0)

elif key== 'x' :

robot.velocity(-30,0,0,0)

elif key== 'a' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== 'q' :

robot.velocity(0,0,30,0)

elif key== 'w' :

robot.velocity(0,0,-30,0)

elif key== 'd' :

robot.velocity(0,0,0,30)

elif key== 'f' :

robot.velocity(0,0,0,-30)

elif key=='g':

history.append('open')

robot.open_gripper()

elif key=='h':

history.append('close')

robot.close_gripper()

elif key=='r':

history.append(robot.encoder())

print(history)

elif key=='p':

for data in history :

if data=='open' : robot.open_gripper()

elif data=='close' : robot.close_gripper()

else : robot.degree_to(data[0],data[1],data[2],data[3])

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

def pick(x,y,z) :

robot.move_to(x,y,10)

robot.open_gripper()

robot.move_to(x,y,z)

robot.close_gripper()

robot.move_to(x,y,10)

def place(x,y,z) :

robot.move_to(x,y,10)

robot.move_to(x,y,z)

robot.open_gripper()

robot.move_to(x,y,10)

robot.close_gripper()

robot.lock_horz()

pick(0,7,2.5)

place(7,0,2.5)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

robot.lock_vert()

# robot.lock_horz()

# robot.lock_unlock()

while True :

key = Keyboard.read()

if key == 'z':

robot.velocity(30,0,0,0)

elif key== 'x' :

robot.velocity(-30,0,0,0)

elif key== 'a' :

robot.velocity(0,30,0,0)

elif key== 's' :

robot.velocity(0,-30,0,0)

elif key== 'q' :

robot.velocity(0,0,30,0)

elif key== 'w' :

robot.velocity(0,0,-30,0)

elif key== 'd' :

robot.velocity(0,0,0,30)

elif key== 'f' :

robot.velocity(0,0,0,-30)

elif key=='g':

robot.open_gripper()

elif key=='h':

robot.close_gripper()

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
1번 관절 : 120도(좌) ~ -120도(우)

2번 관절 : 30도(위) ~ -90도(아래)

3번 관절 : 0도(위) ~ -150도(아래)

4번 관절 : 105도(위) ~ -105도(아래)

그리퍼 : 열림, 닫힘

# data[].attributes.body
# 1번 관절 (-120°~120°)

# 2번 관절 (-90°~30°)

# 3번 관절 (-150°~0°)

# 4번 관절 (-105°~105°)

from roboid import *

robot = Raccoon()

robot.note('D4',.2)

robot.note('D4',.2)

robot.note('D5',.3)

robot.note('A4',.5)

robot.note('Ab4',.3)

robot.note('G4',.3)

robot.note('F4',.3)

robot.note('D4',.2)

robot.note('F4',.2)

robot.note('G5',.2)

while True:

key = Keyboard.read()

if key == "a":

robot.velocity(1,30)

elif key == "d":

robot.velocity(1,-30)

elif key == "w":

robot.velocity(2,30)

elif key == "s":

robot.velocity(2,-30)

elif key == Keyboard.UP:

robot.velocity(3,30)

elif key == Keyboard.DOWN:

robot.velocity(3,-30)

elif key == "8":

robot.velocity(4,30)

elif key == "2":

robot.velocity(4,-30)

elif key == "[":

robot.close_gripper()

elif key == "]":

robot.open_gripper()

elif key == " ":

robot.stop()

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot=Raccoon()

while True :

key= Keyboard.read()

if key =='z':

robot.velocity(1,30)

elif key=='x':

robot.velocity(1,-30)

elif key=='g':

robot.open_gripper()

elif key=='h':

robot.close_gripper()

elif key==' ':

robot.stop()

wait(10)

dispose()

# data[].attributes.body
from roboid import*

robot = Raccoon()

while True :

Key = Keyboard.read()

if Key == 'a' :

robot.velocity(1,30)

elif Key == 'd' :

robot.velocity(1,-30)

if Key == 'w' :

robot.velocity(2,30)

elif Key == 's' :

robot.velocity(2,-30)

if Key == 'e' :

robot.velocity(3,30)

elif Key == 'q' :

robot.velocity(3,-30)

if Key == 'z' :

robot.velocity(4,30)

elif Key == 'x' :

robot.velocity(4,-30)

elif Key == ' ' :

robot.stop()

if Key == '1' :

robot.open_gripper()

elif Key == '2' :

robot.close_gripper()

wait(10)

wait(5000)

dispose()

# data[].attributes.body
from roboid import *

robot = Raccoon()

while True:

key=Keyboard.read()

if key == 'z':

robot.velocity(1,30)

elif key=='x':

robot.velocity(1,-30)

elif key=='g':

robot.open_gripper()

elif key=='h':

robot.close_gripper()

elif key==' ':

robot.stop()

elif key==Keyboard.DOWN:

break

wait(10)

dispose()

# data[].attributes.headline
키보드 제어 기본 프로그램

# data[].attributes.subject
키보드 제어 기본 프로그램

# data[].attributes.body
from roboid import *

robot = Raccoon()

while True :

key = Keyboard.read()

if key == 'z':

robot.velocity(1,30)

elif key== 'x' :

robot.velocity(1,-30)

elif key=='g':

robot.open_gripper()

elif key=='h':

robot.open_gripper()

elif key== ' ' :

robot.stop()

elif key==Keyboard.ESC :

break

wait(10)

wait(5000)

dispose()

# data[].attributes.body
https://forms.gle/5ys86AquV5tuhQKr9

# data[].attributes.body
https://form.kosac.re.kr/v/3yzQ5AMHj88ndqPgVOad

# data[].attributes.attachment_link.description
빠르고 쉬운 폼빌더, 왈라

# data[].attributes.body
이 자료는 비공개로 캠프 기간에만 사용하며, 외부 유출시 처벌을 받을 수도 있습니다.

# data[].attributes.body
2-2. 25년 1기 중/고등학생 사후 설문조사 | Walla Form

# data[].attributes.attachment_link.description
빠르고 쉬운 폼빌더, 왈라

# data[].attributes.body
https://drive.google.com/drive/folders/1J0lxNDlZij75WBD0RRXlzikPOQ9iMGVO?usp=sharing