Exemplo n.º 1
0
 def startTrajectory(self, trajectoryId, timescale = 1.0, reverse = False, relative = True, groupMask = 0):
     if self._isGroup(groupMask):
         traj = self.trajectories[trajectoryId]
         # if traj is also current traj, must take pos before changing t_begin.
         pos = self._vposition()
         traj.t_begin = self.time()
         traj.timescale = timescale
         if relative:
             traj.shift = firm.vzero()
             if reverse:
                 traj_init = firm.piecewise_eval_reversed(traj, traj.t_begin)
             else:
                 traj_init = firm.piecewise_eval(traj, traj.t_begin)
             traj.shift = firm.vsub(pos, traj_init.pos)
         else:
             traj.shift = firm.vzero()
         firm.plan_start_trajectory(self.planner, traj, reverse)
Exemplo n.º 2
0
 def startTrajectory(self,
                     trajectoryId,
                     timescale=1.0,
                     reverse=False,
                     relative=True,
                     groupMask=0):
     if self._isGroup(groupMask):
         self.mode = Crazyflie.MODE_HIGH_POLY
         traj = self.trajectories[trajectoryId]
         traj.t_begin = self.time()
         traj.timescale = timescale
         if relative:
             traj.shift = firm.vzero()
             if reverse:
                 traj_init = firm.piecewise_eval_reversed(
                     traj, traj.t_begin)
             else:
                 traj_init = firm.piecewise_eval(traj, traj.t_begin)
             traj.shift = firm.vsub(self.state.pos, traj_init.pos)
         else:
             traj.shift = firm.vzero()
         firm.plan_start_trajectory(self.planner, traj, reverse)