autoverse-cli 0.16.4__py3-none-any.whl → 0.16.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: autoverse-cli
3
- Version: 0.16.4
3
+ Version: 0.16.5
4
4
  Summary: The Autoverse CLI
5
5
  Author-email: Dan Kamrath <dan.kamrath@autonomalabs.com>
6
6
  License: # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI
@@ -1,5 +1,5 @@
1
1
  avrs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- avrs/app_version.py,sha256=TCx0wneM1rI5cI2G875TCRlLz6sDG68_IiDyp7wySi0,856
2
+ avrs/app_version.py,sha256=FSfaNh9PIfyPHjI6y9IUZ48DEAYK_p-ULtAd_jtmcoA,856
3
3
  avrs/argparse_help.py,sha256=EoEaohGXZXqJvs1dFEzbo9vh47CYdHdSY2Im2Ps2iFo,945
4
4
  avrs/avrs.py,sha256=DtiZYOpQ5KzbQmf4oigQ34VGefaOkTRpATDeAGkd6UQ,4657
5
5
  avrs/can_tool.py,sha256=IBoctKobBJ3wCq4ZdtuXuXH4AMEUxazCfYT6YP0Luw8,7161
@@ -8,7 +8,7 @@ avrs/cfg.py,sha256=kMn08Z4Ms1PAu2-U1QI8weEJeIVEppP4A4_tFfwnjtg,2924
8
8
  avrs/launcher.py,sha256=kk1lyHHLgFZ4zsFfa_zV5f1kYbUODT6wEILJ8TZ16rQ,9353
9
9
  avrs/launcher_util.py,sha256=sO3k_z3A-HIQdJVkVXNXUAE_MGFwAYiZUqQBoFwOqew,5325
10
10
  avrs/race_cloud.py,sha256=W6qdevbEeu2k-qaUmvx4cQTbIIcd6qBzX-T-9rqmbgw,20124
11
- avrs/race_cloud_bridge_can.py,sha256=QXdJxGwkdL9ZNLs4EquHEmF1fU3P8rsjc4uekFPHlw8,2349
11
+ avrs/race_cloud_bridge_can.py,sha256=B57luTKl0CxNpHKTiHRiKnkI8GVjcLuu4mPmrHJvsn0,2887
12
12
  avrs/race_cloud_cfg_util.py,sha256=H3MLxkb-PBwFVXdA5IBGzWGjLeD-uBvPqIgkh7RGjfo,7214
13
13
  avrs/race_cloud_fwd_api.py,sha256=HuLE5kfmzVq08aP3tlEh3f8WNjGL5N3K5EbXg9uQomo,1506
14
14
  avrs/race_cloud_util.py,sha256=WwhmqxKIQJMxf4L4ReAJrW1Reu1A8tLfmYeEwTZDl-k,13184
@@ -38,9 +38,9 @@ avrs/requests/toggle_hud.py,sha256=sV5t5QZc4uvRihPVk8jEKZiQNsyF9tsUwq5b4jjZplc,3
38
38
  avrs/requests/vd.py,sha256=gdt5XCdCCVdECL3qt8y-PKDrlArjeY_lxtT4VpZmAJo,1804
39
39
  avrs/requests/vehicle_input.py,sha256=R1b1xkRtOBkwyU6OSN4bWVlYsIUroZG0WKbYbc4pEH8,729
40
40
  avrs/requests/vehicle_replay.py,sha256=nCAE21VNyKoeIjjXBGAihgOLO7zYHcu-HWvPZYxdQ2c,11099
41
- autoverse_cli-0.16.4.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
42
- autoverse_cli-0.16.4.dist-info/METADATA,sha256=WTipNzL49juTJHXzDeJX7xZ_phmV4IOVbY2uRtFkI3I,3342
43
- autoverse_cli-0.16.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
44
- autoverse_cli-0.16.4.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
45
- autoverse_cli-0.16.4.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
46
- autoverse_cli-0.16.4.dist-info/RECORD,,
41
+ autoverse_cli-0.16.5.dist-info/LICENSE,sha256=d4eWXho-u18HkBsX4K21uHX_bBb2UXZSrJdsb7Z_JlM,2647
42
+ autoverse_cli-0.16.5.dist-info/METADATA,sha256=tiHjwU5918K0nra1CuKC1TpTUWlbBt5Ry9Fe-atn1Ok,3342
43
+ autoverse_cli-0.16.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
44
+ autoverse_cli-0.16.5.dist-info/entry_points.txt,sha256=Cb9qsUyU5AKkklehCcvtfT0-N3SXbUEqvjze4iEU5kE,40
45
+ autoverse_cli-0.16.5.dist-info/top_level.txt,sha256=-AJO2e4MCVej6hY0U84pu5NfMeMW5qaAPSMisDT5rmA,5
46
+ autoverse_cli-0.16.5.dist-info/RECORD,,
avrs/app_version.py CHANGED
@@ -2,7 +2,7 @@ import http.client
2
2
  import json
3
3
 
4
4
  def get_app_version():
5
- return '0.16.4'
5
+ return '0.16.5'
6
6
 
7
7
  def check_app_is_latest():
8
8
  pass
@@ -6,6 +6,18 @@ import logging
6
6
 
7
7
  BUFFER_SIZE = 512
8
8
 
9
+ CAN_FRAME_FORMATS = [
10
+ '=H', # 0 bytes should never happen
11
+ '=HB',
12
+ '=HBB',
13
+ '=HBBB',
14
+ '=HBBBB',
15
+ '=HBBBBB',
16
+ '=HBBBBBB',
17
+ '=HBBBBBBB',
18
+ '=HBBBBBBBB'
19
+ ]
20
+
9
21
  class UdpTxCanListener(can.Listener):
10
22
  def __init__(self, target_port, target_ip):
11
23
  self.target_port = target_port
@@ -14,7 +26,10 @@ class UdpTxCanListener(can.Listener):
14
26
 
15
27
  def on_message_received(self, msg):
16
28
  #print('l got m {}'.format(msg))
17
- data = struct.pack('=HBBBBBBBB', msg.arbitration_id, *msg.data)
29
+
30
+ # we are getting data that is not 8 bytes (dlc probably not 8) so
31
+ # we need to zero-bad or something
32
+ data = struct.pack(CAN_FRAME_FORMATS[len(msg.data)], msg.arbitration_id, *msg.data)
18
33
  self.s.sendto(data, (self.target_ip, self.target_port))
19
34
 
20
35
  def can_bridge_loop(args):
@@ -31,14 +46,21 @@ def can_bridge_loop(args):
31
46
  while True:
32
47
  try:
33
48
  data, server = s.recvfrom(BUFFER_SIZE)
49
+
50
+ l = len(data)
51
+
52
+ # ensure data is expected size
53
+ if l > 9 or l < 2:
54
+ continue
55
+
34
56
  #print('got udp data {}'.format(data))
35
- up = struct.unpack('=HBBBBBBBB', data)
57
+ up = struct.unpack(CAN_FRAME_FORMATS[l - 1], data)
36
58
 
37
59
  tx_msg = can.Message(
38
60
  arbitration_id=up[0],
39
61
  data=up[1:],
40
62
  is_extended_id=False,
41
- dlc=8)
63
+ dlc=l - 1) # len is rx size - 1 bc we add id to front
42
64
 
43
65
  bus.send(tx_msg)
44
66
  except Exception as e: