Пример #1
0
	def __init__(self):
		""" initializing the connection """
		self.c = L.Cluster(names=nm, count=7)
import math
from time import sleep
import ckbot.logical as L
import numpy as np

nm = {
    0x46 : 'F',
    0x3C : 'S1',
    0x14 : 'S2',
    0x28 : 'M',
    0x32 : 'S3',
    0x1E : 'S4',
    0x0A : 'H'
    }

c = L.Cluster(names=nm, count=7)
Max_roll = 4000
#Max_roll = 0
Max_yaw = 2000
#Max_yaw = 0

phase = 0
r = 0
r0 = 200
y0 = 100
y = 0
tr = 250    #60deg twist angle, just input 6000
# tr=250 is stright forward and backward
be0 = 100
be = 0
be_max= 0   # bend spine angle
Пример #3
0
import ckbot.logical as L
import delta_robot
import sys
import time

SPEED = 10

c = L.Cluster()
c.populate(3)

FIRST = c.at.Nx15
SECOND = c.at.Nx16
THIRD = c.at.Nx17

FIRST.set_speed(SPEED)
SECOND.set_speed(SPEED)
THIRD.set_speed(SPEED)

mode = -1

while True:
    if mode == 1:
        positions = raw_input("enter positions seperated by commas: ")
        pos_list = [float(x) for x in positions.split(',')]
        target_angles = delta_robot.delta_calcInverse(pos_list[0], pos_list[1],
                                                      pos_list[2])
        print target_angles
        if (-1 in target_angles):
            print "impossible position"
            continue
        else: