tools: cleanup + setup CI (#20104)
	
		
	
				
					
				
			* cleanup tools * setup tools CI * loggerd doesn't support this anymore * cleanup * builds with openpilot nowpull/59/head
							parent
							
								
									4d46c521d1
								
							
						
					
					
						commit
						d1b44bbb34
					
				
				 10 changed files with 26 additions and 167 deletions
			
			
		| @ -1,4 +1,4 @@ | |||||||
| name: tests | name: selfdrive | ||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches-ignore: |     branches-ignore: | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | name: tools | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |   pull_request: | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   plotjuggler: | ||||||
|  |     name: plotjuggler | ||||||
|  |     runs-on: ubuntu-20.04 | ||||||
|  |     timeout-minutes: 30 | ||||||
|  |     steps: | ||||||
|  |     - uses: actions/checkout@v2 | ||||||
|  |       with: | ||||||
|  |         submodules: true | ||||||
|  |     - name: Install | ||||||
|  |       run: cd tools/plotjuggler && ./install.sh | ||||||
|  |     #- name: Juggle Demo | ||||||
|  |     #  run: cd tools/plotjuggler && ./juggle.py | ||||||
| @ -1,21 +0,0 @@ | |||||||
| MIT License |  | ||||||
| 
 |  | ||||||
| Copyright (c) 2018 comma.ai |  | ||||||
| 
 |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy |  | ||||||
| of this software and associated documentation files (the "Software"), to deal |  | ||||||
| in the Software without restriction, including without limitation the rights |  | ||||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |  | ||||||
| copies of the Software, and to permit persons to whom the Software is |  | ||||||
| furnished to do so, subject to the following conditions: |  | ||||||
| 
 |  | ||||||
| The above copyright notice and this permission notice shall be included in all |  | ||||||
| copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |  | ||||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |  | ||||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |  | ||||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |  | ||||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |  | ||||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |  | ||||||
| SOFTWARE. |  | ||||||
| @ -1,9 +0,0 @@ | |||||||
| == Ubuntu == |  | ||||||
| 
 |  | ||||||
| sudo apt-get install capnproto libyaml-cpp-dev qt5-default |  | ||||||
| 
 |  | ||||||
| == Mac == |  | ||||||
| 
 |  | ||||||
| brew install qt5 ffmpeg capnp yaml-cpp zmq |  | ||||||
| brew link qt5 --force |  | ||||||
| 
 |  | ||||||
| Before Width: | Height: | Size: 4.4 MiB | 
| @ -1,89 +0,0 @@ | |||||||
| #!/usr/bin/env python |  | ||||||
| # pylint: skip-file |  | ||||||
| 
 |  | ||||||
| import os |  | ||||||
| import sys |  | ||||||
| import zmq |  | ||||||
| import cv2 |  | ||||||
| import numpy as np |  | ||||||
| import struct |  | ||||||
| 
 |  | ||||||
| # sudo pip install git+git://github.com/mikeboers/PyAV.git |  | ||||||
| import av |  | ||||||
| 
 |  | ||||||
| import cereal.messaging as messaging |  | ||||||
| from cereal.services import service_list |  | ||||||
| 
 |  | ||||||
| PYGAME = os.getenv("PYGAME") is not None |  | ||||||
| if PYGAME: |  | ||||||
|   import pygame |  | ||||||
|   imgff = np.zeros((874, 1164, 3), dtype=np.uint8) |  | ||||||
| 
 |  | ||||||
| # first 74 bytes in any stream |  | ||||||
| start = "0000000140010c01ffff016000000300b0000003000003005dac5900000001420101016000000300b0000003000003005da0025080381c5c665aee4c92ec80000000014401c0f1800420" |  | ||||||
| 
 |  | ||||||
| def receiver_thread(): |  | ||||||
|   if PYGAME: |  | ||||||
|     pygame.init() |  | ||||||
|     pygame.display.set_caption("vnet debug UI") |  | ||||||
|     screen = pygame.display.set_mode((1164, 874), pygame.DOUBLEBUF) |  | ||||||
|     camera_surface = pygame.surface.Surface((1164, 874), 0, 24).convert() |  | ||||||
| 
 |  | ||||||
|   addr = "192.168.5.11" |  | ||||||
|   if len(sys.argv) >= 2: |  | ||||||
|     addr = sys.argv[1] |  | ||||||
| 
 |  | ||||||
|   context = zmq.Context() |  | ||||||
|   s = messaging.sub_sock(context, 9002, addr=addr) |  | ||||||
|   frame_sock = messaging.pub_sock(context, service_list['roadCameraState'].port) |  | ||||||
| 
 |  | ||||||
|   ctx = av.codec.codec.Codec('hevc', 'r').create() |  | ||||||
|   ctx.decode(av.packet.Packet(start.decode("hex"))) |  | ||||||
| 
 |  | ||||||
|   # import time |  | ||||||
|   while 1: |  | ||||||
|     # t1 = time.time() |  | ||||||
|     ts, raw = s.recv_multipart() |  | ||||||
|     ts = struct.unpack('q', ts)[0] * 1000 |  | ||||||
|     # t1, t2 = time.time(), t1 |  | ||||||
|     #print 'ms to get frame:', (t1-t2)*1000 |  | ||||||
| 
 |  | ||||||
|     pkt = av.packet.Packet(raw) |  | ||||||
|     f = ctx.decode(pkt) |  | ||||||
|     if not f: |  | ||||||
|       continue |  | ||||||
|     f = f[0] |  | ||||||
|     # t1, t2 = time.time(), t1 |  | ||||||
|     #print 'ms to decode:', (t1-t2)*1000 |  | ||||||
| 
 |  | ||||||
|     y_plane = np.frombuffer(f.planes[0], np.uint8).reshape((874, 1216))[:, 0:1164] |  | ||||||
|     u_plane = np.frombuffer(f.planes[1], np.uint8).reshape((437, 608))[:, 0:582] |  | ||||||
|     v_plane = np.frombuffer(f.planes[2], np.uint8).reshape((437, 608))[:, 0:582] |  | ||||||
|     yuv_img = y_plane.tobytes() + u_plane.tobytes() + v_plane.tobytes() |  | ||||||
|     # t1, t2 = time.time(), t1 |  | ||||||
|     #print 'ms to make yuv:', (t1-t2)*1000 |  | ||||||
|     #print 'tsEof:', ts |  | ||||||
| 
 |  | ||||||
|     dat = messaging.new_message('roadCameraState') |  | ||||||
|     dat.roadCameraState.image = yuv_img |  | ||||||
|     dat.roadCameraState.timestampEof = ts |  | ||||||
|     dat.roadCameraState.transform = map(float, list(np.eye(3).flatten())) |  | ||||||
|     frame_sock.send(dat.to_bytes()) |  | ||||||
| 
 |  | ||||||
|     if PYGAME: |  | ||||||
|       yuv_np = np.frombuffer(yuv_img, dtype=np.uint8).reshape(874 * 3 // 2, -1) |  | ||||||
|       cv2.cvtColor(yuv_np, cv2.COLOR_YUV2RGB_I420, dst=imgff) |  | ||||||
|       #print yuv_np.shape, imgff.shape |  | ||||||
| 
 |  | ||||||
|       #scipy.misc.imsave("tmp.png", imgff) |  | ||||||
| 
 |  | ||||||
|       pygame.surfarray.blit_array(camera_surface, imgff.swapaxes(0, 1)) |  | ||||||
|       screen.blit(camera_surface, (0, 0)) |  | ||||||
|       pygame.display.flip() |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def main(gctx=None): |  | ||||||
|   receiver_thread() |  | ||||||
| 
 |  | ||||||
| if __name__ == "__main__": |  | ||||||
|   main() |  | ||||||
| @ -1,9 +0,0 @@ | |||||||
| #!/usr/bin/env python |  | ||||||
| from common.params import Params |  | ||||||
| from selfdrive.version import terms_version, training_version |  | ||||||
| 
 |  | ||||||
| if __name__ == '__main__': |  | ||||||
|   params = Params() |  | ||||||
|   params.put("HasAcceptedTerms", str(terms_version, 'utf-8')) |  | ||||||
|   params.put("CompletedTrainingVersion", str(training_version, 'utf-8')) |  | ||||||
|   print("Terms Accepted!") |  | ||||||
					Loading…
					
					
				
		Reference in new issue