wip
This commit is contained in:
@@ -22,6 +22,9 @@ class CanBus(CanBusBase):
|
|||||||
self._e += self.offset
|
self._e += self.offset
|
||||||
self._cam = 2 + self.offset
|
self._cam = 2 + self.offset
|
||||||
|
|
||||||
|
self.params = Params()
|
||||||
|
self.params_memory = Params("/dev/shm/params")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ECAN(self):
|
def ECAN(self):
|
||||||
return self._e
|
return self._e
|
||||||
@@ -119,18 +122,19 @@ def create_acc_cancel(packer, CP, CAN, cruise_info_copy):
|
|||||||
values.update({
|
values.update({
|
||||||
"ACCMode": 4,
|
"ACCMode": 4,
|
||||||
"aReqRaw": 0.0,
|
"aReqRaw": 0.0,
|
||||||
"aReqValue": 0.0,
|
"aReqVClearpalue": 0.0,
|
||||||
})
|
})
|
||||||
return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values)
|
return packer.make_can_msg("SCC_CONTROL", CAN.ECAN, values)
|
||||||
|
|
||||||
# CLEARPILOT changed HDA icons
|
# CLEARPILOT changed HDA icons
|
||||||
# This doesn't appear to do anything on my tucson
|
# This doesn't appear to do anything on my tucson
|
||||||
def create_lfahda_cluster(packer, CAN, enabled, lat_active):
|
def create_lfahda_cluster(packer, CAN, enabled, lat_active):
|
||||||
|
no_lat_lane_change = self.params_memory.get_int("no_lat_lane_change", 1)
|
||||||
values = {
|
values = {
|
||||||
# 0 off, 1 gray, 2 green, 3 blinking (wheel icon)
|
# 0 off, 1 gray, 2 green, 3 blinking (wheel icon)
|
||||||
# CP: Is this actually the wheel? Might this be the HDA2 thing?
|
# CP: Is this actually the wheel? Might this be the HDA2 thing?
|
||||||
"HDA_ICON": 0, # Intention is to have this represent stock HDA mode
|
"HDA_ICON": 0, # Intention is to have this represent stock HDA mode
|
||||||
"LFA_ICON": 2 if enabled else 1 if lat_active else 0,
|
"LFA_ICON": 0 if no_lat_lane_change else 2 if enabled else 1 if lat_active else 0,
|
||||||
}
|
}
|
||||||
return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values)
|
return packer.make_can_msg("LFAHDA_CLUSTER", CAN.ECAN, values)
|
||||||
|
|
||||||
|
|||||||
@@ -641,7 +641,6 @@ class Controls:
|
|||||||
if model_v2.meta.laneChangeState == LaneChangeState.laneChangeStarting and clearpilot_disable_lat_on_lane_change:
|
if model_v2.meta.laneChangeState == LaneChangeState.laneChangeStarting and clearpilot_disable_lat_on_lane_change:
|
||||||
CC.latActive = False
|
CC.latActive = False
|
||||||
self.params_memory.put_int("no_lat_lane_change", 1)
|
self.params_memory.put_int("no_lat_lane_change", 1)
|
||||||
# self.params_memory.put_int("CurrentRandomEvent", 1)
|
|
||||||
else:
|
else:
|
||||||
self.params_memory.put_int("no_lat_lane_change", 0)
|
self.params_memory.put_int("no_lat_lane_change", 0)
|
||||||
|
|
||||||
|
|||||||
@@ -910,9 +910,9 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
|
|||||||
// edge_gradient.setColorAt(0.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255)));
|
// edge_gradient.setColorAt(0.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255)));
|
||||||
// edge_gradient.setColorAt(0.5, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.5)));
|
// edge_gradient.setColorAt(0.5, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.5)));
|
||||||
// edge_gradient.setColorAt(1.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.1)));
|
// edge_gradient.setColorAt(1.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(OTHER_LANE_ALPHA * 255 * 0.1)));
|
||||||
edge_gradient.setColorAt(0.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(255)));
|
edge_gradient.setColorAt(0.0, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255)));
|
||||||
edge_gradient.setColorAt(0.5, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(255 * 0.5)));
|
edge_gradient.setColorAt(0.5, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255 * 0.7) ));
|
||||||
edge_gradient.setColorAt(1.0, QColor(test_color.red(), test_color.green(), test_color.blue(), static_cast<int>(255 * 0.3)));
|
edge_gradient.setColorAt(1.0, QColor(bg.red(), bg.green(), bg.blue(), static_cast<int>(255 * 0.5)));
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPolygon(scene.track_vertices);
|
path.addPolygon(scene.track_vertices);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ typedef enum UIStatus {
|
|||||||
} UIStatus;
|
} UIStatus;
|
||||||
|
|
||||||
// Clearpilot new alpha constants
|
// Clearpilot new alpha constants
|
||||||
const float CENTER_LANE_ALPHA = 0.35;
|
const float CENTER_LANE_ALPHA = 0.40;
|
||||||
const float OTHER_LANE_ALPHA = 0.75;
|
const float OTHER_LANE_ALPHA = 0.75;
|
||||||
|
|
||||||
const int CENTER_LANE_WIDTH = 50;
|
const int CENTER_LANE_WIDTH = 50;
|
||||||
|
|||||||
Reference in New Issue
Block a user