From 2dcc0d8bca3f629bdd502dcd14f04e75d4a9169f Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Sun, 23 Aug 2020 21:06:13 +0930 Subject: [PATCH] Fixup dockerfile, requirements, upgrade android gradle. I'll merge this stuff in tracking for now, as there's some other stuff I'm working on and want these latest changes in. --- SwiftyCar/Sources/SwiftyCar/main.swift | 8 ++++++-- build.gradle | 2 +- pycar/Dockerfile | 11 +++++++---- pycar/requirements.txt | 3 ++- pycar/src/car/tracking/algorithms.py | 2 ++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/SwiftyCar/Sources/SwiftyCar/main.swift b/SwiftyCar/Sources/SwiftyCar/main.swift index 5dc69d6..cec54d4 100644 --- a/SwiftyCar/Sources/SwiftyCar/main.swift +++ b/SwiftyCar/Sources/SwiftyCar/main.swift @@ -18,10 +18,14 @@ func doServer() throws { try! group.syncShutdownGracefully() } - + let lidar = createLidar() + lidar.iterMeasurements{measruement in + print(measruement.quality) + return false + } // Create a provider using the features we read. let provider = try MotorProvider(vehicle: getVehicle2D()) - let trackingProvider = LidarProvider(lidar: createLidar()) + let trackingProvider = LidarProvider(lidar: lidar) // Start the server and print its address once it has started. let server = Server.insecure(group: group) diff --git a/build.gradle b/build.gradle index 60d7f78..975620b 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10' // NOTE: Do not place your application dependencies here; they belong diff --git a/pycar/Dockerfile b/pycar/Dockerfile index 3de27be..90e11c9 100644 --- a/pycar/Dockerfile +++ b/pycar/Dockerfile @@ -1,4 +1,7 @@ -FROM python:3.6-slim +FROM vato.ddns.net:8083/python:3 + +ARG PYPI_USERNAME +ARG PYPI_PASSWORD RUN apt-get update # OpenCV has a LOT of dependencies. @@ -17,14 +20,14 @@ RUN apt-get install -y \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt / -RUN pip install --trusted-host pypi.python.org -r requirements.txt +RUN pip install --index-url https://${PYPI_USERNAME}:${PYPI_PASSWORD}@vato.ddns.net/nexus/repository/pypi-grouped/simple -r requirements.txt WORKDIR /app -COPY . /app +COPY ./src /app # We aren't listening, just connecting, so probs won't need this. # EXPOSE 1883 ENV PYTHONPATH=/app -CMD ["python", "DecisionSystem/CentralisedDecision/cameraserver.py", "-V", "/app/HandRecognitionMacbookFixed.mp4"] \ No newline at end of file +CMD ["python", "-m", "car"] \ No newline at end of file diff --git a/pycar/requirements.txt b/pycar/requirements.txt index f27a941..4938578 100644 --- a/pycar/requirements.txt +++ b/pycar/requirements.txt @@ -1,9 +1,10 @@ numpy opencv-python six +wheel paho-mqtt u-msgpack-python grpcio-tools rplidar +breezyslam pyzmq -wheel \ No newline at end of file diff --git a/pycar/src/car/tracking/algorithms.py b/pycar/src/car/tracking/algorithms.py index db8f35b..5120bc7 100644 --- a/pycar/src/car/tracking/algorithms.py +++ b/pycar/src/car/tracking/algorithms.py @@ -221,6 +221,8 @@ def assign_groups_II(prev_groups, new_groups): # TODO: Check the centres are within a certain threshold. new_groups[i].number = prev_groups[0].number + # TODO: Go through to put all groups into one (if multiple groups get same number) to avoid splits. + return new_groups