Beispiel #1
0
    def _motion_profiler_default(self):
        mp = MotionProfiler()

        if self.configuration_dir_path:
            p = os.path.join(self.configuration_dir_path, 'motion_profiler.cfg')
            mp.load(p)
        return mp
Beispiel #2
0
 def _motion_profiler_default(self):
     mp = MotionProfiler()
     if self.configuration_dir_path:
         p = os.path.join(self.configuration_dir_path,
                          'motion_profiler.cfg')
         mp.load(p)
     return mp
Beispiel #3
0
 def _set_distance(self, d):
     self._distance = d
     mp = MotionProfiler()
     cv, ac, dc = mp.calculate_corrected_parameters(self.distance, self.velocity, self.acceleration, self.acceleration)
     times, dist = mp.calculate_transit_parameters(self.distance, cv, ac, dc)
     self._acceleration = ac
     self._velocity = cv
     self.plot_velocity_profile(times, cv, 0)
     self.plot_position_profile(*times)
Beispiel #4
0
 def _set_distance(self, d):
     self._distance = d
     mp = MotionProfiler()
     cv, ac, dc = mp.calculate_corrected_parameters(self.distance, self.velocity, self.acceleration, self.acceleration)
     times, dist = mp.calculate_transit_parameters(self.distance, cv, ac, dc)
     self._acceleration = ac
     self._velocity = cv
     self.plot_velocity_profile(times, cv, 0)
     self.plot_position_profile(*times)
Beispiel #5
0
    def velocity_profile(self, plotid):

        #        v = self.velocity
        # ac = self.acceleration
        # dc = self.deceleration

        d = self.distance
        m = MotionProfiler()

        times, dists = m.calculate_transit_parameters(d, self.velocity,
                                                      self.acceleration,
                                                      self.acceleration)
        self.plot_velocity_profile(times, self.velocity, plotid)
        return times
Beispiel #6
0
    def velocity_profile(self, plotid):

#        v = self.velocity
        # ac = self.acceleration
        # dc = self.deceleration

        d = self.distance
        m = MotionProfiler()

        times, dists = m.calculate_transit_parameters(d, self.velocity,
                                                         self.acceleration,
                                                       self.acceleration)
        self.plot_velocity_profile(times, self.velocity, plotid)
        return times
Beispiel #7
0
class MotionProfilerTest(unittest.TestCase):
    def setUp(self):
        self.mp = MotionProfiler()
        self.mpold = MotionProfilerOld()

    def testCheckParameters2(self):
        displacement = 100
        mv, mac, mdc = 0.1, 10, 10
        args = self.mp.calculate_corrected_parameters(0, displacement,
                                                        mac, mdc)
#         print args2

        print 'new', self.mp.calculate_transit_parameters(displacement, *args)
        argsold = self.mpold.calculate_corrected_parameters(displacement,
                                                       mv, mac, mdc)

        print 'old', self.mpold.calculate_transit_parameters(displacement, *argsold)
#         print nv, na, nd
#         print args1
#         print self.mp.calculate_transit_parameters(displacement, *args1)

        self.assertTupleEqual(args, argsold)
Beispiel #8
0
class MotionProfilerTest(unittest.TestCase):
    def setUp(self):
        self.mp = MotionProfiler()
        self.mpold = MotionProfilerOld()

    def testCheckParameters2(self):
        displacement = 100
        mv, mac, mdc = 0.1, 10, 10
        args = self.mp.calculate_corrected_parameters(0, displacement, mac,
                                                      mdc)
        #         print args2

        print 'new', self.mp.calculate_transit_parameters(displacement, *args)
        argsold = self.mpold.calculate_corrected_parameters(
            displacement, mv, mac, mdc)

        print 'old', self.mpold.calculate_transit_parameters(
            displacement, *argsold)
        #         print nv, na, nd
        #         print args1
        #         print self.mp.calculate_transit_parameters(displacement, *args1)

        self.assertTupleEqual(args, argsold)
Beispiel #9
0
 def setUp(self):
     self.mp = MotionProfiler()
     self.mpold = MotionProfilerOld()
Beispiel #10
0
 def setUp(self):
     self.mp = MotionProfiler()
     self.mpold = MotionProfilerOld()