diff --git a/RELEASES.md b/RELEASES.md
index a4b2a76875..b2e7be396a 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,6 @@
+Version 0.9.3 (2023-06-XX)
+========================
+
Version 0.9.2 (2023-05-22)
========================
* New driving model
diff --git a/common/version.h b/common/version.h
index 5637029cf4..57d60e7f68 100644
--- a/common/version.h
+++ b/common/version.h
@@ -1 +1 @@
-#define COMMA_VERSION "0.9.2"
+#define COMMA_VERSION "0.9.3"
diff --git a/docs/CARS.md b/docs/CARS.md
index 383a7548f2..5abdbe7963 100644
--- a/docs/CARS.md
+++ b/docs/CARS.md
@@ -31,11 +31,11 @@ A supported vehicle is one that just works when you install a comma three. All s
|Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 FCA connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|Chrysler|Pacifica Hybrid 2019-23|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 FCA connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|comma|body|All|openpilot|0 mph|0 mph|[](##)|[](##)|None||
-|Ford|Bronco Sport 2021-22|Co-Pilot360 Assist+|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 angled mount
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 RJ45 cable (7 ft)
Buy Here ||
-|Ford|Escape 2020-22|Co-Pilot360 Assist+|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
-|Ford|Explorer 2020-22|Co-Pilot360 Assist+|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
-|Ford|Kuga 2020-22|Adaptive Cruise Control with Lane Centering|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
-|Ford|Maverick 2022-23|Co-Pilot360 Assist|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Ford|Bronco Sport 2021-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 angled mount
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Ford|Escape 2020-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Ford|Explorer 2020-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Ford|Kuga 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Ford|Maverick 2022-23|Co-Pilot360 Assist|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|Genesis|G70 2018-19|All|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 Hyundai F connector
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|Genesis|G70 2020|All|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 Hyundai F connector
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|Genesis|G80 2017|All|Stock|19 mph|37 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 Hyundai J connector
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
@@ -152,7 +152,7 @@ A supported vehicle is one that just works when you install a comma three. All s
|Lexus|RX Hybrid 2017-19|All|openpilot available[2](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
- 1 Toyota connector
Buy Here ||
|Lexus|RX Hybrid 2020-21|All|openpilot|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
- 1 Toyota connector
Buy Here ||
|Lexus|UX Hybrid 2019-22|All|openpilot|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
- 1 Toyota connector
Buy Here ||
-|Lincoln|Aviator 2021|Co-Pilot360 Plus|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
+|Lincoln|Aviator 2021|Co-Pilot360 Plus|openpilot available[1](#footnotes)|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 Ford Q3 connector
- 1 harness box
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
|MAN|eTGE 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,9](#footnotes)|0 mph|31 mph|[](##)|[](##)|View
- 1 harness box
- 1 J533 connector
- 1 long OBD-C cable
- 1 mount
- 1 USB-C coupler
Buy Here |
|
|MAN|TGE 2017-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,9](#footnotes)|0 mph|31 mph|[](##)|[](##)|View
- 1 harness box
- 1 J533 connector
- 1 long OBD-C cable
- 1 mount
- 1 USB-C coupler
Buy Here |
|
|Mazda|CX-5 2022-23|All|Stock|0 mph|0 mph|[](##)|[](##)|View
- 1 comma power v2
- 1 harness box
- 1 Mazda connector
- 1 mount
- 1 RJ45 cable (7 ft)
Buy Here ||
diff --git a/panda b/panda
index 2ed514807e..2a53833753 160000
--- a/panda
+++ b/panda
@@ -1 +1 @@
-Subproject commit 2ed514807e51f7a9c2cf160ac18a093474a0ca2b
+Subproject commit 2a538337537e6830f02565c2c36af4f886c963e4
diff --git a/selfdrive/car/ford/carcontroller.py b/selfdrive/car/ford/carcontroller.py
index 29b86f4ff6..d9a9ae6bc0 100644
--- a/selfdrive/car/ford/carcontroller.py
+++ b/selfdrive/car/ford/carcontroller.py
@@ -82,15 +82,14 @@ class CarController:
### longitudinal control ###
# send acc msg at 50Hz
if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0:
+ # Both gas and accel are in m/s^2, accel is used solely for braking
accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX)
-
gas = accel
- decel = accel < 0.0
- if accel < -0.5:
- gas = -5.0
+ if not CC.longActive or gas < CarControllerParams.MIN_GAS:
+ gas = CarControllerParams.INACTIVE_GAS
stopping = CC.actuators.longControlState == LongCtrlState.stopping
- can_sends.append(create_acc_msg(self.packer, CC.longActive, gas, accel, decel, stopping))
+ can_sends.append(create_acc_msg(self.packer, CC.longActive, gas, accel, stopping))
### ui ###
send_ui = (self.main_on_last != main_on) or (self.lkas_enabled_last != CC.latActive) or (self.steer_alert_last != steer_alert)
diff --git a/selfdrive/car/ford/fordcan.py b/selfdrive/car/ford/fordcan.py
index daf880aa82..97a8c025d4 100644
--- a/selfdrive/car/ford/fordcan.py
+++ b/selfdrive/car/ford/fordcan.py
@@ -101,7 +101,7 @@ def create_lat_ctl2_msg(packer, mode: int, path_offset: float, path_angle: float
return packer.make_can_msg("LateralMotionControl2", CANBUS.main, values)
-def create_acc_msg(packer, long_active: bool, gas: float, accel: float, decel: bool, stopping: bool):
+def create_acc_msg(packer, long_active: bool, gas: float, accel: float, stopping: bool):
"""
Creates a CAN message for the Ford ACC Command.
@@ -111,11 +111,13 @@ def create_acc_msg(packer, long_active: bool, gas: float, accel: float, decel: b
Frequency is 50Hz.
"""
+ decel = accel < 0 and long_active
values = {
"AccBrkTot_A_Rq": accel, # Brake total accel request: [-20|11.9449] m/s^2
"Cmbb_B_Enbl": 1 if long_active else 0, # Enabled: 0=No, 1=Yes
"AccPrpl_A_Rq": gas, # Acceleration request: [-5|5.23] m/s^2
"AccResumEnbl_B_Rq": 1 if long_active else 0,
+ # TODO: we may be able to improve braking response by utilizing pre-charging better
"AccBrkPrchg_B_Rq": 1 if decel else 0, # Pre-charge brake request: 0=No, 1=Yes
"AccBrkDecel_B_Rq": 1 if decel else 0, # Deceleration request: 0=Inactive, 1=Active
"AccStopStat_B_Rq": 1 if stopping else 0,
diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py
index 937980899f..626853dd8f 100644
--- a/selfdrive/car/ford/interface.py
+++ b/selfdrive/car/ford/interface.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
from cereal import car
+from panda import Panda
from common.conversions import Conversions as CV
from selfdrive.car import STD_CARGO_KG, get_safety_config
from selfdrive.car.ford.values import CAR, Ecu
@@ -25,6 +26,11 @@ class CarInterface(CarInterfaceBase):
ret.steerActuatorDelay = 0.2
ret.steerLimitTimer = 1.0
+ ret.experimentalLongitudinalAvailable = True
+ if experimental_long:
+ ret.safetyConfigs[0].safetyParam |= Panda.FLAG_FORD_LONG_CONTROL
+ ret.openpilotLongitudinalControl = True
+
if candidate == CAR.BRONCO_SPORT_MK1:
ret.wheelbase = 2.67
ret.steerRatio = 17.7
diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py
index 82cc23b05b..4ba07f0c80 100644
--- a/selfdrive/car/ford/values.py
+++ b/selfdrive/car/ford/values.py
@@ -31,6 +31,8 @@ class CarControllerParams:
ACCEL_MAX = 2.0 # m/s^s max acceleration
ACCEL_MIN = -3.5 # m/s^s max deceleration
+ MIN_GAS = -0.5
+ INACTIVE_GAS = -5.0
def __init__(self, CP):
pass
diff --git a/selfdrive/navd/map_renderer.cc b/selfdrive/navd/map_renderer.cc
index 203470bb42..5c7e17cd51 100644
--- a/selfdrive/navd/map_renderer.cc
+++ b/selfdrive/navd/map_renderer.cc
@@ -15,7 +15,9 @@ const int HEIGHT = 256, WIDTH = 256;
const int NUM_VIPC_BUFFERS = 4;
const int EARTH_CIRCUMFERENCE_METERS = 40075000;
+const int EARTH_RADIUS_METERS = 6378137;
const int PIXELS_PER_TILE = 256;
+const int MAP_OFFSET = 128;
const bool TEST_MODE = getenv("MAP_RENDER_TEST_MODE");
const int LLK_DECIMATION = TEST_MODE ? 1 : 10;
@@ -26,6 +28,14 @@ float get_zoom_level_for_scale(float lat, float meters_per_pixel) {
return log2(num_tiles) - 1;
}
+QMapbox::Coordinate get_point_along_line(float lat, float lon, float bearing, float dist) {
+ float ang_dist = dist / EARTH_RADIUS_METERS;
+ float lat1 = DEG2RAD(lat), lon1 = DEG2RAD(lon), bearing1 = DEG2RAD(bearing);
+ float lat2 = asin(sin(lat1)*cos(ang_dist) + cos(lat1)*sin(ang_dist)*cos(bearing1));
+ float lon2 = lon1 + atan2(sin(bearing1)*sin(ang_dist)*cos(lat1), cos(ang_dist)-sin(lat1)*sin(lat2));
+ return QMapbox::Coordinate(RAD2DEG(lat2), RAD2DEG(lon2));
+}
+
MapRenderer::MapRenderer(const QMapboxGLSettings &settings, bool online) : m_settings(settings) {
QSurfaceFormat fmt;
@@ -70,7 +80,7 @@ MapRenderer::MapRenderer(const QMapboxGLSettings &settings, bool online) : m_set
if (online) {
vipc_server.reset(new VisionIpcServer("navd"));
- vipc_server->create_buffers(VisionStreamType::VISION_STREAM_MAP, NUM_VIPC_BUFFERS, false, WIDTH/2, HEIGHT/2);
+ vipc_server->create_buffers(VisionStreamType::VISION_STREAM_MAP, NUM_VIPC_BUFFERS, false, WIDTH, HEIGHT);
vipc_server->start_listener();
pm.reset(new PubMaster({"navThumbnail", "mapRenderState"}));
@@ -93,7 +103,8 @@ void MapRenderer::msgUpdate() {
bool localizer_valid = (location.getStatus() == cereal::LiveLocationKalman::Status::VALID) && pos.getValid();
if (localizer_valid && (sm->rcv_frame("liveLocationKalman") % LLK_DECIMATION) == 0) {
- updatePosition(QMapbox::Coordinate(pos.getValue()[0], pos.getValue()[1]), RAD2DEG(orientation.getValue()[2]));
+ float bearing = RAD2DEG(orientation.getValue()[2]);
+ updatePosition(get_point_along_line(pos.getValue()[0], pos.getValue()[1], bearing, MAP_OFFSET), bearing);
// TODO: use the static rendering mode
if (!loaded() && frame_id > 0) {
diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit
index 4dee64009f..310d6300d2 100644
--- a/selfdrive/test/process_replay/ref_commit
+++ b/selfdrive/test/process_replay/ref_commit
@@ -1 +1 @@
-658e4dd36d92ae7a973a090aaf3fab62fdf701b6
+c67a0959201829ef07a7d68d5fb59603b3983587