def testStartStopModulation(self):
radiusInMilliRad= 12.4
frequencyInHz= 100.
centerInMilliRad= [-10, 15]
self._tt.setTargetPosition(centerInMilliRad)
self._tt.startModulation(radiusInMilliRad,
frequencyInHz,
centerInMilliRad)
self.assertTrue(
np.allclose(
[1, 1, 0],
self._ctrl.getWaveGeneratorStartStopMode()))
waveform= self._ctrl.getWaveform(1)
wants= self._tt._milliRadToGcsUnitsOneAxis(-10, self._tt.AXIS_A)
got= np.mean(waveform)
self.assertAlmostEqual(
wants, got, msg="wants %g, got %g" % (wants, got))
wants= self._tt._milliRadToGcsUnitsOneAxis(-10 + 12.4, self._tt.AXIS_A)
got= np.max(waveform)
self.assertAlmostEqual(
wants, got, msg="wants %g, got %g" % (wants, got))
self._tt.stopModulation()
self.assertTrue(
np.allclose(centerInMilliRad, self._tt.getTargetPosition()))
评论列表
文章目录