do not run on import

old-commit-hash: 59accdd814
commatwo_master
Willem Melching 4 years ago
parent bb156e50d7
commit 116ae68bdb
  1. 2
      selfdrive/test/test_fingerprints.py
  2. 35
      tools/replay/can_replay.py
  3. 3
      tools/zookeeper/check_consumption.py
  4. 3
      tools/zookeeper/disable.py
  5. 8
      tools/zookeeper/enable_and_wait.py
  6. 4
      tools/zookeeper/ignition.py
  7. 2
      tools/zookeeper/test_zookeeper.py

@ -58,6 +58,8 @@ def check_can_ignition_conflicts(fingerprints, brands):
sys.exit(1)
if __name__ == "__main__":
fingerprints = _get_fingerprints()
fingerprints_flat = []

@ -16,24 +16,6 @@ except Exception:
PandaJungle = None # type: ignore
print("Loading log...")
ROUTE = "77611a1fac303767/2020-03-24--09-50-38"
REPLAY_SEGS = list(range(10, 16)) # route has 82 segments available
CAN_MSGS = []
for i in tqdm(REPLAY_SEGS):
log_url = f"https://commadataci.blob.core.windows.net/openpilotci/{ROUTE}/{i}/rlog.bz2"
lr = LogReader(log_url)
CAN_MSGS += [can_capnp_to_can_list(m.can) for m in lr if m.which() == 'can']
# set both to cycle ignition
IGN_ON = int(os.getenv("ON", "0"))
IGN_OFF = int(os.getenv("OFF", "0"))
ENABLE_IGN = IGN_ON > 0 and IGN_OFF > 0
if ENABLE_IGN:
print(f"Cycling ignition: on for {IGN_ON}s, off for {IGN_OFF}s")
def send_thread(s, flock):
if "Jungle" in str(type(s)):
if "FLASH" in os.environ:
@ -99,4 +81,21 @@ def connect():
if __name__ == "__main__":
print("Loading log...")
ROUTE = "77611a1fac303767/2020-03-24--09-50-38"
REPLAY_SEGS = list(range(10, 16)) # route has 82 segments available
CAN_MSGS = []
for i in tqdm(REPLAY_SEGS):
log_url = f"https://commadataci.blob.core.windows.net/openpilotci/{ROUTE}/{i}/rlog.bz2"
lr = LogReader(log_url)
CAN_MSGS += [can_capnp_to_can_list(m.can) for m in lr if m.which() == 'can']
# set both to cycle ignition
IGN_ON = int(os.getenv("ON", "0"))
IGN_OFF = int(os.getenv("OFF", "0"))
ENABLE_IGN = IGN_ON > 0 and IGN_OFF > 0
if ENABLE_IGN:
print(f"Cycling ignition: on for {IGN_ON}s, off for {IGN_OFF}s")
connect()

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
import time
@ -8,6 +8,7 @@ from tools.zookeeper import Zookeeper
# Exit code: 0 -> passed
# 1 -> failed
if __name__ == "__main__":
z = Zookeeper()
averaging_time_s = int(sys.argv[1])

@ -1,7 +1,8 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from tools.zookeeper import Zookeeper
if __name__ == "__main__":
z = Zookeeper()
z.set_device_power(False)

@ -1,15 +1,17 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import sys
import time
from tools.zookeeper import Zookeeper
def is_online(ip):
return (os.system(f"ping -c 1 {ip} > /dev/null") == 0)
if __name__ == "__main__":
z = Zookeeper()
z.set_device_power(True)
def is_online(ip):
return (os.system(f"ping -c 1 {ip} > /dev/null") == 0)
ip = str(sys.argv[1])
timeout = int(sys.argv[2])

@ -1,8 +1,10 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
from tools.zookeeper import Zookeeper
if __name__ == "__main__":
z = Zookeeper()
z.set_device_ignition(1 if int(sys.argv[1]) > 0 else 0)

@ -3,6 +3,8 @@
import time
from tools.zookeeper import Zookeeper
if __name__ == "__main__":
z = Zookeeper()
z.set_device_power(True)

Loading…
Cancel
Save