Exemplo n.º 1
0
    def test_coordinate_conversion(self):
        d = wwMath.coords_api_to_json_tilt(3.0)
        self.assertAlmostEqual(d, -3.0)

        d = wwMath.coords_api_to_json_pan(3.0)
        self.assertAlmostEqual(d, 3.0)

        x, y = wwMath.coords_api_to_json_pos(1.0, 2.0)
        self.assertAlmostEqual(x, 2.0)
        self.assertAlmostEqual(y, -1.0)

        d = wwMath.coords_json_to_api_tilt(3.0)
        self.assertAlmostEqual(d, -3.0)

        d = wwMath.coords_json_to_api_pan(3.0)
        self.assertAlmostEqual(d, 3.0)

        x, y = wwMath.coords_json_to_api_pos(1.0, 2.0)
        self.assertAlmostEqual(x, -2.0)
        self.assertAlmostEqual(y, 1.0)
Exemplo n.º 2
0
 def stage_tilt_voltage(self, tilt_voltage_percent):
     self._robot.stage_cmds(
         self.compose_voltage(
             _rc.WW_COMMAND_HEAD_TILT_VOLTAGE,
             wwMath.coords_api_to_json_tilt(tilt_voltage_percent)))
Exemplo n.º 3
0
 def stage_tilt_angle(self, tilt_degrees):
     self._robot.stage_cmds(
         self.compose_angle(_rc.WW_COMMAND_HEAD_POSITION_TILT,
                            wwMath.coords_api_to_json_tilt(tilt_degrees)))