pymammotion 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pymammotion might be problematic. Click here for more details.

@@ -1,5 +1,5 @@
1
1
  """MowingDevice class to wrap around the betterproto dataclasses."""
2
-
2
+ import math
3
3
  from dataclasses import dataclass
4
4
 
5
5
  import betterproto
@@ -19,6 +19,10 @@ from pymammotion.proto.mctrl_sys import MctlSys, MowToAppInfoT, SystemUpdateBufM
19
19
  from pymammotion.utility.map import CoordinateConverter
20
20
 
21
21
 
22
+ def parse_double(val: float, d: float):
23
+ return val / math.pow(10.0, d)
24
+
25
+
22
26
  @dataclass
23
27
  class MowingDevice:
24
28
  """Wraps the betterproto dataclasses, so we can bypass the groups for keeping all data."""
@@ -52,10 +56,10 @@ class MowingDevice:
52
56
  match buffer_list.update_buf_data[0]:
53
57
  case 1:
54
58
  # 4 speed
55
- self.location.RTK.latitude = buffer_list.update_buf_data[5]
56
- self.location.RTK.longitude = buffer_list.update_buf_data[6]
57
- self.location.dock.latitude = buffer_list.update_buf_data[7]
58
- self.location.dock.longitude = buffer_list.update_buf_data[8]
59
+ self.location.RTK.latitude = parse_double(buffer_list.update_buf_data[5], 8.0)
60
+ self.location.RTK.longitude = parse_double(buffer_list.update_buf_data[6], 8.0)
61
+ self.location.dock.latitude = parse_double(buffer_list.update_buf_data[7], 4.0)
62
+ self.location.dock.longitude = parse_double(buffer_list.update_buf_data[8], 4.0)
59
63
  self.location.dock.rotation = buffer_list.update_buf_data[3] + 180
60
64
  case 2:
61
65
  self.err_code_list.clear()
@@ -5,7 +5,7 @@ from pymammotion.data.model.location import Point
5
5
 
6
6
 
7
7
  class CoordinateConverter:
8
- def __init__(self, lat_degrees: float, lon_degrees: float):
8
+ def __init__(self, latitude_rad: float, longitude_rad: float):
9
9
  # Initialize constants
10
10
  self.WGS84A = 6378137.0
11
11
  self.f_ = 3.3528106647474805E-21
@@ -23,8 +23,6 @@ class CoordinateConverter:
23
23
  self.z0_ = 0.0
24
24
 
25
25
  # Call set_init_lla with provided lat/lon
26
- latitude_rad = math.radians(lat_degrees)
27
- longitude_rad = math.radians(lon_degrees)
28
26
  self.set_init_lla(latitude_rad, longitude_rad)
29
27
 
30
28
  def set_init_lla(self, lat_rad, lon_rad):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pymammotion
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary:
5
5
  License: GNU-3.0
6
6
  Author: Michael Arthur
@@ -20,7 +20,7 @@ pymammotion/bluetooth/data/notifydata.py,sha256=N1bphpueWUWbsWUcpZmMGt2CyCgLcKAF
20
20
  pymammotion/const.py,sha256=3plR6t5sFVhx3LoUbW5PE2gqIANoD-fSm-T0q8uIwIU,336
21
21
  pymammotion/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
22
  pymammotion/data/model/__init__.py,sha256=d8FlIgCcWqoH3jJSpnm-IY-25RM-l2nbRwLtWjSHo74,222
23
- pymammotion/data/model/device.py,sha256=tvwxuodX54CIYVIs9XqZLX0k546SJqAx5hsVi7n9A-A,10151
23
+ pymammotion/data/model/device.py,sha256=3GWhgFhW5TwJNUv3HAAz3ZTB4XUnIWusD5x9Iug87Gg,10315
24
24
  pymammotion/data/model/device_config.py,sha256=6BcyVbMyw6vA1jANof8_mnG-jizGsF96pbKeHP4t8G4,179
25
25
  pymammotion/data/model/enums.py,sha256=tD_vYsxstOV_lUkYF9uWkrjVOgAJPNnGevy_xmiu3WE,1558
26
26
  pymammotion/data/model/excute_boarder_params.py,sha256=kadSth4y-VXlXIZ6R-Ng-kDvBbM-3YRr8bmR86qR0U0,1355
@@ -106,10 +106,10 @@ pymammotion/utility/constant/__init__.py,sha256=tZz7szqIhrzNjfcLU3ysfINfg5VEBUAi
106
106
  pymammotion/utility/constant/device_constant.py,sha256=Ebmf1S9Of4s_SNp8yC7Vsbh35IniAeY-DYV4lRY5Kmw,7109
107
107
  pymammotion/utility/datatype_converter.py,sha256=v6zym2Zu0upxQjR-xDqXwi3516zpntSlg7LP8tQF5K8,4216
108
108
  pymammotion/utility/device_type.py,sha256=KYawu2glZMVlPmxRbA4kVFujXz3miHp3rJiOWRVj-GI,8285
109
- pymammotion/utility/map.py,sha256=CRW-CjkLBp8R9UcobH2cQ9x4qNxHSLlI2u0jAiKyB8A,2271
109
+ pymammotion/utility/map.py,sha256=GNDcA-YBIglRJjvQylNdJVefoVzlH16mFSxnojK_B_A,2175
110
110
  pymammotion/utility/periodic.py,sha256=9wJMfwXPlx6Mbp3Fws7LLTI34ZDKphH1bva_Ggyk32g,3281
111
111
  pymammotion/utility/rocker_util.py,sha256=syPL0QN4zMzHiTIkUKS7RXBBptjdbkfNlPddwUD5V3A,7171
112
- pymammotion-0.1.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
113
- pymammotion-0.1.4.dist-info/METADATA,sha256=3HWIpIIRvA-gnH-SZ3qJH7mdieIwKy3hNEPLJ9eszA4,3922
114
- pymammotion-0.1.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
- pymammotion-0.1.4.dist-info/RECORD,,
112
+ pymammotion-0.1.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
113
+ pymammotion-0.1.6.dist-info/METADATA,sha256=e3upvDI7cJZX1R99b6WpgoS07JnTbfoG5dUpd7oNum4,3922
114
+ pymammotion-0.1.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
115
+ pymammotion-0.1.6.dist-info/RECORD,,