mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
openpilot v0.5.11 release
This commit is contained in:
@@ -8,7 +8,7 @@ class Maneuver(object):
|
||||
# Was tempted to make a builder class
|
||||
self.distance_lead = kwargs.get("initial_distance_lead", 200.0)
|
||||
self.speed = kwargs.get("initial_speed", 0.0)
|
||||
self.lead_relevancy = kwargs.get("lead_relevancy", 0)
|
||||
self.lead_relevancy = kwargs.get("lead_relevancy", 0)
|
||||
|
||||
self.grade_values = kwargs.get("grade_values", [0.0, 0.0])
|
||||
self.grade_breakpoints = kwargs.get("grade_breakpoints", [0.0, duration])
|
||||
@@ -37,8 +37,8 @@ class Maneuver(object):
|
||||
while buttons_sorted and plant.current_time() >= buttons_sorted[0][1]:
|
||||
current_button = buttons_sorted[0][0]
|
||||
buttons_sorted = buttons_sorted[1:]
|
||||
print "current button changed to", current_button
|
||||
|
||||
print("current button changed to {0}".format(current_button))
|
||||
|
||||
grade = np.interp(plant.current_time(), self.grade_breakpoints, self.grade_values)
|
||||
speed_lead = np.interp(plant.current_time(), self.speed_lead_breakpoints, self.speed_lead_values)
|
||||
|
||||
@@ -46,11 +46,11 @@ class Maneuver(object):
|
||||
if live100:
|
||||
last_live100 = live100[-1]
|
||||
|
||||
d_rel = distance_lead - distance if self.lead_relevancy else 200.
|
||||
v_rel = speed_lead - speed if self.lead_relevancy else 0.
|
||||
d_rel = distance_lead - distance if self.lead_relevancy else 200.
|
||||
v_rel = speed_lead - speed if self.lead_relevancy else 0.
|
||||
|
||||
if last_live100:
|
||||
# print last_live100
|
||||
# print(last_live100)
|
||||
#develop plots
|
||||
plot.add_data(
|
||||
time=plant.current_time(),
|
||||
@@ -64,8 +64,8 @@ class Maneuver(object):
|
||||
jerk_factor=last_live100.jerkFactor,
|
||||
a_target=last_live100.aTarget,
|
||||
fcw=fcw)
|
||||
|
||||
print "maneuver end"
|
||||
|
||||
print("maneuver end")
|
||||
|
||||
return (None, plot)
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ class Plant(object):
|
||||
|
||||
# print at 5hz
|
||||
if (self.rk.frame%(self.rate/5)) == 0:
|
||||
print "%6.2f m %6.2f m/s %6.2f m/s2 %.2f ang gas: %.2f brake: %.2f steer: %5.2f lead_rel: %6.2f m %6.2f m/s" % (distance, speed, acceleration, self.angle_steer, gas, brake, steer_torque, d_rel, v_rel)
|
||||
print("%6.2f m %6.2f m/s %6.2f m/s2 %.2f ang gas: %.2f brake: %.2f steer: %5.2f lead_rel: %6.2f m %6.2f m/s" % (distance, speed, acceleration, self.angle_steer, gas, brake, steer_torque, d_rel, v_rel))
|
||||
|
||||
# ******** publish the car ********
|
||||
vls_tuple = namedtuple('vls', [
|
||||
|
||||
@@ -75,7 +75,7 @@ if __name__ == "__main__":
|
||||
|
||||
car_pts = map(pt_to_car, control_pts)
|
||||
|
||||
print car_pts
|
||||
print(car_pts)
|
||||
|
||||
car_poly = np.polyfit([x[0] for x in car_pts], [x[1] for x in car_pts], 3)
|
||||
md.model.path.points = np.polyval(car_poly, np.arange(0, 50)).tolist()
|
||||
@@ -90,9 +90,9 @@ if __name__ == "__main__":
|
||||
cary += plant.speed * plant.ts * math.sin(heading)
|
||||
|
||||
# positive steering angle = steering right
|
||||
print plant.angle_steer
|
||||
print(plant.angle_steer)
|
||||
heading += plant.angle_steer * plant.ts
|
||||
print heading
|
||||
print(heading)
|
||||
|
||||
# draw my car
|
||||
display.blit(pygame.transform.rotate(car, 90-math.degrees(heading)), (carx*METER, cary*METER))
|
||||
|
||||
@@ -53,16 +53,16 @@ for idx1, f1 in enumerate(fingerprints_flat):
|
||||
for idx2, f2 in enumerate(fingerprints_flat):
|
||||
if idx1 < idx2 and not check_fingerprint_consistency(f1, f2):
|
||||
valid = False
|
||||
print "Those two fingerprints are inconsistent", car_names[idx1], car_names[idx2]
|
||||
print ""
|
||||
print ', '.join("%d: %d" % v for v in sorted(f1.items()))
|
||||
print ""
|
||||
print ', '.join("%d: %d" % v for v in sorted(f2.items()))
|
||||
print ""
|
||||
print("Those two fingerprints are inconsistent {0} {1}".format(car_names[idx1], car_names[idx2]))
|
||||
print("")
|
||||
print(', '.join("%d: %d" % v for v in sorted(f1.items())))
|
||||
print("")
|
||||
print(', '.join("%d: %d" % v for v in sorted(f2.items())))
|
||||
print("")
|
||||
|
||||
print "Found ", len(fingerprints_flat), " individual fingerprints"
|
||||
print("Found {0} individual fingerprints".format(len(fingerprints_flat)))
|
||||
if not valid or len(fingerprints_flat) == 0:
|
||||
print "TEST FAILED"
|
||||
print("TEST FAILED")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "TEST SUCESSFUL"
|
||||
print("TEST SUCESSFUL")
|
||||
|
||||
@@ -63,25 +63,25 @@ def with_processes(processes):
|
||||
@phone_only
|
||||
@with_processes(['loggerd', 'logmessaged', 'tombstoned', 'proclogd', 'logcatd'])
|
||||
def test_logging():
|
||||
print "LOGGING IS SET UP"
|
||||
print("LOGGING IS SET UP")
|
||||
time.sleep(1.0)
|
||||
|
||||
@phone_only
|
||||
@with_processes(['visiond'])
|
||||
def test_visiond():
|
||||
print "VISIOND IS SET UP"
|
||||
print("VISIOND IS SET UP")
|
||||
time.sleep(5.0)
|
||||
|
||||
@phone_only
|
||||
@with_processes(['sensord'])
|
||||
def test_sensord():
|
||||
print "SENSORS ARE SET UP"
|
||||
print("SENSORS ARE SET UP")
|
||||
time.sleep(1.0)
|
||||
|
||||
@phone_only
|
||||
@with_processes(['ui'])
|
||||
def test_ui():
|
||||
print "RUNNING UI"
|
||||
print("RUNNING UI")
|
||||
time.sleep(1.0)
|
||||
|
||||
# will have one thing to upload if loggerd ran
|
||||
@@ -89,5 +89,5 @@ def test_ui():
|
||||
@phone_only
|
||||
@with_processes(['uploader'])
|
||||
def test_uploader():
|
||||
print "UPLOADER"
|
||||
print("UPLOADER")
|
||||
time.sleep(10.0)
|
||||
|
||||
Reference in New Issue
Block a user