コード例 #1
0
ファイル: crazyflieSim.py プロジェクト: hihixuyang/crazyswarm
    def __init__(self, id, initialPosition, timeHelper):
        self.id = id
        self.initialPosition = np.array(initialPosition)
        self.time = lambda: timeHelper.time()

        self.planner = firm.planner()
        firm.plan_init(self.planner)
        self.planner.lastKnownPosition = arr2vec(initialPosition)
        self.groupMask = 0
        self.trajectories = dict()
コード例 #2
0
    def __init__(self, id, initialPosition, timeHelper):
        self.id = id
        self.initialPosition = np.array(initialPosition)
        self.time = lambda: timeHelper.time()

        MASS = 0.032
        self.planner = firm.planner()
        firm.plan_init(self.planner, MASS)
        self.planner.home = arr2vec(initialPosition)
        self.planner.lastKnownPosition = arr2vec(initialPosition)
        self.group = 0
コード例 #3
0
    def __init__(self, id, initialPosition, timeHelper):
        self.id = id
        self.initialPosition = np.array(initialPosition)
        self.time = lambda: timeHelper.time()

        self.planner = firm.planner()
        self.cmdHighLevel = True
        firm.plan_init(self.planner)
        self.planner.lastKnownPosition = arr2vec(initialPosition)
        self.groupMask = 0
        self.trajectories = dict()

        # for visualization - default to blueish-grey
        self.ledRGB = (0.5, 0.5, 1)
コード例 #4
0
    def __init__(self, id, initialPosition, timeHelper):

        # Core.
        self.id = id
        self.groupMask = 0
        self.initialPosition = np.array(initialPosition)
        self.time = lambda: timeHelper.time()

        # Commander.
        self.mode = Crazyflie.MODE_IDLE
        self.planner = firm.planner()
        firm.plan_init(self.planner)
        self.trajectories = dict()
        self.setState = firm.traj_eval()

        # State. Public np.array-returning getters below for physics state.
        self.state = firm.traj_eval()
        self.state.pos = firm.mkvec(*initialPosition)
        self.state.vel = firm.vzero()
        self.state.acc = firm.vzero()
        self.state.yaw = 0.0
        self.state.omega = firm.vzero()
        self.ledRGB = (0.5, 0.5, 1)