Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this should error because of writing to /data #300

Closed
wants to merge 20 commits into from
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
- docker

install:
- docker build -t tmppilot -f Dockerfile.openpilot .
- travis_wait 30 docker build -t tmppilot -f Dockerfile.openpilot .

script:
- docker run
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.openpilot
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apt-get update && apt-get install -y \
ocl-icd-opencl-dev \
opencl-headers

RUN pip install --upgrade pip
RUN pip install numpy==1.11.2 scipy==0.18.1 matplotlib==2.1.2

COPY requirements_openpilot.txt /tmp/
Expand Down
12 changes: 10 additions & 2 deletions selfdrive/controls/lib/longcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,20 @@ def dynamic_gas(self, v_ego, v_rel, d_rel, gasinterceptor, gasbuttonstatus):
accel = interp(v_ego, x, y)

if dynamic and v_rel is not None: # dynamic gas profile specific operations, and if lead
if (v_ego) < 6.7056: # if under 15 mph
with open("/data/long_vrel", "a") as f:
f.write(str(v_rel)+"\n")
if v_ego < 6.7056: # if under 15 mph
x = [1.61479, 1.99067, 2.28537, 2.49888, 2.6312, 2.68224]
y = [-accel, -(accel / 1.06), -(accel / 1.2), -(accel / 1.8), -(accel / 4.4), 0] # array that matches current chosen accel value
accel += interp(v_rel, x, y)
with open("/data/long_accel", "a") as f:
f.write(str(accel)+"\n")
else:
x = [-0.89408, 0, 0.89408, 4.4704]
y = [-.15, -.05, .005, .05]
accel += interp(v_rel, x, y)

with open("/data/long_accel", "a") as f:
f.write(str(accel)+"\n")

min_return = 0.0
max_return = 1.0
Expand All @@ -138,6 +143,9 @@ def update(self, active, v_ego, brake_pressed, standstill, cruise_standstill, v_
vRel = None
dRel = None

with open("/data/long_test", "a") as f:
f.write(str(vRel)+"\n")

#gas_max = interp(v_ego, CP.gasMaxBP, CP.gasMaxV)
gas_max = self.dynamic_gas(v_ego, vRel, dRel, gasinterceptor, gasbuttonstatus)
brake_max = interp(v_ego, CP.brakeMaxBP, CP.brakeMaxV)
Expand Down