diff --git a/.clang-format b/.clang-format index 511853d..ca32094 100644 --- a/.clang-format +++ b/.clang-format @@ -1,25 +1,37 @@ -# .clang-format BasedOnStyle: Google IndentWidth: 4 +ContinuationIndentWidth: 4 ColumnLimit: 100 + DerivePointerAlignment: false PointerAlignment: Left SortIncludes: CaseSensitive -AllowShortFunctionsOnASingleLine: InlineOnly +BreakStringLiterals: false + +AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AllowShortBlocksOnASingleLine: Never +AllowShortLambdasOnASingleLine: Empty BinPackParameters: false BinPackArguments: false +AlignAfterOpenBracket: DontAlign + +PenaltyBreakBeforeFirstCallParameter: 100 +PenaltyBreakScopeResolution: 1000000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 1000 IncludeBlocks: Regroup IncludeCategories: - - Regex: '^"(.*/)?[^/"]+\.hpp"$' - Priority: 1 - - Regex: '^<.*>' - Priority: 2 + - Regex: '^"(.*/)?[^/"]+\.hpp"$' + Priority: 1 + - Regex: "^" + Priority: 2 + - Regex: "^<.*>" + Priority: 3 -IncludeIsMainRegex: '([-_](test|unittest))?$' -IncludeIsMainSourceRegex: '(\.cpp|\.cc|\.cxx)$' \ No newline at end of file +IncludeIsMainRegex: "([-_](test|unittest))?$" +IncludeIsMainSourceRegex: '(\.cpp|\.cc|\.cxx)$' diff --git a/dash/assets/fonts/Lato-Black.ttf b/dash/assets/fonts/Lato-Black.ttf new file mode 100644 index 0000000..4340502 Binary files /dev/null and b/dash/assets/fonts/Lato-Black.ttf differ diff --git a/dash/assets/fonts/Lato-BlackItalic.ttf b/dash/assets/fonts/Lato-BlackItalic.ttf new file mode 100644 index 0000000..4df1555 Binary files /dev/null and b/dash/assets/fonts/Lato-BlackItalic.ttf differ diff --git a/dash/assets/fonts/Lato-Bold.ttf b/dash/assets/fonts/Lato-Bold.ttf new file mode 100644 index 0000000..016068b Binary files /dev/null and b/dash/assets/fonts/Lato-Bold.ttf differ diff --git a/dash/assets/fonts/Lato-BoldItalic.ttf b/dash/assets/fonts/Lato-BoldItalic.ttf new file mode 100644 index 0000000..a05d503 Binary files /dev/null and b/dash/assets/fonts/Lato-BoldItalic.ttf differ diff --git a/dash/assets/fonts/Lato-Italic.ttf b/dash/assets/fonts/Lato-Italic.ttf new file mode 100644 index 0000000..0d0f69e Binary files /dev/null and b/dash/assets/fonts/Lato-Italic.ttf differ diff --git a/dash/assets/fonts/Lato-Light.ttf b/dash/assets/fonts/Lato-Light.ttf new file mode 100644 index 0000000..dfa72ce Binary files /dev/null and b/dash/assets/fonts/Lato-Light.ttf differ diff --git a/dash/assets/fonts/Lato-LightItalic.ttf b/dash/assets/fonts/Lato-LightItalic.ttf new file mode 100644 index 0000000..12f2b6c Binary files /dev/null and b/dash/assets/fonts/Lato-LightItalic.ttf differ diff --git a/dash/assets/fonts/Lato-Regular.ttf b/dash/assets/fonts/Lato-Regular.ttf new file mode 100644 index 0000000..bb2e887 Binary files /dev/null and b/dash/assets/fonts/Lato-Regular.ttf differ diff --git a/dash/assets/fonts/Lato-Thin.ttf b/dash/assets/fonts/Lato-Thin.ttf new file mode 100644 index 0000000..ba58da1 Binary files /dev/null and b/dash/assets/fonts/Lato-Thin.ttf differ diff --git a/dash/assets/fonts/Lato-ThinItalic.ttf b/dash/assets/fonts/Lato-ThinItalic.ttf new file mode 100644 index 0000000..4d82766 Binary files /dev/null and b/dash/assets/fonts/Lato-ThinItalic.ttf differ diff --git a/dash/assets/fonts/OFL.txt b/dash/assets/fonts/OFL.txt new file mode 100644 index 0000000..cb1d5af --- /dev/null +++ b/dash/assets/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/dash/assets/shaders/background.frag b/dash/assets/shaders/background.frag new file mode 100644 index 0000000..7ab33da --- /dev/null +++ b/dash/assets/shaders/background.frag @@ -0,0 +1,48 @@ +#version 300 es +precision highp float; + +out vec4 FragColor; + +in vec3 v_color; +in vec3 v_normal; +in vec3 v_position; +in vec2 v_uv; +in vec3 v_cameraPosition; +in vec3 v_cameraDirection; + +uniform sampler2D u_albedo; // optional, can be ignored if not used +uniform float u_timeMs; + +float hash(vec2 p) { + p = fract(p * vec2(123.34, 456.21)); + p += dot(p, p + 45.32); + return fract(p.x * p.y); +} + +void main() +{ + float t = u_timeMs * 0.001f; + + vec2 scrollDir = normalize(vec2(-1.0, -1.0)); + float scrollSpeed = 0.05f; // UV units per second + + vec2 sampleUV = v_uv + scrollDir * t * scrollSpeed; + vec4 texColor = texture(u_albedo, sampleUV); + vec3 baseColor = v_color * texColor.rgb; + + vec4 bgA = vec4(0.2941f, 0.2706f, 0.2667f, 1.0f); + vec4 bgB = vec4(0.1725f, 0.1569f, 0.1529f, 1.0f); + + vec2 dir = normalize(vec2(1.0, -1.0)); + float s = dot(v_uv - vec2(0.0, 1.0), dir) + / dot(vec2(1.0, -1.0), dir); + + vec4 bgColor = mix(bgA, bgB, s); + + // screen-space dithering + float noise = hash(gl_FragCoord.xy) - 0.5; + bgColor.rgb += noise / 255.0; + + FragColor = mix(bgColor, texColor, texColor.a); + // FragColor = vec4(sampleUV.x, sampleUV.y, 0.0f, 1.0f); +} diff --git a/dash/assets/shaders/background.vert b/dash/assets/shaders/background.vert new file mode 100644 index 0000000..e642228 --- /dev/null +++ b/dash/assets/shaders/background.vert @@ -0,0 +1,37 @@ +#version 300 es +precision highp float; + +// position, normal, color, uv + +layout(location = 0) in vec3 a_pos; +layout(location = 1) in vec3 a_normal; +layout(location = 2) in vec4 a_color; +layout(location = 3) in vec2 a_uv; + +uniform mat4 u_modelMatrix; +uniform mat4 u_viewMatrix; +uniform mat4 u_projectionMatrix; +uniform vec3 u_cameraPosition; +uniform vec3 u_cameraDirection; +uniform vec3 u_color; + +out vec3 v_color; +out vec3 v_normal; +out vec3 v_position; +out vec2 v_uv; +out vec3 v_cameraPosition; +out vec3 v_cameraDirection; + +void main() { + // Purposefully omitting the view matrix btw + mat4 mvp = u_projectionMatrix * u_modelMatrix; + vec4 pos = mvp * vec4(a_pos, 1.0f); + gl_Position = pos; + + v_color = u_color; + v_normal = a_normal; + v_position = a_pos; + v_uv = a_uv; + v_cameraPosition = u_cameraPosition; + v_cameraDirection = u_cameraDirection; +} diff --git a/dash/assets/shaders/battery.frag b/dash/assets/shaders/battery.frag new file mode 100644 index 0000000..40de80f --- /dev/null +++ b/dash/assets/shaders/battery.frag @@ -0,0 +1,41 @@ +#version 300 es +precision highp float; + +out vec4 FragColor; + +in vec4 v_color; +in vec2 v_uv; + +uniform sampler2D u_albedo; + +uniform float u_percent; +uniform vec4 u_barColor; +uniform vec4 u_bgColor; + +// Alpha-over compositing assuming dst is already the element below +vec4 alphaOver(vec4 dst, vec4 src) { + return vec4( + mix(dst.rgb, src.rgb, src.a), + dst.a + src.a * (1.0 - dst.a) + ); +} + +void main() { + vec4 texColor = texture(u_albedo, v_uv) * v_color; + float whiteMask = texColor.r * texColor.g * texColor.b; + + float percent = clamp(u_percent, 0.0, 1.0); + float filled = step(v_uv.x, percent); + + vec4 barRegionColor = mix(u_bgColor, u_barColor, filled); + + vec4 maskedBarColor = vec4( + barRegionColor.rgb, + barRegionColor.a * whiteMask + ); + + vec4 color = vec4(0.0); + color = alphaOver(color, maskedBarColor); + + FragColor = color; +} diff --git a/dash/assets/shaders/battery.vert b/dash/assets/shaders/battery.vert new file mode 100644 index 0000000..27c96d8 --- /dev/null +++ b/dash/assets/shaders/battery.vert @@ -0,0 +1,37 @@ +#version 300 es +precision highp float; + +// position, normal, color, uv + +layout(location = 0) in vec3 a_pos; +layout(location = 1) in vec3 a_normal; +layout(location = 2) in vec4 a_color; +layout(location = 3) in vec2 a_uv; + +uniform mat4 u_modelMatrix; +uniform mat4 u_viewMatrix; +uniform mat4 u_projectionMatrix; +uniform vec3 u_cameraPosition; +uniform vec3 u_cameraDirection; +uniform vec4 u_color; + +out vec4 v_color; +out vec3 v_normal; +out vec3 v_position; +out vec2 v_uv; +out vec3 v_cameraPosition; +out vec3 v_cameraDirection; + + +void main() { + mat4 mvp = u_projectionMatrix * u_viewMatrix * u_modelMatrix; + vec4 pos = mvp * vec4(a_pos, 1.0f); + gl_Position = pos; + + v_color = u_color; + v_normal = a_normal; + v_position = a_pos; + v_uv = a_uv; + v_cameraPosition = u_cameraPosition; + v_cameraDirection = u_cameraDirection; +} diff --git a/dash/assets/shaders/speedometer.frag b/dash/assets/shaders/speedometer.frag new file mode 100644 index 0000000..fb3aef7 --- /dev/null +++ b/dash/assets/shaders/speedometer.frag @@ -0,0 +1,143 @@ +#version 300 es +precision highp float; + +out vec4 FragColor; + +in vec4 v_color; +in vec2 v_uv; + +uniform sampler2D u_albedo; +uniform float u_angle; +uniform float u_trailRads; +uniform vec4 u_trailColor; +uniform vec4 u_needleColor; +uniform vec4 u_bgColor; + +const float TAU = 6.28318530718; + +// Dial shape config +const float OUTER_RADIUS = 0.5f; +const float INNER_CIRCLE_RADIUS = 0.1f; +const float BLEND_RADIUS = 0.3f; + +// Needle config +const float NEEDLE_HALF_WIDTH = 0.009; +const float NEEDLE_EDGE_SOFTNESS = 0.004; + +float wrapAngle(float a) { + return mod(a + TAU, TAU); +} + +// Distance from fragAngle to endAngle going backwards around the dial +// 0 means fragment is exactly at the current needle angle +// u_trailRads means fragment is at the end of the trail +float backwardAngularDistance(float fragAngle, float endAngle) { + return mod(endAngle - fragAngle + TAU, TAU); +} + +// Alpha-over compositing assuming dst is already the element below +vec4 alphaOver(vec4 dst, vec4 src) { + return vec4( + mix(dst.rgb, src.rgb, src.a), + dst.a + src.a * (1.0 - dst.a) + ); +} + +// 0 inside the inner circle, smoothly rises to 1 outside it, +// and 0 again outside the outer radius. +float computeRadialAlpha(float len) { + if (len > OUTER_RADIUS) { + return 0.0; + } + + return smoothstep( + INNER_CIRCLE_RADIUS, + INNER_CIRCLE_RADIUS + BLEND_RADIUS, + len + ); +} + +float computeTrailAlpha(float len, float fragAngle, float endAngle) { + float radialAlpha = computeRadialAlpha(len); + + if (radialAlpha <= 0.0) { + return 0.0; + } + + float dist = backwardAngularDistance(fragAngle, endAngle); + + if (dist > u_trailRads) { + return 0.0; + } + + float angularAlpha = 1.0 - smoothstep(0.0, u_trailRads, dist); + + return angularAlpha * radialAlpha; +} + +float computeNeedleAlpha(vec2 p, float len, float endAngle) { + if (len > OUTER_RADIUS) { + return 0.0; + } + + vec2 needleDir = vec2(cos(endAngle), sin(endAngle)); + + // Distance along the needle axis + float alongNeedle = dot(p, needleDir); + + // Only draw the needle from the inner circle outward + if (alongNeedle < INNER_CIRCLE_RADIUS || alongNeedle > OUTER_RADIUS) { + return 0.0; + } + + // Perpendicular distance from the point to the needle centerline + float perpDist = abs(p.x * needleDir.y - p.y * needleDir.x); + + // Soft edge for antialiasing + float alpha = 1.0 - smoothstep( + NEEDLE_HALF_WIDTH - NEEDLE_EDGE_SOFTNESS, + NEEDLE_HALF_WIDTH, + perpDist + ); + + return alpha * computeRadialAlpha(len); +} + +vec4 computeNeedleColor(vec2 p, float len, float endAngle) { + float needleAlpha = computeNeedleAlpha(p, len, endAngle); + return vec4(u_needleColor.rgb, u_needleColor.a * needleAlpha); +} + +void main() { + vec2 p = v_uv - vec2(0.0, 0.5); + float len = length(p); + + float fragAngle = 0.0; + if (len >= 0.0001) { + fragAngle = wrapAngle(atan(p.y, p.x)); + } + + float endAngle = wrapAngle(u_angle); + + vec4 texColor = texture(u_albedo, v_uv) * v_color; + + vec4 color = u_bgColor; + + if (len > OUTER_RADIUS) { + color = vec4(0.0); + } + + // Trail + float trailAlpha = computeTrailAlpha(len, fragAngle, endAngle); + vec4 trailColor = vec4(u_trailColor.rgb, u_trailColor.a * trailAlpha); + color = alphaOver(color, trailColor); + + // Needle + vec4 needleColor = computeNeedleColor(p, len, endAngle); + color = alphaOver(color, needleColor); + + // Texture on top + color = alphaOver(color, texColor); + + FragColor = color; +} diff --git a/dash/assets/shaders/speedometer.vert b/dash/assets/shaders/speedometer.vert new file mode 100644 index 0000000..27c96d8 --- /dev/null +++ b/dash/assets/shaders/speedometer.vert @@ -0,0 +1,37 @@ +#version 300 es +precision highp float; + +// position, normal, color, uv + +layout(location = 0) in vec3 a_pos; +layout(location = 1) in vec3 a_normal; +layout(location = 2) in vec4 a_color; +layout(location = 3) in vec2 a_uv; + +uniform mat4 u_modelMatrix; +uniform mat4 u_viewMatrix; +uniform mat4 u_projectionMatrix; +uniform vec3 u_cameraPosition; +uniform vec3 u_cameraDirection; +uniform vec4 u_color; + +out vec4 v_color; +out vec3 v_normal; +out vec3 v_position; +out vec2 v_uv; +out vec3 v_cameraPosition; +out vec3 v_cameraDirection; + + +void main() { + mat4 mvp = u_projectionMatrix * u_viewMatrix * u_modelMatrix; + vec4 pos = mvp * vec4(a_pos, 1.0f); + gl_Position = pos; + + v_color = u_color; + v_normal = a_normal; + v_position = a_pos; + v_uv = a_uv; + v_cameraPosition = u_cameraPosition; + v_cameraDirection = u_cameraDirection; +} diff --git a/dash/assets/textures/bat_percent_bg.png b/dash/assets/textures/bat_percent_bg.png new file mode 100644 index 0000000..12c27fb Binary files /dev/null and b/dash/assets/textures/bat_percent_bg.png differ diff --git a/dash/assets/textures/bat_percent_over.png b/dash/assets/textures/bat_percent_over.png new file mode 100644 index 0000000..cd4549f Binary files /dev/null and b/dash/assets/textures/bat_percent_over.png differ diff --git a/dash/assets/textures/bg_pattern.png b/dash/assets/textures/bg_pattern.png new file mode 100644 index 0000000..b3ca94b Binary files /dev/null and b/dash/assets/textures/bg_pattern.png differ diff --git a/dash/assets/textures/bottom_bar.png b/dash/assets/textures/bottom_bar.png new file mode 100644 index 0000000..db89ee3 Binary files /dev/null and b/dash/assets/textures/bottom_bar.png differ diff --git a/dash/assets/textures/car.jpg b/dash/assets/textures/car.jpg new file mode 100644 index 0000000..80ba4f5 Binary files /dev/null and b/dash/assets/textures/car.jpg differ diff --git a/dash/assets/textures/error_code_bot.png b/dash/assets/textures/error_code_bot.png new file mode 100644 index 0000000..9547c50 Binary files /dev/null and b/dash/assets/textures/error_code_bot.png differ diff --git a/dash/assets/textures/error_code_mid.png b/dash/assets/textures/error_code_mid.png new file mode 100644 index 0000000..e4fc15d Binary files /dev/null and b/dash/assets/textures/error_code_mid.png differ diff --git a/dash/assets/textures/error_code_top.png b/dash/assets/textures/error_code_top.png new file mode 100644 index 0000000..5024228 Binary files /dev/null and b/dash/assets/textures/error_code_top.png differ diff --git a/dash/assets/textures/speedometer.png b/dash/assets/textures/speedometer.png new file mode 100644 index 0000000..d7238c4 Binary files /dev/null and b/dash/assets/textures/speedometer.png differ diff --git a/dash/assets/textures/speedometer.png~ b/dash/assets/textures/speedometer.png~ new file mode 100644 index 0000000..3f522e0 Binary files /dev/null and b/dash/assets/textures/speedometer.png~ differ diff --git a/dash/assets/textures/state_shape.png b/dash/assets/textures/state_shape.png new file mode 100644 index 0000000..47c0b19 Binary files /dev/null and b/dash/assets/textures/state_shape.png differ diff --git a/dash/assets/textures/temp_full.png b/dash/assets/textures/temp_full.png new file mode 100644 index 0000000..ccc4e85 Binary files /dev/null and b/dash/assets/textures/temp_full.png differ diff --git a/dash/assets/textures/title.png b/dash/assets/textures/title.png new file mode 100644 index 0000000..24324cd Binary files /dev/null and b/dash/assets/textures/title.png differ diff --git a/dash/assets/textures/top_bar.png b/dash/assets/textures/top_bar.png new file mode 100644 index 0000000..7d708c3 Binary files /dev/null and b/dash/assets/textures/top_bar.png differ diff --git a/dash/can/can_dbc.hpp b/dash/can/can_dbc.hpp index b5d3791..39c6870 100644 --- a/dash/can/can_dbc.hpp +++ b/dash/can/can_dbc.hpp @@ -40,6 +40,20 @@ static constexpr float batVoltMin{0.0}; }; // namespace pdmBatVolt +namespace pdmCoolant { + +inline CAN_Signal_FLOAT coolant1Volt = MakeSignalSigned(float, 0, 16, 0.01, 0.0, false); +inline CAN_Signal_FLOAT coolant2Volt = MakeSignalSigned(float, 16, 16, 0.01, 0.0, false); +inline CAN_Signal_FLOAT coolant3Volt = MakeSignalSigned(float, 32, 16, 0.01, 0.0, false); +inline RX_CAN_Message(3) message{ + driveBus, 0x2A3, false, 6, coolant1Volt, coolant2Volt, coolant3Volt}; + +static constexpr float coolant1VoltMin{0.0}; +static constexpr float coolant2VoltMin{0.0}; +static constexpr float coolant3VoltMin{0.0}; + +}; // namespace pdmCoolant + namespace frontRightInverterMotorStatus { inline CAN_Signal_INT16 rpm = MakeSignalSigned(int16_t, 0, 16, 1.0, 0.0, false); @@ -306,14 +320,14 @@ inline CAN_Signal_BOOL bppcImp = MakeSignalSigned(bool, 16, 8, 1.0, 0.0, false); inline CAN_Signal_BOOL brakeInvalidImp = MakeSignalSigned(bool, 24, 8, 1.0, 0.0, false); inline CAN_Signal_BOOL appssInvalidImp = MakeSignalSigned(bool, 32, 8, 1.0, 0.0, false); inline RX_CAN_Message(5) message{driveBus, - 0x204, - false, - 5, - implausibilityPresent, - appssDisagreementImp, - bppcImp, - brakeInvalidImp, - appssInvalidImp}; + 0x204, + false, + 5, + implausibilityPresent, + appssDisagreementImp, + bppcImp, + brakeInvalidImp, + appssInvalidImp}; }; // namespace ecuImplausibility @@ -352,13 +366,13 @@ inline CAN_Signal_UINT8 rearPumpDutyCycle = MakeSignalExp(uint8_t, 8, 8, 1.0, 0. inline CAN_Signal_UINT8 frontFanDutyCycle = MakeSignalExp(uint8_t, 16, 8, 1.0, 0.0); inline CAN_Signal_UINT8 rearFanDutyCycle = MakeSignalExp(uint8_t, 24, 8, 1.0, 0.0); inline RX_CAN_Message(4) message{driveBus, - 0x209, - false, - 4, - frontPumpDutyCycle, - rearPumpDutyCycle, - frontFanDutyCycle, - rearFanDutyCycle}; + 0x209, + false, + 4, + frontPumpDutyCycle, + rearPumpDutyCycle, + frontFanDutyCycle, + rearFanDutyCycle}; static constexpr uint8_t frontPumpDutyCycleMin{0}; static constexpr uint8_t rearPumpDutyCycleMin{0}; @@ -403,14 +417,14 @@ inline CAN_Signal_FLOAT batteryVoltage = MakeSignalSigned(float, 24, 16, 0.01, 0 inline CAN_Signal_FLOAT batteryTemperature = MakeSignalSigned(float, 40, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT batteryCurrent = MakeSignalSigned(float, 48, 16, 0.01, -100.0, false); inline RX_CAN_Message(5) message{driveBus, - 0x150, - false, - 8, - maxDischargeCurrent, - maxRegenCurrent, - batteryVoltage, - batteryTemperature, - batteryCurrent}; + 0x150, + false, + 8, + maxDischargeCurrent, + maxRegenCurrent, + batteryVoltage, + batteryTemperature, + batteryCurrent}; static constexpr float maxDischargeCurrentMin{0.0}; static constexpr float maxRegenCurrentMin{0.0}; @@ -434,20 +448,20 @@ inline CAN_Signal_BOOL openWireTempFault = MakeSignalSigned(bool, 8, 1, 1.0, 0.0 inline CAN_Signal_BOOL pecFault = MakeSignalSigned(bool, 9, 1, 1.0, 0.0, false); inline CAN_Signal_UINT8 totalPecFailures = MakeSignalExp(uint8_t, 10, 8, 1.0, 0.0); inline RX_CAN_Message(11) message{driveBus, - 0x151, - false, - 3, - internalfaultSummary, - externalFault, - undervoltageFault, - overvoltageFault, - undertemperatureFault, - overtemperatureFault, - overcurrentFault, - openWireFault, - openWireTempFault, - pecFault, - totalPecFailures}; + 0x151, + false, + 3, + internalfaultSummary, + externalFault, + undervoltageFault, + overvoltageFault, + undertemperatureFault, + overtemperatureFault, + overcurrentFault, + openWireFault, + openWireTempFault, + pecFault, + totalPecFailures}; static constexpr uint8_t totalPecFailuresMin{0}; @@ -463,16 +477,16 @@ inline CAN_Signal_FLOAT maxCellVoltage = MakeSignalSigned(float, 32, 8, 0.012, 2 inline CAN_Signal_FLOAT minCellVoltage = MakeSignalSigned(float, 40, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT bmsSoc = MakeSignalSigned(float, 48, 8, 0.004, 0.0, false); inline RX_CAN_Message(7) message{driveBus, - 0x152, - false, - 7, - bmsState, - imdState, - maxCellTemp, - minCellTemp, - maxCellVoltage, - minCellVoltage, - bmsSoc}; + 0x152, + false, + 7, + bmsState, + imdState, + maxCellTemp, + minCellTemp, + maxCellVoltage, + minCellVoltage, + bmsSoc}; static constexpr uint8_t bmsStateMin{0}; static constexpr uint8_t imdStateMin{0}; @@ -495,17 +509,17 @@ inline CAN_Signal_FLOAT cellV5 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fals inline CAN_Signal_FLOAT cellV6 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset0 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x153, - false, - 8, - cellV0, - cellV1, - cellV2, - cellV3, - cellV4, - cellV5, - cellV6, - cellOcvOffset0}; + 0x153, + false, + 8, + cellV0, + cellV1, + cellV2, + cellV3, + cellV4, + cellV5, + cellV6, + cellOcvOffset0}; static constexpr float cellV0Min{0.0}; static constexpr float cellV1Min{0.0}; @@ -529,17 +543,17 @@ inline CAN_Signal_FLOAT cellV12 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV13 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset1 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x154, - false, - 8, - cellV7, - cellV8, - cellV9, - cellV10, - cellV11, - cellV12, - cellV13, - cellOcvOffset1}; + 0x154, + false, + 8, + cellV7, + cellV8, + cellV9, + cellV10, + cellV11, + cellV12, + cellV13, + cellOcvOffset1}; static constexpr float cellV7Min{0.0}; static constexpr float cellV8Min{0.0}; @@ -563,17 +577,17 @@ inline CAN_Signal_FLOAT cellV19 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV20 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset2 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x155, - false, - 8, - cellV14, - cellV15, - cellV16, - cellV17, - cellV18, - cellV19, - cellV20, - cellOcvOffset2}; + 0x155, + false, + 8, + cellV14, + cellV15, + cellV16, + cellV17, + cellV18, + cellV19, + cellV20, + cellOcvOffset2}; static constexpr float cellV14Min{0.0}; static constexpr float cellV15Min{0.0}; @@ -597,17 +611,17 @@ inline CAN_Signal_FLOAT cellV26 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV27 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset3 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x156, - false, - 8, - cellV21, - cellV22, - cellV23, - cellV24, - cellV25, - cellV26, - cellV27, - cellOcvOffset3}; + 0x156, + false, + 8, + cellV21, + cellV22, + cellV23, + cellV24, + cellV25, + cellV26, + cellV27, + cellOcvOffset3}; static constexpr float cellV21Min{0.0}; static constexpr float cellV22Min{0.0}; @@ -631,17 +645,17 @@ inline CAN_Signal_FLOAT cellV33 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV34 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset4 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x157, - false, - 8, - cellV28, - cellV29, - cellV30, - cellV31, - cellV32, - cellV33, - cellV34, - cellOcvOffset4}; + 0x157, + false, + 8, + cellV28, + cellV29, + cellV30, + cellV31, + cellV32, + cellV33, + cellV34, + cellOcvOffset4}; static constexpr float cellV28Min{0.0}; static constexpr float cellV29Min{0.0}; @@ -665,17 +679,17 @@ inline CAN_Signal_FLOAT cellV40 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV41 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset5 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x158, - false, - 8, - cellV35, - cellV36, - cellV37, - cellV38, - cellV39, - cellV40, - cellV41, - cellOcvOffset5}; + 0x158, + false, + 8, + cellV35, + cellV36, + cellV37, + cellV38, + cellV39, + cellV40, + cellV41, + cellOcvOffset5}; static constexpr float cellV35Min{0.0}; static constexpr float cellV36Min{0.0}; @@ -699,17 +713,17 @@ inline CAN_Signal_FLOAT cellV47 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV48 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset6 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x159, - false, - 8, - cellV42, - cellV43, - cellV44, - cellV45, - cellV46, - cellV47, - cellV48, - cellOcvOffset6}; + 0x159, + false, + 8, + cellV42, + cellV43, + cellV44, + cellV45, + cellV46, + cellV47, + cellV48, + cellOcvOffset6}; static constexpr float cellV42Min{0.0}; static constexpr float cellV43Min{0.0}; @@ -733,17 +747,17 @@ inline CAN_Signal_FLOAT cellV54 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV55 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset7 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15A, - false, - 8, - cellV49, - cellV50, - cellV51, - cellV52, - cellV53, - cellV54, - cellV55, - cellOcvOffset7}; + 0x15A, + false, + 8, + cellV49, + cellV50, + cellV51, + cellV52, + cellV53, + cellV54, + cellV55, + cellOcvOffset7}; static constexpr float cellV49Min{0.0}; static constexpr float cellV50Min{0.0}; @@ -767,17 +781,17 @@ inline CAN_Signal_FLOAT cellV61 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV62 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset8 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15B, - false, - 8, - cellV56, - cellV57, - cellV58, - cellV59, - cellV60, - cellV61, - cellV62, - cellOcvOffset8}; + 0x15B, + false, + 8, + cellV56, + cellV57, + cellV58, + cellV59, + cellV60, + cellV61, + cellV62, + cellOcvOffset8}; static constexpr float cellV56Min{0.0}; static constexpr float cellV57Min{0.0}; @@ -801,17 +815,17 @@ inline CAN_Signal_FLOAT cellV68 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV69 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset9 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15C, - false, - 8, - cellV63, - cellV64, - cellV65, - cellV66, - cellV67, - cellV68, - cellV69, - cellOcvOffset9}; + 0x15C, + false, + 8, + cellV63, + cellV64, + cellV65, + cellV66, + cellV67, + cellV68, + cellV69, + cellOcvOffset9}; static constexpr float cellV63Min{0.0}; static constexpr float cellV64Min{0.0}; @@ -835,17 +849,17 @@ inline CAN_Signal_FLOAT cellV75 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV76 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset10 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15D, - false, - 8, - cellV70, - cellV71, - cellV72, - cellV73, - cellV74, - cellV75, - cellV76, - cellOcvOffset10}; + 0x15D, + false, + 8, + cellV70, + cellV71, + cellV72, + cellV73, + cellV74, + cellV75, + cellV76, + cellOcvOffset10}; static constexpr float cellV70Min{0.0}; static constexpr float cellV71Min{0.0}; @@ -869,17 +883,17 @@ inline CAN_Signal_FLOAT cellV82 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV83 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset11 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15E, - false, - 8, - cellV77, - cellV78, - cellV79, - cellV80, - cellV81, - cellV82, - cellV83, - cellOcvOffset11}; + 0x15E, + false, + 8, + cellV77, + cellV78, + cellV79, + cellV80, + cellV81, + cellV82, + cellV83, + cellOcvOffset11}; static constexpr float cellV77Min{0.0}; static constexpr float cellV78Min{0.0}; @@ -903,17 +917,17 @@ inline CAN_Signal_FLOAT cellV89 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV90 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset12 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x15F, - false, - 8, - cellV84, - cellV85, - cellV86, - cellV87, - cellV88, - cellV89, - cellV90, - cellOcvOffset12}; + 0x15F, + false, + 8, + cellV84, + cellV85, + cellV86, + cellV87, + cellV88, + cellV89, + cellV90, + cellOcvOffset12}; static constexpr float cellV84Min{0.0}; static constexpr float cellV85Min{0.0}; @@ -937,17 +951,17 @@ inline CAN_Signal_FLOAT cellV96 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fal inline CAN_Signal_FLOAT cellV97 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset13 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x160, - false, - 8, - cellV91, - cellV92, - cellV93, - cellV94, - cellV95, - cellV96, - cellV97, - cellOcvOffset13}; + 0x160, + false, + 8, + cellV91, + cellV92, + cellV93, + cellV94, + cellV95, + cellV96, + cellV97, + cellOcvOffset13}; static constexpr float cellV91Min{0.0}; static constexpr float cellV92Min{0.0}; @@ -971,17 +985,17 @@ inline CAN_Signal_FLOAT cellV103 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV104 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset14 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x161, - false, - 8, - cellV98, - cellV99, - cellV100, - cellV101, - cellV102, - cellV103, - cellV104, - cellOcvOffset14}; + 0x161, + false, + 8, + cellV98, + cellV99, + cellV100, + cellV101, + cellV102, + cellV103, + cellV104, + cellOcvOffset14}; static constexpr float cellV98Min{0.0}; static constexpr float cellV99Min{0.0}; @@ -1005,17 +1019,17 @@ inline CAN_Signal_FLOAT cellV110 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV111 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset15 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x162, - false, - 8, - cellV105, - cellV106, - cellV107, - cellV108, - cellV109, - cellV110, - cellV111, - cellOcvOffset15}; + 0x162, + false, + 8, + cellV105, + cellV106, + cellV107, + cellV108, + cellV109, + cellV110, + cellV111, + cellOcvOffset15}; static constexpr float cellV105Min{0.0}; static constexpr float cellV106Min{0.0}; @@ -1039,17 +1053,17 @@ inline CAN_Signal_FLOAT cellV117 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV118 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset16 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x163, - false, - 8, - cellV112, - cellV113, - cellV114, - cellV115, - cellV116, - cellV117, - cellV118, - cellOcvOffset16}; + 0x163, + false, + 8, + cellV112, + cellV113, + cellV114, + cellV115, + cellV116, + cellV117, + cellV118, + cellOcvOffset16}; static constexpr float cellV112Min{0.0}; static constexpr float cellV113Min{0.0}; @@ -1073,17 +1087,17 @@ inline CAN_Signal_FLOAT cellV124 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV125 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset17 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x164, - false, - 8, - cellV119, - cellV120, - cellV121, - cellV122, - cellV123, - cellV124, - cellV125, - cellOcvOffset17}; + 0x164, + false, + 8, + cellV119, + cellV120, + cellV121, + cellV122, + cellV123, + cellV124, + cellV125, + cellOcvOffset17}; static constexpr float cellV119Min{0.0}; static constexpr float cellV120Min{0.0}; @@ -1107,17 +1121,17 @@ inline CAN_Signal_FLOAT cellV131 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV132 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset18 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x165, - false, - 8, - cellV126, - cellV127, - cellV128, - cellV129, - cellV130, - cellV131, - cellV132, - cellOcvOffset18}; + 0x165, + false, + 8, + cellV126, + cellV127, + cellV128, + cellV129, + cellV130, + cellV131, + cellV132, + cellOcvOffset18}; static constexpr float cellV126Min{0.0}; static constexpr float cellV127Min{0.0}; @@ -1141,17 +1155,17 @@ inline CAN_Signal_FLOAT cellV138 = MakeSignalSigned(float, 40, 8, 0.012, 2.0, fa inline CAN_Signal_FLOAT cellV139 = MakeSignalSigned(float, 48, 8, 0.012, 2.0, false); inline CAN_Signal_FLOAT cellOcvOffset19 = MakeSignalSigned(float, 56, 8, 0.004, 0.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x166, - false, - 8, - cellV133, - cellV134, - cellV135, - cellV136, - cellV137, - cellV138, - cellV139, - cellOcvOffset19}; + 0x166, + false, + 8, + cellV133, + cellV134, + cellV135, + cellV136, + cellV137, + cellV138, + cellV139, + cellOcvOffset19}; static constexpr float cellV133Min{0.0}; static constexpr float cellV134Min{0.0}; @@ -1199,17 +1213,17 @@ inline CAN_Signal_FLOAT cellT13 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT14 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT15 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x168, - false, - 8, - cellT8, - cellT9, - cellT10, - cellT11, - cellT12, - cellT13, - cellT14, - cellT15}; + 0x168, + false, + 8, + cellT8, + cellT9, + cellT10, + cellT11, + cellT12, + cellT13, + cellT14, + cellT15}; static constexpr float cellT8Min{0.0}; static constexpr float cellT9Min{0.0}; @@ -1233,17 +1247,17 @@ inline CAN_Signal_FLOAT cellT21 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT22 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT23 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x169, - false, - 8, - cellT16, - cellT17, - cellT18, - cellT19, - cellT20, - cellT21, - cellT22, - cellT23}; + 0x169, + false, + 8, + cellT16, + cellT17, + cellT18, + cellT19, + cellT20, + cellT21, + cellT22, + cellT23}; static constexpr float cellT16Min{0.0}; static constexpr float cellT17Min{0.0}; @@ -1267,17 +1281,17 @@ inline CAN_Signal_FLOAT cellT29 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT30 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT31 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16A, - false, - 8, - cellT24, - cellT25, - cellT26, - cellT27, - cellT28, - cellT29, - cellT30, - cellT31}; + 0x16A, + false, + 8, + cellT24, + cellT25, + cellT26, + cellT27, + cellT28, + cellT29, + cellT30, + cellT31}; static constexpr float cellT24Min{0.0}; static constexpr float cellT25Min{0.0}; @@ -1301,17 +1315,17 @@ inline CAN_Signal_FLOAT cellT37 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT38 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT39 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16B, - false, - 8, - cellT32, - cellT33, - cellT34, - cellT35, - cellT36, - cellT37, - cellT38, - cellT39}; + 0x16B, + false, + 8, + cellT32, + cellT33, + cellT34, + cellT35, + cellT36, + cellT37, + cellT38, + cellT39}; static constexpr float cellT32Min{0.0}; static constexpr float cellT33Min{0.0}; @@ -1335,17 +1349,17 @@ inline CAN_Signal_FLOAT cellT45 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT46 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT47 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16C, - false, - 8, - cellT40, - cellT41, - cellT42, - cellT43, - cellT44, - cellT45, - cellT46, - cellT47}; + 0x16C, + false, + 8, + cellT40, + cellT41, + cellT42, + cellT43, + cellT44, + cellT45, + cellT46, + cellT47}; static constexpr float cellT40Min{0.0}; static constexpr float cellT41Min{0.0}; @@ -1369,17 +1383,17 @@ inline CAN_Signal_FLOAT cellT53 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT54 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT55 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16D, - false, - 8, - cellT48, - cellT49, - cellT50, - cellT51, - cellT52, - cellT53, - cellT54, - cellT55}; + 0x16D, + false, + 8, + cellT48, + cellT49, + cellT50, + cellT51, + cellT52, + cellT53, + cellT54, + cellT55}; static constexpr float cellT48Min{0.0}; static constexpr float cellT49Min{0.0}; @@ -1403,17 +1417,17 @@ inline CAN_Signal_FLOAT cellT61 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT62 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT63 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16E, - false, - 8, - cellT56, - cellT57, - cellT58, - cellT59, - cellT60, - cellT61, - cellT62, - cellT63}; + 0x16E, + false, + 8, + cellT56, + cellT57, + cellT58, + cellT59, + cellT60, + cellT61, + cellT62, + cellT63}; static constexpr float cellT56Min{0.0}; static constexpr float cellT57Min{0.0}; @@ -1437,17 +1451,17 @@ inline CAN_Signal_FLOAT cellT69 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT70 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT71 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x16F, - false, - 8, - cellT64, - cellT65, - cellT66, - cellT67, - cellT68, - cellT69, - cellT70, - cellT71}; + 0x16F, + false, + 8, + cellT64, + cellT65, + cellT66, + cellT67, + cellT68, + cellT69, + cellT70, + cellT71}; static constexpr float cellT64Min{0.0}; static constexpr float cellT65Min{0.0}; @@ -1471,17 +1485,17 @@ inline CAN_Signal_FLOAT cellT77 = MakeSignalSigned(float, 40, 8, 1.0, -40.0, fal inline CAN_Signal_FLOAT cellT78 = MakeSignalSigned(float, 48, 8, 1.0, -40.0, false); inline CAN_Signal_FLOAT cellT79 = MakeSignalSigned(float, 56, 8, 1.0, -40.0, false); inline RX_CAN_Message(8) message{driveBus, - 0x170, - false, - 8, - cellT72, - cellT73, - cellT74, - cellT75, - cellT76, - cellT77, - cellT78, - cellT79}; + 0x170, + false, + 8, + cellT72, + cellT73, + cellT74, + cellT75, + cellT76, + cellT77, + cellT78, + cellT79}; static constexpr float cellT72Min{0.0}; static constexpr float cellT73Min{0.0}; @@ -1522,15 +1536,6 @@ static constexpr uint64_t controllerErrorProtocolViolationMin{0}; }; // namespace can2usbControllerErrorProtocolViolation -namespace dashboardHeartbeat { - -inline CAN_Signal_UINT64 heartbeatCount = MakeSignalExp(uint64_t, 0, 64, 1.0, 0.0); -inline RX_CAN_Message(1) message{driveBus, 0x510, false, 8, heartbeatCount}; - -static constexpr uint64_t heartbeatCountMin{0}; - -}; // namespace dashboardHeartbeat - namespace brBrokerTemp1 { inline CAN_Signal_FLOAT brTireTemp0 = MakeSignalSigned(float, 0, 16, 0.01, 0.0, false); @@ -1581,13 +1586,13 @@ inline CAN_Signal_INT16 brSusPotError = MakeSignalSigned(int16_t, 16, 16, 1.0, 0 inline CAN_Signal_INT16 brTireTempError = MakeSignalSigned(int16_t, 32, 16, 1.0, 0.0, false); inline CAN_Signal_INT16 brHeartbeatCount = MakeSignalSigned(int16_t, 48, 16, 1.0, 0.0, false); inline RX_CAN_Message(4) message{driveBus, - 0x540, - false, - 8, - brStrainGaugeError, - brSusPotError, - brTireTempError, - brHeartbeatCount}; + 0x540, + false, + 8, + brStrainGaugeError, + brSusPotError, + brTireTempError, + brHeartbeatCount}; static constexpr int16_t brStrainGaugeErrorMin{0}; static constexpr int16_t brSusPotErrorMin{0}; @@ -1646,13 +1651,13 @@ inline CAN_Signal_INT16 blSusPotError = MakeSignalSigned(int16_t, 16, 16, 1.0, 0 inline CAN_Signal_INT16 blTireTempError = MakeSignalSigned(int16_t, 32, 16, 1.0, 0.0, false); inline CAN_Signal_INT16 blHeartbeatCount = MakeSignalSigned(int16_t, 48, 16, 1.0, 0.0, false); inline RX_CAN_Message(4) message{driveBus, - 0x541, - false, - 8, - blStrainGaugeError, - blSusPotError, - blTireTempError, - blHeartbeatCount}; + 0x541, + false, + 8, + blStrainGaugeError, + blSusPotError, + blTireTempError, + blHeartbeatCount}; static constexpr int16_t blStrainGaugeErrorMin{0}; static constexpr int16_t blSusPotErrorMin{0}; @@ -1711,13 +1716,13 @@ inline CAN_Signal_INT16 frSusPotError = MakeSignalSigned(int16_t, 16, 16, 1.0, 0 inline CAN_Signal_INT16 frTireTempError = MakeSignalSigned(int16_t, 32, 16, 1.0, 0.0, false); inline CAN_Signal_INT16 frHeartbeatCount = MakeSignalSigned(int16_t, 48, 16, 1.0, 0.0, false); inline RX_CAN_Message(4) message{driveBus, - 0x542, - false, - 8, - frStrainGaugeError, - frSusPotError, - frTireTempError, - frHeartbeatCount}; + 0x542, + false, + 8, + frStrainGaugeError, + frSusPotError, + frTireTempError, + frHeartbeatCount}; static constexpr int16_t frStrainGaugeErrorMin{0}; static constexpr int16_t frSusPotErrorMin{0}; @@ -1776,13 +1781,13 @@ inline CAN_Signal_INT16 flSusPotError = MakeSignalSigned(int16_t, 16, 16, 1.0, 0 inline CAN_Signal_INT16 flTireTempError = MakeSignalSigned(int16_t, 32, 16, 1.0, 0.0, false); inline CAN_Signal_INT16 flHeartbeatCount = MakeSignalSigned(int16_t, 48, 16, 1.0, 0.0, false); inline RX_CAN_Message(4) message{driveBus, - 0x543, - false, - 8, - flStrainGaugeError, - flSusPotError, - flTireTempError, - flHeartbeatCount}; + 0x543, + false, + 8, + flStrainGaugeError, + flSusPotError, + flTireTempError, + flHeartbeatCount}; static constexpr int16_t flStrainGaugeErrorMin{0}; static constexpr int16_t flSusPotErrorMin{0}; @@ -1791,27 +1796,19 @@ static constexpr int16_t flHeartbeatCountMin{0}; }; // namespace flBrokerCanErrorMsg -namespace imuAccelerationUncompensated { +namespace imuAcceleration { -inline CAN_Signal_FLOAT xAxisAccelerationUncompensated = - MakeSignalSigned(float, 0, 21, 0.0002, 0.0, false); -inline CAN_Signal_FLOAT yAxisAccelerationUncompensated = - MakeSignalSigned(float, 21, 21, 0.0002, 0.0, false); -inline CAN_Signal_FLOAT zAxisAccelerationUncompensated = - MakeSignalSigned(float, 42, 21, 0.0002, 0.0, false); -inline RX_CAN_Message(3) message{driveBus, - 0x550, - false, - 8, - xAxisAccelerationUncompensated, - yAxisAccelerationUncompensated, - zAxisAccelerationUncompensated}; +inline CAN_Signal_FLOAT xAxisAcceleration = MakeSignalSigned(float, 0, 21, 0.0002, 0.0, false); +inline CAN_Signal_FLOAT yAxisAcceleration = MakeSignalSigned(float, 21, 21, 0.0002, 0.0, false); +inline CAN_Signal_FLOAT zAxisAcceleration = MakeSignalSigned(float, 42, 21, 0.0002, 0.0, false); +inline RX_CAN_Message(3) message{ + driveBus, 0x550, false, 8, xAxisAcceleration, yAxisAcceleration, zAxisAcceleration}; -static constexpr float xAxisAccelerationUncompensatedMin{-160.0}; -static constexpr float yAxisAccelerationUncompensatedMin{-160.0}; -static constexpr float zAxisAccelerationUncompensatedMin{-160.0}; +static constexpr float xAxisAccelerationMin{-160.0}; +static constexpr float yAxisAccelerationMin{-160.0}; +static constexpr float zAxisAccelerationMin{-160.0}; -}; // namespace imuAccelerationUncompensated +}; // namespace imuAcceleration namespace imuYawPitchRoll { @@ -1925,7 +1922,7 @@ static constexpr float zAxisDeltaVelocityMin{-500.0}; namespace imuUtcTime { -inline CAN_Signal_UINT8 utcYear = MakeSignalExp(uint8_t, 0, 8, 1.0, 2000.0); +inline CAN_Signal_UINT8 utcYear = MakeSignalExp(uint8_t, 0, 8, 1.0, 0.0); inline CAN_Signal_UINT8 utcMonth = MakeSignalExp(uint8_t, 8, 8, 1.0, 0.0); inline CAN_Signal_UINT8 utcDay = MakeSignalExp(uint8_t, 16, 8, 1.0, 0.0); inline CAN_Signal_UINT8 utcHour = MakeSignalExp(uint8_t, 24, 8, 1.0, 0.0); @@ -1933,16 +1930,16 @@ inline CAN_Signal_UINT8 utcMinutes = MakeSignalExp(uint8_t, 32, 8, 1.0, 0.0); inline CAN_Signal_UINT8 utcSeconds = MakeSignalExp(uint8_t, 40, 8, 1.0, 0.0); inline CAN_Signal_UINT16 utcMilliseconds = MakeSignalExp(uint16_t, 48, 16, 1.0, 0.0); inline RX_CAN_Message(7) message{driveBus, - 0x559, - false, - 8, - utcYear, - utcMonth, - utcDay, - utcHour, - utcMinutes, - utcSeconds, - utcMilliseconds}; + 0x559, + false, + 8, + utcYear, + utcMonth, + utcDay, + utcHour, + utcMinutes, + utcSeconds, + utcMilliseconds}; static constexpr uint8_t utcYearMin{0}; static constexpr uint8_t utcMonthMin{0}; @@ -1990,12 +1987,12 @@ inline CAN_Signal_FLOAT positionUncertaintyEast = inline CAN_Signal_FLOAT positionUncertaintyDown = MakeSignalSigned(float, 42, 21, 0.0005, 0.0, false); inline RX_CAN_Message(3) message{driveBus, - 0x55C, - false, - 8, - positionUncertaintyNorth, - positionUncertaintyEast, - positionUncertaintyDown}; + 0x55C, + false, + 8, + positionUncertaintyNorth, + positionUncertaintyEast, + positionUncertaintyDown}; static constexpr float positionUncertaintyNorthMin{0.0}; static constexpr float positionUncertaintyEastMin{0.0}; @@ -2003,11 +2000,98 @@ static constexpr float positionUncertaintyDownMin{0.0}; }; // namespace imuPositionU +namespace telemetryRtcTime { + +inline CAN_Signal_UINT8 rtcHour = MakeSignalExp(uint8_t, 0, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 rtcMinute = MakeSignalExp(uint8_t, 8, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 rtcSecond = MakeSignalExp(uint8_t, 16, 8, 1.0, 0.0); +inline CAN_Signal_UINT32 rtcSubsecond = MakeSignalExp(uint32_t, 24, 32, 1.0, 0.0); +inline RX_CAN_Message(4) message{ + driveBus, 0x520, false, 7, rtcHour, rtcMinute, rtcSecond, rtcSubsecond}; + +static constexpr uint8_t rtcHourMin{0}; +static constexpr uint8_t rtcMinuteMin{0}; +static constexpr uint8_t rtcSecondMin{0}; +static constexpr uint32_t rtcSubsecondMin{0}; + +}; // namespace telemetryRtcTime + +namespace telemetryRtcDate { + +inline CAN_Signal_UINT8 rtcYear = MakeSignalExp(uint8_t, 0, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 rtcMonth = MakeSignalExp(uint8_t, 8, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 rtcDay = MakeSignalExp(uint8_t, 16, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 rtcWeekday = MakeSignalExp(uint8_t, 24, 8, 1.0, 0.0); +inline RX_CAN_Message(4) message{driveBus, 0x521, false, 4, rtcYear, rtcMonth, rtcDay, rtcWeekday}; + +static constexpr uint8_t rtcYearMin{0}; +static constexpr uint8_t rtcMonthMin{1}; +static constexpr uint8_t rtcDayMin{1}; +static constexpr uint8_t rtcWeekdayMin{1}; + +}; // namespace telemetryRtcDate + +namespace telemetryOdometer { + +inline CAN_Signal_FLOAT milesDriven = MakeSignalSigned(float, 0, 32, 1.0, 0.0, false); +inline RX_CAN_Message(1) message{driveBus, 0x522, false, 4, milesDriven}; + +static constexpr float milesDrivenMin{0.0}; + +}; // namespace telemetryOdometer + +namespace telemetryStatus { + +inline CAN_Signal_UINT16 logFile = MakeSignalExp(uint16_t, 0, 16, 1.0, 0.0); +inline CAN_Signal_UINT8 loggingStatus = MakeSignalExp(uint8_t, 16, 8, 1.0, 0.0); +inline CAN_Signal_UINT8 wirelessStatus = MakeSignalExp(uint8_t, 24, 8, 1.0, 0.0); +inline RX_CAN_Message(3) message{driveBus, 0x523, false, 4, logFile, loggingStatus, wirelessStatus}; + +static constexpr uint16_t logFileMin{0}; +static constexpr uint8_t loggingStatusMin{0}; +static constexpr uint8_t wirelessStatusMin{0}; + +}; // namespace telemetryStatus + +namespace aeroStrainGauge1 { + +inline CAN_Signal_FLOAT strainGauge1 = MakeSignalSigned(float, 0, 32, 0.0001, 0.0, false); +inline CAN_Signal_FLOAT strainGauge2 = MakeSignalSigned(float, 32, 32, 0.0001, 0.0, false); +inline RX_CAN_Message(2) message{driveBus, 0x560, false, 8, strainGauge1, strainGauge2}; + +static constexpr float strainGauge1Min{-100.0}; +static constexpr float strainGauge2Min{-100.0}; + +}; // namespace aeroStrainGauge1 + +namespace aeroStrainGauge2 { + +inline CAN_Signal_FLOAT strainGauge3 = MakeSignalSigned(float, 0, 32, 0.0001, 0.0, false); +inline CAN_Signal_FLOAT strainGauge4 = MakeSignalSigned(float, 32, 32, 0.0001, 0.0, false); +inline RX_CAN_Message(2) message{driveBus, 0x561, false, 8, strainGauge3, strainGauge4}; + +static constexpr float strainGauge3Min{-100.0}; +static constexpr float strainGauge4Min{-100.0}; + +}; // namespace aeroStrainGauge2 + +namespace aeroStrainGauge3 { + +inline CAN_Signal_FLOAT strainGauge5 = MakeSignalSigned(float, 0, 32, 0.0001, 0.0, false); +inline CAN_Signal_FLOAT strainGauge6 = MakeSignalSigned(float, 32, 32, 0.0001, 0.0, false); +inline RX_CAN_Message(2) message{driveBus, 0x562, false, 8, strainGauge5, strainGauge6}; + +static constexpr float strainGauge5Min{-100.0}; +static constexpr float strainGauge6Min{-100.0}; + +}; // namespace aeroStrainGauge3 + namespace meta { static const std::map messageIdToName = { {0x2A1, "PDM_Current"}, {0x2A2, "PDM_Bat_Volt"}, + {0x2A3, "PDM_Coolant"}, {0x28B, "Front_Right_Inverter_Motor_Status"}, {0x28C, "Front_Right_Inverter_Temp_Status"}, {0x28D, "Front_Right_Inverter_Current_Draw"}, @@ -2075,7 +2159,6 @@ static const std::map messageIdToName = { {0x004, "CAN2USB_Controller_Error"}, {0x024, "CAN2USB_Controller_Error_NACK_Error"}, {0x00C, "CAN2USB_Controller_Error_Protocol_Violation"}, - {0x510, "Dashboard_Heartbeat"}, {0x530, "BR_Broker_Temp1"}, {0x531, "BR_Broker_Temp2"}, {0x538, "BR_Broker_Sus"}, @@ -2092,7 +2175,7 @@ static const std::map messageIdToName = { {0x537, "FL_Broker_Temp2"}, {0x53E, "FL_Broker_Sus"}, {0x543, "FL_Broker_CAN_Error_Msg"}, - {0x550, "IMU_Acceleration_Uncompensated"}, + {0x550, "IMU_Acceleration"}, {0x551, "IMU_Yaw_Pitch_Roll"}, {0x552, "IMU_Angular_Rate"}, {0x553, "IMU_Position_INS"}, @@ -2105,6 +2188,13 @@ static const std::map messageIdToName = { {0x55A, "IMU_Fix_NumSats_INS_Status"}, {0x55B, "IMU_Position_GNSS"}, {0x55C, "IMU_Position_U"}, + {0x520, "Telemetry_RTC_Time"}, + {0x521, "Telemetry_RTC_Date"}, + {0x522, "Telemetry_Odometer"}, + {0x523, "Telemetry_Status"}, + {0x560, "Aero_Strain_Gauge1"}, + {0x561, "Aero_Strain_Gauge2"}, + {0x562, "Aero_Strain_Gauge3"}, }; static const std::map, const char*> signalIdToName = { @@ -2116,6 +2206,9 @@ static const std::map, const char*> signalIdToName {{0x2A2, 0}, "Bat_Volt"}, {{0x2A2, 1}, "Low_Bat_Volt_Warning"}, {{0x2A2, 2}, "Danger_Bat_Volt_Warning"}, + {{0x2A3, 0}, "Coolant_1_Volt"}, + {{0x2A3, 1}, "Coolant_2_Volt"}, + {{0x2A3, 2}, "Coolant_3_Volt"}, {{0x28B, 0}, "RPM"}, {{0x28B, 1}, "Motor_Current"}, {{0x28B, 2}, "DC_Voltage"}, @@ -2444,7 +2537,6 @@ static const std::map, const char*> signalIdToName {{0x004, 0}, "Controller_Error"}, {{0x024, 0}, "Controller_Error_NACK"}, {{0x00C, 0}, "Controller_Error_Protocol_Violation"}, - {{0x510, 0}, "Heartbeat_Count"}, {{0x530, 0}, "BR_Tire_Temp_0"}, {{0x530, 1}, "BR_Tire_Temp_1"}, {{0x530, 2}, "BR_Tire_Temp_2"}, @@ -2501,9 +2593,9 @@ static const std::map, const char*> signalIdToName {{0x543, 1}, "FL_Sus_Pot_Error"}, {{0x543, 2}, "FL_Tire_Temp_Error"}, {{0x543, 3}, "FL_Heartbeat_Count"}, - {{0x550, 0}, "X_Axis_Acceleration_Uncompensated"}, - {{0x550, 1}, "Y_Axis_Acceleration_Uncompensated"}, - {{0x550, 2}, "Z_Axis_Acceleration_Uncompensated"}, + {{0x550, 0}, "X_Axis_Acceleration"}, + {{0x550, 1}, "Y_Axis_Acceleration"}, + {{0x550, 2}, "Z_Axis_Acceleration"}, {{0x551, 0}, "Yaw"}, {{0x551, 1}, "Pitch"}, {{0x551, 2}, "Roll"}, @@ -2544,8 +2636,26 @@ static const std::map, const char*> signalIdToName {{0x55C, 0}, "Position_Uncertainty_North"}, {{0x55C, 1}, "Position_Uncertainty_East"}, {{0x55C, 2}, "Position_Uncertainty_Down"}, + {{0x520, 0}, "RTC_Hour"}, + {{0x520, 1}, "RTC_Minute"}, + {{0x520, 2}, "RTC_Second"}, + {{0x520, 3}, "RTC_Subsecond"}, + {{0x521, 0}, "RTC_Year"}, + {{0x521, 1}, "RTC_Month"}, + {{0x521, 2}, "RTC_Day"}, + {{0x521, 3}, "RTC_Weekday"}, + {{0x522, 0}, "Miles_Driven"}, + {{0x523, 0}, "Log_File"}, + {{0x523, 1}, "Logging_Status"}, + {{0x523, 2}, "Wireless_Status"}, + {{0x560, 0}, "Strain_Gauge_1"}, + {{0x560, 1}, "Strain_Gauge_2"}, + {{0x561, 0}, "Strain_Gauge_3"}, + {{0x561, 1}, "Strain_Gauge_4"}, + {{0x562, 0}, "Strain_Gauge_5"}, + {{0x562, 1}, "Strain_Gauge_6"}, }; }; // namespace meta -}; // namespace dbc \ No newline at end of file +}; // namespace dbc diff --git a/dash/can/mock/can_imgui.cpp b/dash/can/mock/can_imgui.cpp index d9bad9e..e4957dc 100644 --- a/dash/can/mock/can_imgui.cpp +++ b/dash/can/mock/can_imgui.cpp @@ -1,12 +1,13 @@ #include "can_imgui.hpp" +#include + #include #include #include #include #include #include -#include #include #include @@ -25,10 +26,11 @@ bool CAN_IMGUI::init(const BaudRate baud) { sortedMessages.push_back({board, messageId}); } - std::sort( - sortedMessages.begin(), + std::sort(sortedMessages.begin(), sortedMessages.end(), - [](const GroupedMessage& a, const GroupedMessage& b) { return a.boardName < b.boardName; }); + [](const GroupedMessage& a, const GroupedMessage& b) { + return a.boardName < b.boardName; + }); return true; } @@ -96,9 +98,9 @@ okay::Option CAN_IMGUI::drawUI() { ImGui::SetNextItemWidth(-1.0f); if (ImGui::InputTextWithHint("##SearchFilter", - "Search Signals...", - filter.InputBuf, - IM_ARRAYSIZE(filter.InputBuf))) { + "Search Signals...", + filter.InputBuf, + IM_ARRAYSIZE(filter.InputBuf))) { filter.Build(); filterChanged = true; } @@ -145,8 +147,8 @@ okay::Option CAN_IMGUI::drawUI() { for (uint8_t sigNum{}; sigNum < message->get_num_signals(); ++sigNum) { auto sigID{std::pair{messageID, sigNum}}; auto it{dbc::meta::signalIdToName.find(sigID)}; - const char* peekName{(it != dbc::meta::signalIdToName.end()) ? it->second - : "(unknown)"}; + const char* peekName{ + (it != dbc::meta::signalIdToName.end()) ? it->second : "(unknown)"}; if (filter.PassFilter(peekName)) { showHeader = true; diff --git a/dash/can/mock/can_imgui.hpp b/dash/can/mock/can_imgui.hpp index 51ae07d..191f82c 100644 --- a/dash/can/mock/can_imgui.hpp +++ b/dash/can/mock/can_imgui.hpp @@ -1,9 +1,10 @@ #ifndef __CAN_IMGUI_H__ #define __CAN_IMGUI_H__ +#include + #include #include -#include class CAN_IMGUI : public ICAN { struct SignalInfo { diff --git a/dash/main.cpp b/dash/main.cpp index 33b8f4a..f18d8ae 100644 --- a/dash/main.cpp +++ b/dash/main.cpp @@ -1,208 +1,69 @@ +#include "page.hpp" +#include "ui/components/rotate.hpp" +#include "ui/drive_page.hpp" +#include "ui/error_page.hpp" +#include "ui/page.hpp" +#include "ui/shared_elements.hpp" + +#include + #include #include -#include #include -#include -#include -#include +#include #include #include #include #include -#include -static void __gameInitialize(); -static void __gameUpdate(); -static void __gameShutdown(); -static void __motorStatusRecv(); static void __exitSignal(int sig); -static void handleInverterFaults(std::stringstream& frame); -static void handleBMSFaults(std::stringstream& frame); -static void handleECUFaults(std::stringstream& frame); - -static std::size_t __frameCount = 0; - -// clang-format off -static std::vector g_toPrint = { - &dbc::bmsStatus::message, - &dbc::bmsFaults::message, - &dbc::bmsSoe::message, - &dbc::pdmBatVolt::message, - &dbc::ecuBmsCommandMessage::message, - &dbc::ecuImplausibility::message, - &dbc::ecuBrake::message, - &dbc::ecuThrottle::message, - &dbc::ecuSetCurrentRearInverter::message, - &dbc::rearInverterFaultStatus::message, - &dbc::rearInverterPowerDraw::message, - &dbc::rearInverterMotorStatus::message, - &dbc::rearInverterTempStatus::message, - // &dbc::brBrokerSus::message, - // &dbc::brBrokerCanErrorMsg::message, - // &dbc::brBrokerTemp1::message, - // &dbc::brBrokerTemp2::message -}; -// clang-format on - int main() { okay::SurfaceConfig surfaceConfig; + surfaceConfig.width = 800; + surfaceConfig.height = 480; okay::Surface surface(surfaceConfig); okay::RendererSettings rendererSettings{ .surfaceConfig = surfaceConfig, - .pipeline = okay::RenderPipeline::create(std::make_unique())}; + .pipeline = okay::RenderPipeline::create(std::make_unique()), + .enableIMGUI = true, + }; + + std::unique_ptr pageManager = std::make_unique( + dash::PageEntry::create(std::make_unique()) + .activeWhen([]() { + return true; + }) + .withPriority(0), + dash::PageEntry::create(std::make_unique()) + .activeWhen([]() { + return true; + }) + .withPriority(1)); // attach an interrupt to exit the program on ctrl c std::signal(SIGINT, __exitSignal); - okay::Game::create() - .addSystems( - // std::make_unique(std::move(rendererSettings)), - std::make_unique(), - std::make_unique(), - std::make_unique(), - std::make_unique()) - .onInitialize(__gameInitialize) - .onUpdate(__gameUpdate) - .onShutdown(__gameShutdown) - .run(); - - return 0; -} - -static void __gameInitialize() { - // std::ios::sync_with_stdio(false); - // std::cout.tie(nullptr); - std::cout << "\x1b[?25l"; // hide cursor - std::cout << "\x1b[?1049h\x1b[2J\x1b[H\x1b[?25l"; - std::cout.flush(); -} - -static void __gameShutdown() { - std::cout << "Game shutdown." << std::endl; - std::cout << "\x1b[?25h\x1b[?1049l"; - std::cout.flush(); - okay::Engine.shutdown(); -} - -static void __gameUpdate() { - std::cout << "NFR26 Development Dashboard\n"; - - // Collect all signal strings - std::vector lines; - for (ICAN_Message* msg : g_toPrint) { - for (std::uint8_t sigNum = 0; sigNum < msg->get_num_signals(); sigNum++) { - auto sigId = std::pair{msg->get_id().id, sigNum}; - - const char* name = "(unknown)"; - auto it = dbc::meta::signalIdToName.find(sigId); - if (it != dbc::meta::signalIdToName.end()) - name = it->second; - - lines.emplace_back(std::string{name} + ": " + msg->get_signal(sigNum)->to_string()); - } - } + auto game = okay::Game::create().addSystems( + std::make_unique(std::move(rendererSettings)), + std::make_unique(), + std::make_unique(), + std::make_unique(), + std::make_unique(), + std::make_unique(), + std::move(pageManager)); - constexpr int COLS = 3; - constexpr int COL_WIDTH = 32; + okay::registerBuiltinComponentsAndSystems(); + okay::ecs::registerComponent(); + okay::ecs::registerSystem(std::make_unique()); - size_t rows = (lines.size() + COLS - 1) / COLS; + game.run(); - std::stringstream frame; - // Print row-wise across columns - for (size_t r = 0; r < rows; r++) { - for (size_t c = 0; c < COLS; c++) { - size_t idx = r + c * rows; - if (idx < lines.size()) { - frame << std::left << std::setw(COL_WIDTH) << lines[idx]; - } - } - frame << '\n'; - } - - handleInverterFaults(frame); - handleECUFaults(frame); - handleBMSFaults(frame); - - std::cout << frame.str(); - std::cout << "\x1b[J"; - std::cout << "\x1b[H"; - std::cout.flush(); + return 0; } static void __exitSignal(int sig) { okay::Engine.logger.info("Exit signal received: {}", sig); okay::Engine.shutdown(); } - -void handleInverterFaults(std::stringstream& frame) { - std::uint8_t rearInverterError = dbc::rearInverterFaultStatus::faultCode->get(); - - std::unordered_map faultCodes = {{0x00, "NONE"}, - {0x01, "OVER_VOLTAGE"}, - {0x02, "UNDER_VOLTAGE"}, - {0x03, "DRV_FAULT"}, - {0x04, "ABS_OVER_CURRENT"}, - {0x05, "OVER_TEMP_FET"}, - {0x06, "OVER_TEMP_MOTOR"}, - {0x07, "GATE_DRIVER_OVER_VOLTAGE"}, - {0x08, "GATE_DRIVER_UNDER_VOLTAGE"}, - {0x09, "MCU_UNDER_VOLTAGE"}, - {0x0A, "BOOTING_FROM_WATCHDOG_RESET"}, - {0x0B, "ENCODER_SPI_FAULT"}, - {0x0C, "ENCODER_SINCOS_BELOW_MIN_AMPLITUDE"}, - {0x0D, "ENCODER_SINCOS_ABOVE_MAX_AMPLITUDE"}, - {0x0E, "FLASH_CORRUPTION"}, - {0x0F, "HIGH_OFFSET_CURRENT_SENSOR_1"}, - {0x10, "HIGH_OFFSET_CURRENT_SENSOR_2"}, - {0x11, "HIGH_OFFSET_CURRENT_SENSOR_3"}, - {0x12, "UNBALANCED_CURRENTS"}, - {0x13, "BRK_FAULT"}, - {0x14, "RESOLVER_LOT"}, - {0x15, "RESOLVER_DOS"}, - {0x16, "RESOLVER_LOS"}, - {0x17, "FLASH_CORRUPTION_APP_CFG"}, - {0x18, "FLASH_CORRUPTION_MC_CFG"}, - {0x19, "ENCODER_NO_MAGNET"}, - {0x1A, "ENCODER_MAGNET_TOO_STRONG"}, - {0x1B, "PHASE_FILTER_FAULT"}}; - - if (rearInverterError > 0) { - std::string errorStr = "UNKNOWN"; - if (faultCodes.find(rearInverterError) != faultCodes.end()) { - errorStr = faultCodes[rearInverterError]; - } - frame << "Rear Inverter Fault: " << errorStr << " (0x" << std::hex << (int)rearInverterError - << std::dec << ")\n"; - } -} - -void handleECUFaults(std::stringstream& frame) { - bool implPres = dbc::ecuImplausibility::implausibilityPresent->get(); - bool appsImpl = dbc::ecuImplausibility::appssDisagreementImp->get(); - bool bppcImpl = dbc::ecuImplausibility::appssDisagreementImp->get(); - bool brakeInv = dbc::ecuImplausibility::brakeInvalidImp->get(); - bool appsInv = dbc::ecuImplausibility::appssInvalidImp->get(); - - if (implPres) { // implausibility present - frame << "ECU Implausibility Error: Implausibility Present\n"; - } - if (appsImpl) { // apps implausibility - frame << "ECU Implausibility Error: APPSs Disagreement Implausibility\n"; - } - if (bppcImpl) { // bppc implausibility - frame << "ECU Implausibility Error: BPPC Implausibility\n"; - } - if (brakeInv) { // brake invalid implausibility - frame << "ECU Implausibility Error: Brake Invalid Implausibility\n"; - } - if (appsInv) { // apps invalid implausibility - frame << "ECU Implausibility Error: Apps Invalid Implausibility\n"; - } -} - -// handle BMS faults -void handleBMSFaults(std::stringstream& frame) { - // not implemented yet! -} \ No newline at end of file diff --git a/dash/okay.cmake b/dash/okay.cmake index 23753f4..7c744a9 100644 --- a/dash/okay.cmake +++ b/dash/okay.cmake @@ -1,31 +1,44 @@ -# okay.cmake -- links to okay engine +# okay.cmake -- links dash application to okay engine + +message(STATUS "OKAY_PROJECT_ROOT_DIR = ${OKAY_PROJECT_ROOT_DIR}") +message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") +message(STATUS "PROJECT = ${PROJECT}") -# dash application set(SOURCES - ${OKAY_PROJECT_ROOT_DIR}/main.cpp - ${OKAY_PROJECT_ROOT_DIR}/can/mock/can_imgui.cpp + "${OKAY_PROJECT_ROOT_DIR}/main.cpp" + "${OKAY_PROJECT_ROOT_DIR}/can/mock/can_imgui.cpp" +) + +target_sources(${PROJECT} PRIVATE + ${SOURCES} ) -set(INCLUDES - ${OKAY_PROJECT_ROOT_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} +target_include_directories(${PROJECT} PRIVATE + "${OKAY_PROJECT_ROOT_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" ) -# add needed drivers -set(DRIVERS_DIR ${OKAY_PROJECT_ROOT_DIR}/drivers) +# Add needed drivers +set(DRIVERS_DIR "${OKAY_PROJECT_ROOT_DIR}/drivers") add_subdirectory( - ${DRIVERS_DIR}/can - ${CMAKE_CURRENT_BINARY_DIR}/dash_drivers_can -) # produces static lib nfr_canlib + "${DRIVERS_DIR}/can" + "${CMAKE_CURRENT_BINARY_DIR}/dash_drivers_can" +) -# add platform-specific functionalities +# Add platform-specific functionality add_subdirectory( - ${OKAY_PROJECT_ROOT_DIR}/platform - ${CMAKE_CURRENT_BINARY_DIR}/dash_platform + "${OKAY_PROJECT_ROOT_DIR}/platform" + "${CMAKE_CURRENT_BINARY_DIR}/dash_platform" ) -target_sources(${PROJECT} PRIVATE ${SOURCES}) -target_link_libraries(${PROJECT} PRIVATE dash_platform) -target_include_directories(${PROJECT} PRIVATE ${INCLUDES}) +# Add UI library +add_subdirectory( + "${OKAY_PROJECT_ROOT_DIR}/ui" + "${CMAKE_CURRENT_BINARY_DIR}/dash_ui" +) +target_link_libraries(${PROJECT} PRIVATE + dash_platform + dash_ui +) diff --git a/dash/platform/mock/button.cpp b/dash/platform/mock/button.cpp index 6bc3bbc..a6a67a0 100644 --- a/dash/platform/mock/button.cpp +++ b/dash/platform/mock/button.cpp @@ -3,16 +3,13 @@ namespace dash { Button::Button(uint8_t gpioPin) - : _buttonID(gpioPin), _gpio(std::make_unique(gpioPin, false)) { -} + : _buttonID(gpioPin), _gpio(std::make_unique(gpioPin, false)) {} Button::~Button() = default; -void Button::onDown(std::function callback) { -} +void Button::onDown(std::function callback) {} -void Button::onUp(std::function callback) { -} +void Button::onUp(std::function callback) {} bool Button::isDownThisFrame() { return false; diff --git a/dash/platform/mock/can.cpp b/dash/platform/mock/can.cpp index c121f4b..307871b 100644 --- a/dash/platform/mock/can.cpp +++ b/dash/platform/mock/can.cpp @@ -1,3 +1,5 @@ +#include + #include #include #include @@ -6,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/dash/platform/mock/encoder.cpp b/dash/platform/mock/encoder.cpp index 4b956a9..295fd58 100644 --- a/dash/platform/mock/encoder.cpp +++ b/dash/platform/mock/encoder.cpp @@ -9,16 +9,13 @@ constexpr uint16_t Encoder::generateID(uint8_t left, uint8_t right) { Encoder::Encoder(uint8_t leftPin, uint8_t rightPin) : _encoderID(generateID(leftPin, rightPin)), _leftGPIO(std::make_unique(leftPin, false)), - _rightGPIO(std::make_unique(rightPin, false)) { -} + _rightGPIO(std::make_unique(rightPin, false)) {} Encoder::~Encoder() = default; -void Encoder::onRight(std::function callback) { -} +void Encoder::onRight(std::function callback) {} -void Encoder::onLeft(std::function callback) { -} +void Encoder::onLeft(std::function callback) {} bool Encoder::isIdle() { return true; diff --git a/dash/platform/mock/gpio.cpp b/dash/platform/mock/gpio.cpp index c64741d..e096102 100644 --- a/dash/platform/mock/gpio.cpp +++ b/dash/platform/mock/gpio.cpp @@ -6,8 +6,7 @@ struct GPIO::GPIOImpl { GpioLevel _level = GpioLevel::G_UNDEF; }; -GPIO::GPIO(uint8_t, bool) : _impl(std::make_unique()) { -} +GPIO::GPIO(uint8_t, bool) : _impl(std::make_unique()) {} GPIO::~GPIO() = default; @@ -23,8 +22,7 @@ bool GPIO::gpio_read(GpioLevel& out) { return true; } -void GPIO::attachInterrupt(std::function callback, EdgeType edge) { -} +void GPIO::attachInterrupt(std::function callback, EdgeType edge) {} bool GPIO::checkError() { return true; diff --git a/dash/platform/mock/input_manager.cpp b/dash/platform/mock/input_manager.cpp index 4392652..399005b 100644 --- a/dash/platform/mock/input_manager.cpp +++ b/dash/platform/mock/input_manager.cpp @@ -10,44 +10,31 @@ InputManager& InputManager::instance() { return instance; } -void InputManager::registerButton(uint8_t buttonID) { -} +void InputManager::registerButton(uint8_t buttonID) {} -void InputManager::unregisterButton(uint8_t buttonID) { -} +void InputManager::unregisterButton(uint8_t buttonID) {} -void InputManager::attachDownCallback(uint8_t buttonID, std::function callback) { -} +void InputManager::attachDownCallback(uint8_t buttonID, std::function callback) {} -void InputManager::attachUpCallback(uint8_t buttonID, std::function callback) { -} +void InputManager::attachUpCallback(uint8_t buttonID, std::function callback) {} -void InputManager::executeDownCallbacks(uint8_t buttonID) { -} +void InputManager::executeDownCallbacks(uint8_t buttonID) {} -void InputManager::executeUpCallbacks(uint8_t buttonID) { -} +void InputManager::executeUpCallbacks(uint8_t buttonID) {} -void InputManager::registerEncoder(uint16_t encoderID, uint8_t leftPin, uint8_t rightPin) { -} +void InputManager::registerEncoder(uint16_t encoderID, uint8_t leftPin, uint8_t rightPin) {} -void InputManager::unregisterEncoder(uint16_t encoderID) { -} +void InputManager::unregisterEncoder(uint16_t encoderID) {} -void InputManager::attachLeftCallback(uint16_t encoderID, std::function callback) { -} +void InputManager::attachLeftCallback(uint16_t encoderID, std::function callback) {} -void InputManager::attachRightCallback(uint16_t encoderID, std::function callback) { -} +void InputManager::attachRightCallback(uint16_t encoderID, std::function callback) {} -void InputManager::executeLeftCallbacks(uint16_t encoderID) { -} +void InputManager::executeLeftCallbacks(uint16_t encoderID) {} -void InputManager::executeRightCallbacks(uint16_t encoderID) { -} +void InputManager::executeRightCallbacks(uint16_t encoderID) {} -void InputManager::onEncoderEdge(uint16_t encoderID) { -} +void InputManager::onEncoderEdge(uint16_t encoderID) {} bool InputManager::isDownThisFrame(uint8_t buttonID) { return false; @@ -73,7 +60,6 @@ bool InputManager::isIdle(uint16_t encoderID) const { return true; } -void InputManager::tick() { -} +void InputManager::tick() {} }; // namespace dash \ No newline at end of file diff --git a/dash/platform/mock/neopixel.cpp b/dash/platform/mock/neopixel.cpp index 807b111..ab77490 100644 --- a/dash/platform/mock/neopixel.cpp +++ b/dash/platform/mock/neopixel.cpp @@ -4,11 +4,9 @@ namespace dash { struct NeopixelStrip::NeopixelImpl {}; -NeopixelStrip::NeopixelStrip() : _impl(std::make_unique()) { -} +NeopixelStrip::NeopixelStrip() : _impl(std::make_unique()) {} -NeopixelStrip::~NeopixelStrip() { -} +NeopixelStrip::~NeopixelStrip() {} void NeopixelStrip::init(const int& pin, const int& numLeds) { // noop diff --git a/dash/platform/mock/spi.cpp b/dash/platform/mock/spi.cpp index e5a7151..3358d06 100644 --- a/dash/platform/mock/spi.cpp +++ b/dash/platform/mock/spi.cpp @@ -6,8 +6,7 @@ struct SPI::SPIImpl { // noop }; -SPI::SPI(const std::string&, uint32_t, uint8_t, uint8_t) : _impl(std::make_unique()) { -} +SPI::SPI(const std::string&, uint32_t, uint8_t, uint8_t) : _impl(std::make_unique()) {} SPI::~SPI() = default; diff --git a/dash/platform/neopixel_manager.hpp b/dash/platform/neopixel_manager.hpp index ca29c08..14eb681 100644 --- a/dash/platform/neopixel_manager.hpp +++ b/dash/platform/neopixel_manager.hpp @@ -1,11 +1,12 @@ #ifndef __LIGHTS_HPP__ #define __LIGHTS_HPP__ +#include + #include #include #include #include -#include #include #include @@ -36,12 +37,24 @@ struct VirtualizedNeobar { _dirty = true; } - uint8_t numPixels() const { return _numPixels; } - const std::vector& currentColors() const { return _currentColors; } - uint8_t toHardwareIndex(uint8_t virtIdx) const { return _mapping[virtIdx]; } - NeopixelStrip* strip() const { return _strip; } - bool isDirty() const { return _dirty; } - void clearDirty() { _dirty = false; } + uint8_t numPixels() const { + return _numPixels; + } + const std::vector& currentColors() const { + return _currentColors; + } + uint8_t toHardwareIndex(uint8_t virtIdx) const { + return _mapping[virtIdx]; + } + NeopixelStrip* strip() const { + return _strip; + } + bool isDirty() const { + return _dirty; + } + void clearDirty() { + _dirty = false; + } private: std::vector _mapping; // idx -> hwIdx @@ -73,8 +86,12 @@ class NeopixelManager : public okay::System { } } - dbc::ecuDriveStatus::message.attach_rx_callback([this]() { onECUDriveStatus(); }); - startAnimation([this](float time) { idle(time); }); + dbc::ecuDriveStatus::message.attach_rx_callback([this]() { + onECUDriveStatus(); + }); + startAnimation([this](float time) { + idle(time); + }); updateDisplay(); } @@ -128,7 +145,9 @@ class NeopixelManager : public okay::System { } } - VirtualizedNeobar& getBar(uint8_t barNum) { return _bars[barNum]; } + VirtualizedNeobar& getBar(uint8_t barNum) { + return _bars[barNum]; + } void onECUDriveStatus() { uint8_t state = dbc::ecuDriveStatus::driveState->get(); @@ -140,17 +159,25 @@ class NeopixelManager : public okay::System { switch (state) { case 0: // idle - startAnimation([this](float time) { idle(time); }); + startAnimation([this](float time) { + idle(time); + }); break; case 1: // precharge - startAnimation([this](float time) { precharge(time); }); + startAnimation([this](float time) { + precharge(time); + }); break; case 2: // neutral - startAnimation([this](float time) { neutral(time); }); + startAnimation([this](float time) { + neutral(time); + }); break; case 3: // drive // do something - startAnimation([this](float time) { drive(time); }); + startAnimation([this](float time) { + drive(time); + }); break; } } @@ -193,11 +220,45 @@ class NeopixelManager : public okay::System { // master map std::vector mappingAtBar(uint8_t bar) { static const std::vector MASTER_MAP = { - 15, 14, 13, 12, 11, 10, 9, 8, // bar 0 - 7, 6, 5, 4, 3, 2, 1, 0, // bar 1 - 0, 1, 2, 3, 4, 5, 6, // bar 2 - 7, 6, 5, 4, 3, 2, 1, 0, // bar 3 - 15, 14, 13, 12, 11, 10, 9, 8, // bar 4 + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, // bar 0 + 7, + 6, + 5, + 4, + 3, + 2, + 1, + 0, // bar 1 + 0, + 1, + 2, + 3, + 4, + 5, + 6, // bar 2 + 7, + 6, + 5, + 4, + 3, + 2, + 1, + 0, // bar 3 + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, // bar 4 }; std::vector barMap; @@ -240,9 +301,9 @@ class NeopixelManager : public okay::System { void neutral(float time) { static std::vector palette = {colorFromHex(0x4E2A84), - colorFromHex(0x4E2A84), - colorFromHex(0x00000), - colorFromHex(0x00000)}; + colorFromHex(0x4E2A84), + colorFromHex(0x00000), + colorFromHex(0x00000)}; const float moveSpeed = 1 / 200.0f; for (int i = 0; i < 5; i++) { // for all 5 bars @@ -312,10 +373,9 @@ class NeopixelManager : public okay::System { // turn off the rest of the pixels for (int j = numFull; j < numPixels; j++) { if (j == numFull) { - glm::vec4 color = - glm::mix(botColor, - topColor, - static_cast(j) / static_cast(numPixels)); + glm::vec4 color = glm::mix(botColor, + topColor, + static_cast(j) / static_cast(numPixels)); // set it to partial brightness to make a smoother transition glm::vec4 partialColor = color * (throttlePercentage * numPixels - numFull); getBar(i).setColor(j, partialColor); diff --git a/dash/platform/rpi/button.cpp b/dash/platform/rpi/button.cpp index f2ec2f9..c7397e7 100644 --- a/dash/platform/rpi/button.cpp +++ b/dash/platform/rpi/button.cpp @@ -8,11 +8,16 @@ Button::Button(uint8_t gpioPin) : _buttonID(gpioPin), _gpio(std::make_unique(gpioPin, false)) { InputManager::instance().registerButton(_buttonID); - _gpio->attachInterrupt([id = _buttonID]() { InputManager::instance().executeUpCallbacks(id); }, - GPIO::EdgeType::FALLING); + _gpio->attachInterrupt( + [id = _buttonID]() { + InputManager::instance().executeUpCallbacks(id); + }, + GPIO::EdgeType::FALLING); _gpio->attachInterrupt( - [id = _buttonID]() { InputManager::instance().executeDownCallbacks(id); }, + [id = _buttonID]() { + InputManager::instance().executeDownCallbacks(id); + }, GPIO::EdgeType::RISING); } diff --git a/dash/platform/rpi/can.cpp b/dash/platform/rpi/can.cpp index e5addad..4bc192c 100644 --- a/dash/platform/rpi/can.cpp +++ b/dash/platform/rpi/can.cpp @@ -1,8 +1,9 @@ +#include + #include #include #include #include -#include #include #include #include diff --git a/dash/platform/rpi/encoder.cpp b/dash/platform/rpi/encoder.cpp index 7b29882..05eb57e 100644 --- a/dash/platform/rpi/encoder.cpp +++ b/dash/platform/rpi/encoder.cpp @@ -14,11 +14,17 @@ Encoder::Encoder(uint8_t leftPin, uint8_t rightPin) _rightGPIO(std::make_unique(rightPin, false)) { InputManager::instance().registerEncoder(_encoderID, leftPin, rightPin); - _leftGPIO->attachInterrupt([id = _encoderID]() { InputManager::instance().onEncoderEdge(id); }, - GPIO::EdgeType::BOTH); - - _rightGPIO->attachInterrupt([id = _encoderID]() { InputManager::instance().onEncoderEdge(id); }, - GPIO::EdgeType::BOTH); + _leftGPIO->attachInterrupt( + [id = _encoderID]() { + InputManager::instance().onEncoderEdge(id); + }, + GPIO::EdgeType::BOTH); + + _rightGPIO->attachInterrupt( + [id = _encoderID]() { + InputManager::instance().onEncoderEdge(id); + }, + GPIO::EdgeType::BOTH); } Encoder::~Encoder() { diff --git a/dash/platform/rpi/gpio.cpp b/dash/platform/rpi/gpio.cpp index 2e4ab4c..3ae18c4 100644 --- a/dash/platform/rpi/gpio.cpp +++ b/dash/platform/rpi/gpio.cpp @@ -22,8 +22,8 @@ struct GPIO::GPIOImpl { bool err; GPIOImpl(uint8_t pin, bool output) : _pin(pin), _isOutput(output) { - _settings.set_direction(output ? gpiod::line::direction::OUTPUT - : gpiod::line::direction::INPUT); + _settings.set_direction( + output ? gpiod::line::direction::OUTPUT : gpiod::line::direction::INPUT); if (!output) { _settings.set_edge_detection(gpiod::line::edge::BOTH); @@ -32,7 +32,9 @@ struct GPIO::GPIOImpl { err = !GPIOManager::instance().registerPin(_pin, _settings); } - ~GPIOImpl() { GPIOManager::instance().releasePin(_pin); } + ~GPIOImpl() { + GPIOManager::instance().releasePin(_pin); + } bool write(GpioLevel level) { if (!_isOutput) @@ -55,11 +57,12 @@ struct GPIO::GPIOImpl { GPIOManager::instance().registerInterrupt(_pin, _settings, callback, edge); } - bool checkError() { return err; } + bool checkError() { + return err; + } }; -GPIO::GPIO(uint8_t pin, bool output) : _impl(std::make_unique(pin, output)) { -} +GPIO::GPIO(uint8_t pin, bool output) : _impl(std::make_unique(pin, output)) {} GPIO::~GPIO() = default; diff --git a/dash/platform/rpi/gpio_manager.cpp b/dash/platform/rpi/gpio_manager.cpp index a25486b..c55c71b 100644 --- a/dash/platform/rpi/gpio_manager.cpp +++ b/dash/platform/rpi/gpio_manager.cpp @@ -1,5 +1,6 @@ -#include #include + +#include #include namespace dash { @@ -9,8 +10,7 @@ GPIOManager& GPIOManager::instance() { return instance; } -GPIOManager::GPIOManager() : _chip(std::make_unique("/dev/gpiochip0")) { -} +GPIOManager::GPIOManager() : _chip(std::make_unique("/dev/gpiochip0")) {} bool GPIOManager::registerPin(uint8_t offset, gpiod::line_settings settings) { if (_settings.find(offset) != _settings.end()) { @@ -41,9 +41,9 @@ void GPIOManager::releasePin(uint8_t offset) { } void GPIOManager::registerInterrupt(uint8_t offset, - gpiod::line_settings settings, - std::function callback, - GPIO::EdgeType edge) { + gpiod::line_settings settings, + std::function callback, + GPIO::EdgeType edge) { _settings[offset] = settings; if (edge == GPIO::EdgeType::FALLING || edge == GPIO::EdgeType::BOTH) { diff --git a/dash/platform/rpi/gpio_manager.hpp b/dash/platform/rpi/gpio_manager.hpp index f211abc..b921b7d 100644 --- a/dash/platform/rpi/gpio_manager.hpp +++ b/dash/platform/rpi/gpio_manager.hpp @@ -15,9 +15,9 @@ class GPIOManager { bool registerPin(uint8_t offset, gpiod::line_settings settings); void releasePin(uint8_t offset); void registerInterrupt(uint8_t offset, - gpiod::line_settings settings, - std::function callback, - GPIO::EdgeType edge); + gpiod::line_settings settings, + std::function callback, + GPIO::EdgeType edge); void start(); diff --git a/dash/platform/rpi/neopixel.cpp b/dash/platform/rpi/neopixel.cpp index 05d9581..20cd0b1 100644 --- a/dash/platform/rpi/neopixel.cpp +++ b/dash/platform/rpi/neopixel.cpp @@ -1,10 +1,11 @@ #include "platform/rpi/gpio_manager.hpp" +#include + #include #include #include #include -#include #include extern "C" { @@ -29,21 +30,262 @@ namespace dash { #define DMA 10 #define STRIP_TYPE WS2811_STRIP_GBR // WS2812/SK6812RGB integrated chip+leds -uint8_t gamma8[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, - 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, - 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, - 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, - 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 39, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, - 83, 85, 86, 87, 89, 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 109, 110, - 112, 114, 115, 117, 119, 120, 122, 124, 126, 127, 129, 131, 133, 135, 137, 138, 140, 142, 144, - 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 167, 169, 171, 173, 175, 177, 180, 182, 184, - 186, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213, 215, 218, 220, 223, 225, 228, 231, - 233, 236, 239, 241, 244, 247, 249, 252, 255}; +uint8_t gamma8[] = {0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 5, + 5, + 5, + 5, + 6, + 6, + 6, + 6, + 7, + 7, + 7, + 7, + 8, + 8, + 8, + 9, + 9, + 9, + 10, + 10, + 10, + 11, + 11, + 11, + 12, + 12, + 13, + 13, + 13, + 14, + 14, + 15, + 15, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 24, + 24, + 25, + 25, + 26, + 27, + 27, + 28, + 29, + 29, + 30, + 31, + 32, + 32, + 33, + 34, + 35, + 35, + 36, + 37, + 38, + 39, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 50, + 51, + 52, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 66, + 67, + 68, + 69, + 70, + 72, + 73, + 74, + 75, + 77, + 78, + 79, + 81, + 82, + 83, + 85, + 86, + 87, + 89, + 90, + 92, + 93, + 95, + 96, + 98, + 99, + 101, + 102, + 104, + 105, + 107, + 109, + 110, + 112, + 114, + 115, + 117, + 119, + 120, + 122, + 124, + 126, + 127, + 129, + 131, + 133, + 135, + 137, + 138, + 140, + 142, + 144, + 146, + 148, + 150, + 152, + 154, + 156, + 158, + 160, + 162, + 164, + 167, + 169, + 171, + 173, + 175, + 177, + 180, + 182, + 184, + 186, + 189, + 191, + 193, + 196, + 198, + 200, + 203, + 205, + 208, + 210, + 213, + 215, + 218, + 220, + 223, + 225, + 228, + 231, + 233, + 236, + 239, + 241, + 244, + 247, + 249, + 252, + 255}; static ws2811_t s_ledString = { .freq = TARGET_FREQ, @@ -88,10 +330,8 @@ struct NeopixelStrip::NeopixelImpl { int channel; }; -NeopixelStrip::NeopixelStrip() : _impl(std::make_unique()) { -} -NeopixelStrip::~NeopixelStrip() { -} +NeopixelStrip::NeopixelStrip() : _impl(std::make_unique()) {} +NeopixelStrip::~NeopixelStrip() {} void NeopixelStrip::init(const int& pin, const int& numLeds) { _impl->pin = pin; @@ -115,8 +355,8 @@ void NeopixelStrip::init(const int& pin, const int& numLeds) { ws2811_return_t code = ws2811_init(&s_ledString); if (code != WS2811_SUCCESS) { - okay::Engine.logger.error("Unable to initialize neopixels : {}", - ws2811_get_return_t_str(code)); + okay::Engine.logger.error( + "Unable to initialize neopixels : {}", ws2811_get_return_t_str(code)); } gpiod::line_settings outputSettings; diff --git a/dash/platform/rpi/spi.cpp b/dash/platform/rpi/spi.cpp index eb9a13d..c588bf1 100644 --- a/dash/platform/rpi/spi.cpp +++ b/dash/platform/rpi/spi.cpp @@ -19,7 +19,9 @@ struct SPIError { bool open_err = false; bool config_err = false; - bool checkError() { return open_err || config_err; } + bool checkError() { + return open_err || config_err; + } }; struct SPI::SPIImpl { @@ -82,12 +84,13 @@ struct SPI::SPIImpl { return ok; } - bool write(const uint8_t* tx, size_t len) { return transfer(tx, nullptr, len); } + bool write(const uint8_t* tx, size_t len) { + return transfer(tx, nullptr, len); + } }; SPI::SPI(const std::string& device, uint32_t speedHz, uint8_t mode, uint8_t bitsPerWord) - : _impl(std::make_unique(device, speedHz, mode, bitsPerWord)) { -} + : _impl(std::make_unique(device, speedHz, mode, bitsPerWord)) {} SPI::~SPI() = default; diff --git a/dash/ui/CMakeLists.txt b/dash/ui/CMakeLists.txt new file mode 100644 index 0000000..d6e39c5 --- /dev/null +++ b/dash/ui/CMakeLists.txt @@ -0,0 +1,26 @@ +# ui/CMakeLists.txt + +add_library(dash_ui STATIC) + +file(GLOB_RECURSE DASH_UI_SOURCES CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cxx" + "${CMAKE_CURRENT_SOURCE_DIR}/*.cc" + "${CMAKE_CURRENT_SOURCE_DIR}/*.c" + "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/*.h" +) + +target_sources(dash_ui PRIVATE + ${DASH_UI_SOURCES} +) + +target_include_directories(dash_ui PUBLIC + "${OKAY_PROJECT_ROOT_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" +) + +target_link_libraries(dash_ui PUBLIC + okay + nfr_canlib +) diff --git a/dash/ui/components/rotate.hpp b/dash/ui/components/rotate.hpp new file mode 100644 index 0000000..011f3d7 --- /dev/null +++ b/dash/ui/components/rotate.hpp @@ -0,0 +1,31 @@ +#ifndef __ROTATE_H__ +#define __ROTATE_H__ + +#include + +#include + +namespace dash { + +struct RotateComponent { + float speed{5.0f}; + + RotateComponent() {} + RotateComponent(float speed) : speed(speed) {} +}; + +class RotateSystem + : public okay::ECSSystem> { + public: + void onPreTick(QueryT::Item& item) override { + auto& [transform, rotateComponent] = item.components; + float theta = + okay::Engine.time->timeSinceStartSec() * rotateComponent.speed * glm::pi(); + glm::quat rot = glm::angleAxis(theta, glm::vec3(0.0, 1.0, 0.0f)); + transform->rotation = rot; + } +}; + +} // namespace dash + +#endif // __ROTATE_H__ diff --git a/dash/ui/drive_page.cpp b/dash/ui/drive_page.cpp new file mode 100644 index 0000000..23993ff --- /dev/null +++ b/dash/ui/drive_page.cpp @@ -0,0 +1 @@ +#include "drive_page.hpp" diff --git a/dash/ui/drive_page.hpp b/dash/ui/drive_page.hpp new file mode 100644 index 0000000..033ece1 --- /dev/null +++ b/dash/ui/drive_page.hpp @@ -0,0 +1,135 @@ +#ifndef __DRIVE_PAGE_H__ +#define __DRIVE_PAGE_H__ + +#include "components/rotate.hpp" +#include "materials/speedometer.hpp" +#include "page.hpp" +#include "shared_elements.hpp" +#include "style.hpp" + +#include + +#include +#include + +namespace ui = okay::ui; + +namespace dash { + +#define BIND_TO_THIS(fnName) \ + [this]() { \ + return this->fnName(); \ + } + +#define LAMBDA_WRAP(fn) \ + []() { \ + return fn(); \ + } + +class DrivePage : public IPage { + public: + DrivePage() {} + + void initializePage() { + okay::ShaderHandle objectShader = + okay::shaderHandle(okay::load::engineShader("shaders/lit")); + auto materialProperties = std::make_unique(); + materialProperties->color.set(glm::vec4(1.0f, 1.0f, 0.0f, 1.0f)); + okay::MaterialHandle objectMaterial = + okay::materialHandle(objectShader, std::move(materialProperties)); + + okay::ecs::entity() + .addComponent(glm::vec3(), + glm::vec3(0.1f), + glm::angleAxis(glm::radians(-25.0f), glm::vec3(2.0f, 3.0f, 1.0f))) + .addComponent( + okay::LightComponent::directional(glm::vec3{1, 1, 1}, 2.5f)); + + centerMesh = okay::mesh(*centerMeshData); + + okay::UIStyle::main().setMainFont(*fonts::latoBold); + + auto speedometerProperties = std::make_unique(); + speedometerProperties->isTransparent = true; + speedometerProperties->useScreenspaceCoords = true; + speedometerProperties->color = colors::white; + speedometerProperties->albedo = *speedometerTexture; + speedometerProperties->trailColor = colors::fromHex(0xA304FFFF); + speedometerProperties->angle = glm::radians(45.0f); + speedometerProperties->trailRads = glm::radians(120.0f); + speedometerProperties->bgColor = colors::fromHex(0x342F2EFF); + + okay::Engine.systems.getSystemChecked()->setSkyboxMaterial( + dash::SharedElements::get().skyboxMaterial); + + speedometerMaterial = okay::materialHandle( + okay::shaderHandle(*speedometerShader), std::move(speedometerProperties)); + + _entities = { + okay::ecs::uiEntity(LAMBDA_WRAP(SharedElements::get().buildTopHud), 2), + okay::ecs::uiEntity(LAMBDA_WRAP(SharedElements::get().buildBotHud), 2), + okay::ecs::uiEntity(LAMBDA_WRAP(SharedElements::get().buildDriveStatus), 1), + okay::ecs::uiEntity(BIND_TO_THIS(buildSpeedometer), 1), + okay::ecs::entity() + .addComponent( + glm::vec3(0.0f), glm::vec3(0.5f), glm::identity()) + .addComponent( + centerMesh, objectMaterial, static_cast(255)) + .addComponent(0.25f), + okay::ecs::entity() + .addComponent(glm::vec3{0.0f, 0.0f, 30.0f}) + .addComponent( + okay::CameraComponent{okay::Camera::PerspectiveLens{45.0f, 0.1f, 100.0f}}), + }; + } + + void closePage() { + for (okay::ECSEntity& entity : _entities) { + entity.destroy(); + } + } + + okay::UIElement buildSpeedometer() { + auto props = dynamic_cast(speedometerMaterial->properties().get()); + props->angle = glm::radians(okay::Engine.time->timeSinceStartSec() * 20.0f); + const int textWidth = 150; + // clang-format off + return ui::flexbox().topMarginSet(25)( + ui::box() + .backgroundColorSet(colors::white) + .backgroundMaterialOverrideSet(speedometerMaterial) + .backgroundImageSet(*speedometerTexture)( + ui::spacer(), + ui::h1("75") + .widthSet(okay::size::Fixed(textWidth)) + .heightFit() + .alignTextCenter() + .textSizeSet(48.0f) + .fontSet(*fonts::latoBlack), + ui::h1("MPH") + .widthSet(okay::size::Fixed(textWidth)) + .heightFit() + .alignTextCenter() + .textSizeSet(20.0f), + ui::spacer() + ) + ); + // clang-format on + } + + private: + std::vector _entities; + + okay::Mesh centerMesh{okay::Mesh::none()}; + okay::EngineAssetRef centerMeshData{"models/teapot.obj"}; + + // speedometer + okay::MaterialHandle speedometerMaterial; + okay::GameAssetRef speedometerShader{"shaders/speedometer"}; + okay::GameAssetRef speedometerTexture{ + "textures/speedometer.png"}; +}; + +} // namespace dash + +#endif diff --git a/dash/ui/error_page.hpp b/dash/ui/error_page.hpp new file mode 100644 index 0000000..2578482 --- /dev/null +++ b/dash/ui/error_page.hpp @@ -0,0 +1,308 @@ +#ifndef __ERROR_PAGE_H__ +#define __ERROR_PAGE_H__ + +#include "okay/core/ui/builder.hpp" +#include "okay/core/ui/element.hpp" +#include "okay/core/ui/text_layout.hpp" +#include "page.hpp" +#include "style.hpp" + +#include + +#include +#include + +namespace ui = okay::ui; + +namespace dash { + +#ifndef BIND_TO_THIS +#define BIND_TO_THIS(fnName) \ + [this]() { \ + return this->fnName(); \ + } +#endif + +class ErrorPage : public IPage { + public: + ErrorPage() {} + + void initializePage() { + okay::Engine.logger.debug("Creating entities for Error page!"); + + okay::ShaderHandle skyboxShader = + okay::shaderHandle(okay::load::shader("shaders/background")); + auto skyboxProperties = std::make_unique(); + skyboxProperties->albedo = *bgTexture; + skyboxProperties->color = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f); + skyboxProperties->isTransparent = false; + skyboxProperties->useScreenspaceCoords = true; + skyboxProperties->doubleSided = true; + okay::MaterialHandle skyboxMaterial = + okay::materialHandle(skyboxShader, std::move(skyboxProperties)); + okay::Engine.systems.getSystemChecked()->setSkyboxMaterial(skyboxMaterial); + + okay::UIStyle::main().setMainFont(*latoBold); + + _entities = { + okay::ecs::uiEntity(BIND_TO_THIS(buildTopHud), 2), + okay::ecs::uiEntity(BIND_TO_THIS(buildContent), 2), + okay::ecs::uiEntity(BIND_TO_THIS(buildDriveStatus), 1), + }; + } + + void closePage() { + for (okay::ECSEntity& entity : _entities) { + entity.destroy(); + } + } + + okay::UIElement buildTopHud() { + const float largeFontSize = 32.0f; + + return ui::relFrame(0.0f, 0.0f, 1.0f, 0.125f) ( + ui::image(*topBar) ( + ui::text(std::format("log_{:04}.nfr", dbc::telemetryStatus::logFile->get())) + .widthSet(okay::size::Percent(1.0f)) + .textSizeSet(largeFontSize) + .alignTextCenter() + .fontSet(*latoBlack) + .topMarginSet(okay::size::Fixed(10)) + ) + ); + } + + okay::UIElement buildContent() { + const float largeFontSize = 32.0f; + const float medFontSize = 24.0f; + const float smallFontSize = 16.0f; + + return ui::relFrame(0.0625f, 0.21, 0.9375f, 0.71)( + ui::flexbox() + .axisSet(okay::UIAxis::Horizontal) + .widthGrow() + .heightGrow() ( + // Error list + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::image(*errorCodeTop) ( + ui::text("BMS") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeMid) ( + ui::text("OUR_VOLT") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeMid) ( + ui::text("OUR_TEMP") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeBot), + ui::spacer() + .widthSet(okay::size::Fixed(25)), + ui::image(*errorCodeTop) ( + ui::text("ECU") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeMid) ( + ui::text("IMPLS_PRSNT") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeMid) ( + ui::text("IMPLS_BRK_INVLD_IMP") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeMid) ( + ui::text("IMPLS_APPS_INVLD_IMP") + .widthGrow() + .textSizeSet(medFontSize) + .leftMarginSet(15) + ), + ui::image(*errorCodeBot), + ui::spacer() + ), + // Temperature info + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() + .topMarginSet(okay::size::Fixed(10)) ( + ui::image(*tempFull) ( + ui::spacer(), + ui::text("CELL") + .widthGrow() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer(), + ui::flexbox() + .axisSet(okay::UIAxis::Horizontal) + .widthGrow() + .heightSet(okay::size::Fixed(64)) + .bottomMarginSet(8) ( + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::spacer(), + ui::text("minimum") + .widthGrow() + .textSizeSet(smallFontSize) + .alignTextCenter(), + ui::text("3.79") + .widthGrow() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer() + ), + ui::spacer() + .widthSet(okay::size::Fixed(14)), + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::spacer(), + ui::text("maximum") + .widthGrow() + .textSizeSet(smallFontSize) + .alignTextCenter(), + ui::text("19") + .widthGrow() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer() + ) + ), + ui::spacer() + .widthSet(okay::size::Fixed(20)), + ui::text("IGBT") + .widthGrow() + .textSizeSet(largeFontSize) + .alignTextCenter() + .bottomMarginSet(10), + ui::spacer(), + ui::flexbox() + .axisSet(okay::UIAxis::Horizontal) + .widthGrow() + .heightSet(okay::size::Fixed(64)) ( + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::spacer(), + ui::text("left") + .widthGrow() + .heightFit() + .textSizeSet(smallFontSize) + .alignTextCenter(), + ui::text("3.79") + .widthGrow() + .heightFit() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer() + ), + ui::spacer() + .widthSet(okay::size::Fixed(6)), + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::spacer(), + ui::text("rear") + .widthGrow() + .heightFit() + .textSizeSet(smallFontSize) + .alignTextTop() + .alignTextCenter(), + ui::text("19") + .widthGrow() + .heightFit() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer() + ), + ui::spacer() + .widthSet(okay::size::Fixed(6)), + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .widthGrow() + .heightGrow() ( + ui::spacer(), + ui::text("right") + .widthGrow() + .heightFit() + .textSizeSet(smallFontSize) + .alignTextCenter(), + ui::text("19") + .widthGrow() + .heightFit() + .textSizeSet(largeFontSize) + .alignTextCenter(), + ui::spacer() + ) + ) + ) + ) + ) + ); + } + + okay::UIElement buildDriveStatus() { + // clang-format off + return ui::relFrame(0.0f, 0.0f, 1.0f, 1.0f)( + ui::spacer(), + ui::row()( + ui::spacer(), + ui::image(*stateShape)(ui::text("FAULT") + .widthGrow() + .textSizeSet(32.0f) + .alignTextCenter() + .alignTextMiddle() + .fontSet(*latoBlack) + .topMarginSet(8)) + .backgroundColorSet(colors::fromHex(0xEB2121FF)), + ui::spacer() + ) + ); + // clang-format on + } + + private: + std::vector _entities; + + okay::GameAssetRef bgTexture{ + "textures/bg_pattern.png"}; + okay::GameAssetRef topBar{"textures/top_bar.png"}; + + okay::GameAssetRef errorCodeTop{"textures/error_code_top.png"}; + okay::GameAssetRef errorCodeMid{"textures/error_code_mid.png"}; + okay::GameAssetRef errorCodeBot{"textures/error_code_bot.png"}; + + okay::GameAssetRef tempFull{"textures/temp_full.png"}; + + okay::GameAssetRef botBar{"textures/bottom_bar.png"}; + okay::GameAssetRef stateShape{ + "textures/state_shape.png"}; + okay::GameAssetRef latoBlack{ + "fonts/Lato-Black.ttf"}; + okay::GameAssetRef latoBold{ + "fonts/Lato-Bold.ttf"}; +}; + +} // namespace dash + +#endif diff --git a/dash/ui/materials/bat_percent.hpp b/dash/ui/materials/bat_percent.hpp new file mode 100644 index 0000000..6d63321 --- /dev/null +++ b/dash/ui/materials/bat_percent.hpp @@ -0,0 +1,48 @@ +#ifndef __BAT_PERCENT_H__ +#define __BAT_PERCENT_H__ + +#include + +#include + +namespace dash { + +struct BatPercentMaterial : public okay::UIRectProperties, + okay::OkayMaterialProperties { + public: + okay::UniformProperty percent{0.0f}; + okay::UniformProperty barColor{glm::vec4(1.0f)}; + okay::UniformProperty bgColor{glm::vec4(1.0f)}; + + auto uniformRefs() { + return std::tuple_cat( + okay::UIRectProperties::uniformRefs(), std::tie(percent, barColor, bgColor)); + } + + auto uniformRefs() const { + return std::tuple_cat( + okay::UIRectProperties::uniformRefs(), std::tie(percent, barColor, bgColor)); + } + + auto uniformBlockRefs() const { + return okay::UIRectProperties::uniformBlockRefs(); + } + + auto textureRefs() { + return okay::UIRectProperties::textureRefs(); + } + + auto textureRefs() const { + return okay::UIRectProperties::textureRefs(); + } + + okay::MaterialFlagCollection flags() { + okay::MaterialFlagCollection flags = okay::SceneMaterialProperties::flags(); + flags.addFlag(okay::MaterialFlags::UNLIT); + return flags; + } +}; + +} // namespace dash + +#endif // __BAT_PERCENT_H__ diff --git a/dash/ui/materials/speedometer.hpp b/dash/ui/materials/speedometer.hpp new file mode 100644 index 0000000..b245339 --- /dev/null +++ b/dash/ui/materials/speedometer.hpp @@ -0,0 +1,51 @@ +#ifndef __SPEEDOMETER_H__ +#define __SPEEDOMETER_H__ + +#include + +#include + +namespace dash { + +struct SpeedometerMaterial : public okay::UIRectProperties, + okay::OkayMaterialProperties { + public: + okay::UniformProperty angle{0.0f}; + okay::UniformProperty trailRads{glm::radians(30.0f)}; + okay::UniformProperty trailColor{glm::vec4(1.0f)}; + okay::UniformProperty needleColor{ + glm::vec4(1.0f)}; + okay::UniformProperty bgColor{glm::vec4(1.0f)}; + + auto uniformRefs() { + return std::tuple_cat(okay::UIRectProperties::uniformRefs(), + std::tie(angle, trailRads, trailColor, needleColor, bgColor)); + } + + auto uniformRefs() const { + return std::tuple_cat(okay::UIRectProperties::uniformRefs(), + std::tie(angle, trailRads, trailColor, needleColor, bgColor)); + } + + auto uniformBlockRefs() const { + return okay::UIRectProperties::uniformBlockRefs(); + } + + auto textureRefs() { + return okay::UIRectProperties::textureRefs(); + } + + auto textureRefs() const { + return okay::UIRectProperties::textureRefs(); + } + + okay::MaterialFlagCollection flags() { + okay::MaterialFlagCollection flags = okay::SceneMaterialProperties::flags(); + flags.addFlag(okay::MaterialFlags::UNLIT); + return flags; + } +}; + +} // namespace dash + +#endif // __SPEEDOMETER_H__ diff --git a/dash/ui/page.hpp b/dash/ui/page.hpp new file mode 100644 index 0000000..06e6221 --- /dev/null +++ b/dash/ui/page.hpp @@ -0,0 +1,127 @@ +#ifndef __PAGE_H__ +#define __PAGE_H__ + +#include + +#include +#include +#include +#include + +namespace dash { + +class IPage { + public: + virtual ~IPage() = default; + + virtual void initializePage() = 0; + virtual void closePage() = 0; +}; + +struct PageEntry { + std::unique_ptr page{nullptr}; + std::function activeWhenPred{[]() { + return false; + }}; + std::size_t priority{0}; + + PageEntry() = default; + + explicit PageEntry(std::unique_ptr newPage) : page(std::move(newPage)) {} + + static PageEntry create(std::unique_ptr page) { + return PageEntry(std::move(page)); + } + + PageEntry& activeWhen(std::function fn) { + activeWhenPred = std::move(fn); + return *this; + } + + PageEntry& withPriority(std::size_t newPriority) { + priority = newPriority; + return *this; + } + + PageEntry(PageEntry&&) noexcept = default; + PageEntry& operator=(PageEntry&&) noexcept = default; + + PageEntry(const PageEntry&) = delete; + PageEntry& operator=(const PageEntry&) = delete; +}; + +class PageManager : public okay::System { + public: + template + explicit PageManager(Pages&&... pages) { + (_pages.emplace_back(std::move(pages)), ...); + } + + void initialize() { + _currentPage = findActivePage(); + + if (hasCurrentPage()) { + okay::Engine.logger.debug("Creating page enties"); + _pages[_currentPage].page->initializePage(); + } + + okay::Engine.logger.debug("Current page {}", _currentPage); + } + + void tick() { + std::size_t nextPage = findActivePage(); + + if (nextPage == _currentPage) { + return; + } + + if (hasCurrentPage()) { + okay::Engine.logger.debug("Freeing entites from page"); + _pages[_currentPage].page->closePage(); + } + + _currentPage = nextPage; + + okay::Engine.logger.debug("Current page {}", _currentPage); + + if (hasCurrentPage()) { + okay::Engine.logger.debug("Creating page enties"); + _pages[_currentPage].page->initializePage(); + } + } + + private: + static constexpr std::size_t NO_PAGE = static_cast(-1); + + std::vector _pages; + std::size_t _currentPage{NO_PAGE}; + + bool hasCurrentPage() const { + return _currentPage != NO_PAGE && _currentPage < _pages.size() && + _pages[_currentPage].page != nullptr; + } + + std::size_t findActivePage() const { + std::size_t bestPage = NO_PAGE; + std::size_t bestPriority = 0; + + for (std::size_t i = 0; i < _pages.size(); ++i) { + const PageEntry& entry = _pages[i]; + + if (!entry.activeWhenPred()) { + continue; + } + + if (bestPage == NO_PAGE || entry.priority > bestPriority) { + bestPage = i; + bestPriority = entry.priority; + } + } + + return bestPage; + } +}; + +} // namespace dash + +#endif // __PAGE_H__ diff --git a/dash/ui/shared_elements.hpp b/dash/ui/shared_elements.hpp new file mode 100644 index 0000000..cad2525 --- /dev/null +++ b/dash/ui/shared_elements.hpp @@ -0,0 +1,214 @@ +#ifndef __SHARED_ELEMENTS_H__ +#define __SHARED_ELEMENTS_H__ + +#include "materials/bat_percent.hpp" +#include "style.hpp" + +#include + +#include +#include + +namespace ui = okay::ui; + +namespace dash { + +class SharedElements { + public: + static SharedElements& get() { + static SharedElements elements; + return elements; + } + + SharedElements() { + // Skybox shaer + okay::ShaderHandle skyboxShader = + okay::shaderHandle(okay::load::shader("shaders/background")); + auto skyboxProperties = std::make_unique(); + skyboxProperties->albedo = *bgTexture; + skyboxProperties->color = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f); + skyboxProperties->isTransparent = false; + skyboxProperties->useScreenspaceCoords = true; + skyboxProperties->doubleSided = true; + skyboxMaterial = okay::materialHandle(skyboxShader, std::move(skyboxProperties)); + + auto batPercentProperties = std::make_unique(); + batPercentProperties->isTransparent = true; + batPercentProperties->useScreenspaceCoords = true; + batPercentProperties->color = colors::white; + batPercentProperties->albedo = *batPerecentBG; + batPercentProperties->barColor = colors::fromHex(0xA304FFFF); + batPercentProperties->bgColor = colors::fromHex(0x565150FF); + + batPercentMaterial = okay::materialHandle( + okay::shaderHandle(*batPercentShader), std::move(batPercentProperties)); + } + + okay::UIElement buildTopHud() { + auto props = dynamic_cast(batPercentMaterial->properties().get()); + props->percent = dbc::bmsStatus::bmsSoc->get(); + // clang-format off + return ui::image(*topBar) + .axisSet(okay::UIAxis::Horizontal) ( + ui::spacer(), + ui::flexbox() + .axisSet(okay::UIAxis::Vertical) + .heightGrow() + ( + ui::spacer(), + ui::image(*batPerecentBG) + .backgroundColorSet(colors::white) + .backgroundMaterialOverrideSet(batPercentMaterial) + .axisSet(okay::UIAxis::Horizontal) ( + ui::spacer(), + ui::image(*batPerecentOverlay) + .textSet(std::format("{:.1f}%", dbc::bmsStatus::bmsSoc->get() * 100.0f)) + .alignTextCenter() + .alignTextMiddle() + .fontSet(*fonts::latoBlack) + .textSizeSet(24.0f), + ui::spacer() + ), + ui::spacer() + ), + ui::spacer() + ); + // clang-format on + } + + okay::UIElement buildBotHud() { + const float outerPercent = 0.20f; + const float valuePercent = 0.12f; + const float labelPercent = 0.05f; + const float largeFontSize = 32.0f; + const float medFontSize = 24.0f; + + // clang-format off + return ui::relFrame(0.0f, 0.0f, 1.0f, 1.0f)( + ui::spacer(), + ui::image(*botBar) + .axisSet(okay::UIAxis::Vertical) ( + ui::spacer(), + ui::flexbox() + .axisSet(okay::UIAxis::Horizontal) + .bottomMarginSet(5) + .widthSet(okay::size::Percent(1.0f)) ( + ui::text(std::format("log_{:04}.nfr", dbc::telemetryStatus::logFile->get())) + .widthSet(okay::size::Percent(outerPercent)) + .textSizeSet(largeFontSize) + .alignTextLeft() + .leftMarginSet(10) + .fontSet(*fonts::latoBlack) + .alignTextBottom() + .heightGrow(), + ui::text(std::format("{:.2f}", dbc::pdmBatVolt::batVolt->get())) + .widthSet(okay::size::Percent(valuePercent)) + .textSizeSet(medFontSize) + .alignTextCenter() + .alignTextBottom() + .heightGrow(), + ui::text("LV") + .widthSet(okay::size::Percent(labelPercent)) + .textSizeSet(medFontSize) + .alignTextCenter() + .alignTextBottom() + .heightGrow(), + ui::spacer(), + ui::text("HV") + .widthSet(okay::size::Percent(labelPercent)) + .textSizeSet(medFontSize) + .alignTextCenter() + .alignTextBottom() + .heightGrow(), + ui::text(std::format("{:.2f}", dbc::bmsSoe::batteryVoltage->get())) + .widthSet(okay::size::Percent(valuePercent)) + .textSizeSet(medFontSize) + .alignTextCenter() + .alignTextBottom() + .heightGrow(), + ui::text(std::format("{:.2f} mi", dbc::telemetryOdometer::milesDriven->get())) + .widthSet(okay::size::Percent(outerPercent)) + .textSizeSet(largeFontSize) + .alignTextRight() + .rightMarginSet(10) + .fontSet(*fonts::latoBlack) + .alignTextBottom() + .heightGrow() + ) + ) + ); + // clang-format on + } + + okay::UIElement buildDriveStatus() { + // clang-format off + return ui::relFrame(0.0f, 0.0f, 1.0f, 1.0f)( + ui::spacer(), + ui::row()( + ui::spacer(), + ui::image(*stateShape)(ui::text(getDriveStateString()) + .widthGrow() + .heightGrow() + .textSizeSet(32.0f) + .alignTextCenter() + .alignTextMiddle() + .fontSet(*fonts::latoBlack) + .topMarginSet(8)) + .backgroundColorSet(getDriveStateColor()), + ui::spacer() + ) + ); + // clang-format on + } + + std::string getDriveStateString() { + switch (dbc::ecuDriveStatus::driveState->get()) { + case 0: + return "IDLE"; + case 1: + return "PRECHARGE"; + case 2: + return "NEUTRAL"; + case 3: + return "DRIVE"; + default: + return "UNKNOWN"; + } + } + + glm::vec4 getDriveStateColor() { + switch (dbc::ecuDriveStatus::driveState->get()) { + case 0: + return colors::fromHex(0x219EEBFF); + case 1: + return colors::fromHex(0xEBCD21FF); + case 2: + return colors::northwesternPurple; + case 3: + return colors::fromHex(0x38EB21FF); + default: + return colors::fromHex(0xFF00FFFF); + } + } + + okay::MaterialHandle skyboxMaterial; + + okay::GameAssetRef bgTexture{ + "textures/bg_pattern.png"}; + okay::GameAssetRef topBar{"textures/top_bar.png"}; + okay::GameAssetRef botBar{"textures/bottom_bar.png"}; + okay::GameAssetRef stateShape{ + "textures/state_shape.png"}; + + // Battery Percentage + okay::MaterialHandle batPercentMaterial; + okay::GameAssetRef batPercentShader{"shaders/battery"}; + okay::GameAssetRef batPerecentBG{ + "textures/bat_percent_bg.png"}; + okay::GameAssetRef batPerecentOverlay{ + "textures/bat_percent_over.png"}; +}; + +}; // namespace dash + +#endif // __SHARED_ELEMENTS_H__ diff --git a/dash/ui/style.hpp b/dash/ui/style.hpp new file mode 100644 index 0000000..99d681b --- /dev/null +++ b/dash/ui/style.hpp @@ -0,0 +1,40 @@ +#ifndef __STYLE_H__ +#define __STYLE_H__ + +#include + +#include + +namespace dash { + +namespace colors { + +static inline constexpr glm::vec4 fromHex(const std::uint32_t color) { + const float inv = 1.0f / 255.0f; + + return glm::vec4{ + static_cast((color >> 24) & 0xFF) * inv, + static_cast((color >> 16) & 0xFF) * inv, + static_cast((color >> 8) & 0xFF) * inv, + static_cast((color >> 0) & 0xFF) * inv, + }; +} + +static constexpr glm::vec4 black = glm::vec4{0.0f, 0.0f, 0.0f, 1.0f}; +static constexpr glm::vec4 white = glm::vec4{1.0f, 1.0f, 1.0f, 1.0f}; +static constexpr glm::vec4 northwesternPurple = fromHex(0x4E2A84FF); + +} // namespace colors + +namespace fonts { + +okay::GameAssetRef latoBlack{ + "fonts/Lato-Black.ttf"}; +okay::GameAssetRef latoBold{ + "fonts/Lato-Bold.ttf"}; + +}; // namespace fonts + +} // namespace dash + +#endif diff --git a/nfr26_dbc.csv b/nfr26_dbc.csv index 4f8c649..6a0cbe7 100644 --- a/nfr26_dbc.csv +++ b/nfr26_dbc.csv @@ -7,6 +7,9 @@ Message ID,Message Name,Sender,Signal Name,Start Bit,Size (bits),Factor,Offset,M 0x2A2,PDM_Bat_Volt,PDM,Bat_Volt,0,16,0.01,0,0,16,V,5000,float,TRUE,FALSE ,PDM_Bat_Volt,PDM,Low_Bat_Volt_Warning,16,8,1,0,0,1,Bool,5000,bool,TRUE,FALSE ,PDM_Bat_Volt,PDM,Danger_Bat_Volt_Warning,24,8,1,0,0,1,Bool,5000,bool,TRUE,FALSE +0x2A3,PDM_Coolant,PDM,Coolant_1_Volt,0,16,0.01,0,0,3.3,V,500,float,TRUE,FALSE +,PDM_Coolant,PDM,Coolant_2_Volt,16,16,0.01,0,0,3.3,V,500,float,TRUE,FALSE +,PDM_Coolant,PDM,Coolant_3_Volt,32,16,0.01,0,0,3.3,V,500,float,TRUE,FALSE 0x28B,Front_Right_Inverter_Motor_Status,Front-Right-Inverter,RPM,0,16,1,0,,,RPM,100,int16_t,TRUE,FALSE ,Front_Right_Inverter_Motor_Status,Front-Right-Inverter,Motor_Current,16,16,0.1,0,,,A,100,int16_t,TRUE,FALSE ,Front_Right_Inverter_Motor_Status,Front-Right-Inverter,DC_Voltage,32,16,0.1,0,,,V,100,int16_t,TRUE,FALSE @@ -121,17 +124,17 @@ Message ID,Message Name,Sender,Signal Name,Start Bit,Size (bits),Factor,Offset,M 0x19: ENCODER_NO_MAGNET 0x1A: ENCODER_MAGNET_TOO_STRONG 0x1B: PHASE_FILTER_FAULT",,uint8_t,TRUE,FALSE -0x20D,ECU_Set_Current_Front_Left_Inverter,ECU,Set_Current_Front_Left_Inverter,0,32,0.001,0,0,50,A,,int32_t,TRUE,FALSE -0x20E,ECU_Set_Current_Brake_Front_Left_Inverter,ECU,Set_Current_Brake_Front_Left_Inverter,0,32,0.001,0,0,50,A,,int32_t,TRUE,FALSE -0x20F,ECU_Set_Current_Front_Right_Inverter,ECU,Set_Current_Front_Right_Inverter,0,32,0.001,0,0,50,A,,int32_t,TRUE,FALSE -0x210,ECU_Set_Current_Brake_Front_Right_Inverter,ECU,Set_Current_Brake_Front_Right_Inverter,0,32,0.001,0,0,50,A,,int32_t,TRUE,FALSE -0x200,ECU_Set_Current_Rear_Inverter,ECU,Set_Current_Rear_Inverter,0,32,0.001,0,0,360,A,,int32_t,TRUE,FALSE -0x201,ECU_Set_Current_Brake_Rear_Inverter,ECU,Set_Current_Brake_Rear_Inverter,0,32,0.001,0,0,360,A,,int32_t,TRUE,FALSE -0x202,ECU_Throttle,ECU,APPS1_Throttle,0,16,1,0,0,2047,,100,int16_t,TRUE,FALSE -,ECU_Throttle,ECU,APPS2_Throttle,16,16,1,0,0,2047,,100,int16_t,TRUE,FALSE -0x203,ECU_Brake,ECU,Front_Brake_Pressure,0,16,1,0,0,32767,,100,int16_t,TRUE,FALSE -,ECU_Brake,ECU,Rear_Brake_Pressure,16,16,1,0,0,32767,,100,int16_t,TRUE,FALSE -,ECU_Brake,ECU,Brake_Pressed,32,8,1,0,0,1,,100,bool,TRUE,FALSE +0x20D,ECU_Set_Current_Front_Left_Inverter,ECU,Set_Current_Front_Left_Inverter,0,32,0.001,0,0,50,A,10,int32_t,TRUE,FALSE +0x20E,ECU_Set_Current_Brake_Front_Left_Inverter,ECU,Set_Current_Brake_Front_Left_Inverter,0,32,0.001,0,0,50,A,10,int32_t,TRUE,FALSE +0x20F,ECU_Set_Current_Front_Right_Inverter,ECU,Set_Current_Front_Right_Inverter,0,32,0.001,0,0,50,A,10,int32_t,TRUE,FALSE +0x210,ECU_Set_Current_Brake_Front_Right_Inverter,ECU,Set_Current_Brake_Front_Right_Inverter,0,32,0.001,0,0,50,A,10,int32_t,TRUE,FALSE +0x200,ECU_Set_Current_Rear_Inverter,ECU,Set_Current_Rear_Inverter,0,32,0.001,0,0,360,A,10,int32_t,TRUE,FALSE +0x201,ECU_Set_Current_Brake_Rear_Inverter,ECU,Set_Current_Brake_Rear_Inverter,0,32,0.001,0,0,360,A,10,int32_t,TRUE,FALSE +0x202,ECU_Throttle,ECU,APPS1_Throttle,0,16,1,0,0,2047,,10,int16_t,TRUE,FALSE +,ECU_Throttle,ECU,APPS2_Throttle,16,16,1,0,0,2047,,10,int16_t,TRUE,FALSE +0x203,ECU_Brake,ECU,Front_Brake_Pressure,0,16,1,0,0,32767,,10,int16_t,TRUE,FALSE +,ECU_Brake,ECU,Rear_Brake_Pressure,16,16,1,0,0,32767,,10,int16_t,TRUE,FALSE +,ECU_Brake,ECU,Brake_Pressed,32,8,1,0,0,1,,10,bool,TRUE,FALSE 0x204,ECU_Implausibility,ECU,Implausibility_Present,0,8,1,0,0,1,,100,bool,TRUE,FALSE ,ECU_Implausibility,ECU,APPSs_Disagreement_Imp,8,8,1,0,0,1,,100,bool,TRUE,FALSE ,ECU_Implausibility,ECU,BPPC_Imp,16,8,1,0,0,1,,100,bool,TRUE,FALSE @@ -141,12 +144,12 @@ Message ID,Message Name,Sender,Signal Name,Start Bit,Size (bits),Factor,Offset,M 1: PRECHARGE 2: NEUTRAL 3: DRIVE -4: FAULT",10,uint8_t,TRUE,FALSE +4: FAULT",100,uint8_t,TRUE,FALSE 0x206,ECU_Drive_Status,ECU,Drive_State,0,8,1,0,0,4,"0: IDLE 1: PRECHARGE 2: NEUTRAL 3: DRIVE -4: FAULT",10,uint8_t,TRUE,FALSE +4: FAULT",100,uint8_t,TRUE,FALSE 0x208,ECU_Active_Aero_Command,ECU,Active_Aero_State,0,1,1,0,0,1,"0: Closed 1: Open",100,bool,TRUE,FALSE ,ECU_Active_Aero_Command,ECU,Active_Aero_Position,1,16,1,0,0,360,degrees,100,int16_t,TRUE,FALSE @@ -154,7 +157,7 @@ Message ID,Message Name,Sender,Signal Name,Start Bit,Size (bits),Factor,Offset,M ,ECU_Pump_Fan_Command,ECU,Rear_Pump_Duty_Cycle,8,8,1,0,0,255,,100,uint8_t,TRUE,FALSE ,ECU_Pump_Fan_Command,ECU,Front_Fan_Duty_Cycle,16,8,1,0,0,255,,100,uint8_t,TRUE,FALSE ,ECU_Pump_Fan_Command,ECU,Rear_Fan_Duty_Cycle,24,8,1,0,0,255,,100,uint8_t,TRUE,FALSE -0x20A,ECU_LUT_Response,ECU,Accel_LUT_Id_Response,0,8,1,0,,,,,uint8_t,TRUE,FALSE +0x20A,ECU_LUT_Response,ECU,Accel_LUT_Id_Response,0,8,1,0,,,,100,uint8_t,TRUE,FALSE 0x20B,ECU_Temp_Limiting_Status,ECU,IGBT_Temp_Limiting,0,1,1,0,0,1,,100,bool,TRUE,FALSE ,ECU_Temp_Limiting_Status,ECU,Battery_Temp_Limiting,1,1,1,0,0,1,,100,bool,TRUE,FALSE ,ECU_Temp_Limiting_Status,ECU,Motor_Temp_Limiting,2,1,1,0,0,1,,100,bool,TRUE,FALSE @@ -489,103 +492,127 @@ Protocol violation error locations (data[3]): 0x1B: CAN_ERR_PROT_LOC_ACK_DEL /* ACK delimiter */ 0x1A: CAN_ERR_PROT_LOC_EOF /* end of frame */ 0x12: CAN_ERR_PROT_LOC_INTERM /* intermission */",,uint64_t,TRUE,TRUE -0x510,Dashboard_Heartbeat,DAQ-Dashboard,Heartbeat_Count,0,64,1,0,0,0,Beats,,uint64_t,, -0x530,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,, -0x531,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,, -,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,, -0x538,BR_Broker_Sus,DAQ-BR-Wheel,BR_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,, -,BR_Broker_Sus,DAQ-BR-Wheel,BR_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,, -0x540,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,, -,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,, -,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,, -,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,, -0x532,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,, -0x533,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,, -,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,, -0x53A,BL_Broker_Sus,DAQ-BL-Wheel,BL_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,, -,BL_Broker_Sus,DAQ-BL-Wheel,BL_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,, -0x541,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,, -,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,, -,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,, -,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,, -0x534,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,, -0x535,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,, -,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,, -0x53C,FR_Broker_Sus,DAQ-FR-Wheel,FR_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,, -,FR_Broker_Sus,DAQ-FR-Wheel,FR_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,, -0x542,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,, -,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,, -,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,, -,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,, -0x536,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,, -0x537,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,, -,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,, -0x53E,FL_Broker_Sus,DAQ-FL-Wheel,FL_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,, -,FL_Broker_Sus,DAQ-FL-Wheel,FL_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,, -0x543,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,, -,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,, -,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,, -,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,, -0x550,IMU_Acceleration_Uncompensated,DAQ-IMU,X_Axis_Acceleration_Uncompensated,0,21,0.0002,0,-160,160,m/s^2,10,float,, -,IMU_Acceleration_Uncompensated,DAQ-IMU,Y_Axis_Acceleration_Uncompensated,21,21,0.0002,0,-160,160,m/s^2,10,float,, -,IMU_Acceleration_Uncompensated,DAQ-IMU,Z_Axis_Acceleration_Uncompensated,42,21,0.0002,0,-160,160,m/s^2,10,float,, -0x551,IMU_Yaw_Pitch_Roll,DAQ-IMU,Yaw,0,21,0.0002,0,-180,180,deg,200,float,, -,IMU_Yaw_Pitch_Roll,DAQ-IMU,Pitch,21,21,0.00009,0,-90,90,deg,200,float,, -,IMU_Yaw_Pitch_Roll,DAQ-IMU,Roll,42,21,0.0002,0,-180,180,deg,200,float,, -0x552,IMU_Angular_Rate,DAQ-IMU,X_Axis_Angular_Rate,0,21,0.00004,0,-35,35,rad/s,200,float,, -,IMU_Angular_Rate,DAQ-IMU,Y_Axis_Angular_Rate,21,21,0.00004,0,-35,35,rad/s,200,float,, -,IMU_Angular_Rate,DAQ-IMU,Z_Axis_Angular_Rate,42,21,0.00004,0,-35,35,rad/s,200,float,, -0x553,IMU_Position_INS,DAQ-IMU,Position_Latitude,0,21,0.00009,0,-90,90,deg,200,double,, -,IMU_Position_INS,DAQ-IMU,Position_Longitude,21,21,0.00009,0,-90,-90,deg,200,double,, -,IMU_Position_INS,DAQ-IMU,Position_Altutude,42,21,0.005,0,-430,10000,m,200,double,, -0x554,IMU_Velocity,DAQ-IMU,X_Axis_Velocity,0,21,0.0005,0,-500,500,m/s,200,float,, -,IMU_Velocity,DAQ-IMU,Y_Axis_Velocity,21,21,0.0005,0,-500,500,m/s,200,float,, -,IMU_Velocity,DAQ-IMU,Z_Axis_Velocity,42,21,0.0005,0,-500,500,m/s,200,float,, -0x555,IMU_Mag,DAQ-IMU,X_Axis_Magnetometer,0,21,0.0001,0,-2.5,2.5,Gauss,200,float,, -,IMU_Mag,DAQ-IMU,Y_Axis_Magnetometer,21,21,0.0001,0,-2.5,2.5,Gauss,200,float,, -,IMU_Mag,DAQ-IMU,Z_Axis_Magnetometer,42,21,0.0001,0,-2.5,2.5,Gauss,200,float,, -0x556,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Temperature,0,21,0.00007,0,-40,85,degC,200,float,, -,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Pressure,21,21,0.00006,0,0,120,kPa,200,float,, -,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Delta_Time,42,21,0.0001,0,0,5,sec,200,float,, -0x557,IMU_Delta_Theta,DAQ-IMU,X_Axis_Delta_Theta,0,21,0.00009,0,-90,90,deg,200,float,, -,IMU_Delta_Theta,DAQ-IMU,Y_Axis_Delta_Theta,21,21,0.00009,0,-90,90,deg,200,float,, -,IMU_Delta_Theta,DAQ-IMU,Z_Axis_Delta_Theta,42,21,0.00009,0,-90,-90,deg,200,float,, -0x558,IMU_Delta_Vel,DAQ-IMU,X_Axis_Delta_Velocity,0,21,0.0005,0,-500,500,m/s,200,float,, -,IMU_Delta_Vel,DAQ-IMU,Y_Axis_Delta_Velocity,21,21,0.0005,0,-500,500,m/s,200,float,, -,IMU_Delta_Vel,DAQ-IMU,Z_Axis_Delta_Velocity,42,21,0.0005,0,-500,500,m/s,200,float,, -0x559,IMU_UTC_Time,DAQ-IMU,UTC_Year,0,8,1,2000,2000,2256,years,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Month,8,8,1,0,0,12,months,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Day,16,8,1,0,0,31,days,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Hour,24,8,1,0,0,23,hours,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Minutes,32,8,1,0,0,59,minutes,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Seconds,40,8,1,0,0,59,seconds,200,uint8_t,, -,IMU_UTC_Time,DAQ-IMU,UTC_Milliseconds,48,16,1,0,0,999,milliseconds ,200,uint16_t,, -0x55A,IMU_Fix_NumSats_INS_Status,DAQ-IMU,Num_Sats,0,8,1,0,0,256,"no unit, integers",200,uint8_t,, -,IMU_Fix_NumSats_INS_Status,DAQ-IMU,Fix,8,8,1,0,0,3,"no unit, integers",200,uint8_t,, -,IMU_Fix_NumSats_INS_Status,DAQ-IMU,INS_Status,16,16,1,0,0,65536,Refer to pg 162 • INS Subsystem VN-300 Extended,200,uint16_t,, -0x55B,IMU_Position_GNSS,DAQ-IMU,Position_Latitude,0,21,0.00009,0,-90,90,deg,200,double,, -,IMU_Position_GNSS,DAQ-IMU,Position_Longitude,21,21,0.00009,0,-90,-90,deg,200,double,, -,IMU_Position_GNSS,DAQ-IMU,Position_Altutude,42,21,0.005,0,-430,10000,m,200,double,, -0x55C,IMU_Position_U,DAQ-IMU,Position_Uncertainty_North,0,21,0.0005,0,0,1000,m,200,float,, -,IMU_Position_U,DAQ-IMU,Position_Uncertainty_East,21,21,0.0005,0,0,1000,m,200,float,, -,IMU_Position_U,DAQ-IMU,Position_Uncertainty_Down,42,21,0.0005,0,0,1000,m,200,float,, \ No newline at end of file +0x530,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp1,DAQ-BR-Wheel,BR_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x531,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BR_Broker_Temp2,DAQ-BR-Wheel,BR_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x538,BR_Broker_Sus,DAQ-BR-Wheel,BR_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,TRUE,TRUE +,BR_Broker_Sus,DAQ-BR-Wheel,BR_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,TRUE,TRUE +0x540,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BR_Broker_CAN_Error_Msg,DAQ-BR-Wheel,BR_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,TRUE,TRUE +0x532,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp1,DAQ-BL-Wheel,BL_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x533,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,BL_Broker_Temp2,DAQ-BL-Wheel,BL_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x53A,BL_Broker_Sus,DAQ-BL-Wheel,BL_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,TRUE,TRUE +,BL_Broker_Sus,DAQ-BL-Wheel,BL_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,TRUE,TRUE +0x541,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,BL_Broker_CAN_Error_Msg,DAQ-BL-Wheel,BL_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,TRUE,TRUE +0x534,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp1,DAQ-FR-Wheel,FR_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x535,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FR_Broker_Temp2,DAQ-FR-Wheel,FR_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x53C,FR_Broker_Sus,DAQ-FR-Wheel,FR_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,TRUE,TRUE +,FR_Broker_Sus,DAQ-FR-Wheel,FR_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,TRUE,TRUE +0x542,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FR_Broker_CAN_Error_Msg,DAQ-FR-Wheel,FR_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,TRUE,TRUE +0x536,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_0,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_1,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_2,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp1,DAQ-FL-Wheel,FL_Tire_Temp_3,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x537,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_4,0,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_5,16,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_6,32,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +,FL_Broker_Temp2,DAQ-FL-Wheel,FL_Tire_Temp_7,48,16,0.01,0,0,60,Celcius,1000,float,TRUE,TRUE +0x53E,FL_Broker_Sus,DAQ-FL-Wheel,FL_Strain_Gauge,0,32,1,0,-8388608,8388607,ADC Values,10,int32_t,TRUE,TRUE +,FL_Broker_Sus,DAQ-FL-Wheel,FL_Sus_Pot,32,32,1,0,0,4095,ADC Values,10,uint32_t,TRUE,TRUE +0x543,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Strain_Gauge_Error,0,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Sus_Pot_Error,16,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Tire_Temp_Error,32,16,1,0,0,1,Bool,1000,int16_t,TRUE,TRUE +,FL_Broker_CAN_Error_Msg,DAQ-FL-Wheel,FL_Heartbeat_Count,48,16,1,0,0,65536,HAL Tick,1000,int16_t,TRUE,TRUE +0x550,IMU_Acceleration,DAQ-IMU,X_Axis_Acceleration,0,21,0.0002,0,-160,160,m/s^2,10,float,TRUE,TRUE +,IMU_Acceleration,DAQ-IMU,Y_Axis_Acceleration,21,21,0.0002,0,-160,160,m/s^2,10,float,TRUE,TRUE +,IMU_Acceleration,DAQ-IMU,Z_Axis_Acceleration,42,21,0.0002,0,-160,160,m/s^2,10,float,TRUE,TRUE +0x551,IMU_Yaw_Pitch_Roll,DAQ-IMU,Yaw,0,21,0.0002,0,-180,180,deg,200,float,TRUE,TRUE +,IMU_Yaw_Pitch_Roll,DAQ-IMU,Pitch,21,21,0.00009,0,-90,90,deg,200,float,TRUE,TRUE +,IMU_Yaw_Pitch_Roll,DAQ-IMU,Roll,42,21,0.0002,0,-180,180,deg,200,float,TRUE,TRUE +0x552,IMU_Angular_Rate,DAQ-IMU,X_Axis_Angular_Rate,0,21,0.00004,0,-35,35,rad/s,200,float,TRUE,TRUE +,IMU_Angular_Rate,DAQ-IMU,Y_Axis_Angular_Rate,21,21,0.00004,0,-35,35,rad/s,200,float,TRUE,TRUE +,IMU_Angular_Rate,DAQ-IMU,Z_Axis_Angular_Rate,42,21,0.00004,0,-35,35,rad/s,200,float,TRUE,TRUE +0x553,IMU_Position_INS,DAQ-IMU,Position_Latitude,0,21,0.00009,0,-90,90,deg,200,double,TRUE,TRUE +,IMU_Position_INS,DAQ-IMU,Position_Longitude,21,21,0.00009,0,-90,-90,deg,200,double,TRUE,TRUE +,IMU_Position_INS,DAQ-IMU,Position_Altutude,42,21,0.005,0,-430,10000,m,200,double,TRUE,TRUE +0x554,IMU_Velocity,DAQ-IMU,X_Axis_Velocity,0,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +,IMU_Velocity,DAQ-IMU,Y_Axis_Velocity,21,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +,IMU_Velocity,DAQ-IMU,Z_Axis_Velocity,42,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +0x555,IMU_Mag,DAQ-IMU,X_Axis_Magnetometer,0,21,0.0001,0,-2.5,2.5,Gauss,200,float,TRUE,TRUE +,IMU_Mag,DAQ-IMU,Y_Axis_Magnetometer,21,21,0.0001,0,-2.5,2.5,Gauss,200,float,TRUE,TRUE +,IMU_Mag,DAQ-IMU,Z_Axis_Magnetometer,42,21,0.0001,0,-2.5,2.5,Gauss,200,float,TRUE,TRUE +0x556,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Temperature,0,21,0.00007,0,-40,85,degC,200,float,TRUE,TRUE +,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Pressure,21,21,0.00006,0,0,120,kPa,200,float,TRUE,TRUE +,IMU_Pres_Temp_DeltaTime,DAQ-IMU,Delta_Time,42,21,0.0001,0,0,5,sec,200,float,TRUE,TRUE +0x557,IMU_Delta_Theta,DAQ-IMU,X_Axis_Delta_Theta,0,21,0.00009,0,-90,90,deg,200,float,TRUE,TRUE +,IMU_Delta_Theta,DAQ-IMU,Y_Axis_Delta_Theta,21,21,0.00009,0,-90,90,deg,200,float,TRUE,TRUE +,IMU_Delta_Theta,DAQ-IMU,Z_Axis_Delta_Theta,42,21,0.00009,0,-90,-90,deg,200,float,TRUE,TRUE +0x558,IMU_Delta_Vel,DAQ-IMU,X_Axis_Delta_Velocity,0,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +,IMU_Delta_Vel,DAQ-IMU,Y_Axis_Delta_Velocity,21,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +,IMU_Delta_Vel,DAQ-IMU,Z_Axis_Delta_Velocity,42,21,0.0005,0,-500,500,m/s,200,float,TRUE,TRUE +0x559,IMU_UTC_Time,DAQ-IMU,UTC_Year,0,8,1,0,2000,255,years,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Month,8,8,1,0,0,12,months,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Day,16,8,1,0,0,31,days,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Hour,24,8,1,0,0,23,hours,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Minutes,32,8,1,0,0,59,minutes,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Seconds,40,8,1,0,0,59,seconds,200,uint8_t,TRUE,TRUE +,IMU_UTC_Time,DAQ-IMU,UTC_Milliseconds,48,16,1,0,0,999,milliseconds ,200,uint16_t,TRUE,TRUE +0x55A,IMU_Fix_NumSats_INS_Status,DAQ-IMU,Num_Sats,0,8,1,0,0,256,"no unit, integers",200,uint8_t,TRUE,TRUE +,IMU_Fix_NumSats_INS_Status,DAQ-IMU,Fix,8,8,1,0,0,3,"no unit, integers",200,uint8_t,TRUE,TRUE +,IMU_Fix_NumSats_INS_Status,DAQ-IMU,INS_Status,16,16,1,0,0,65536,Refer to pg 162 • INS Subsystem VN-300 Extended,200,uint16_t,TRUE,TRUE +0x55B,IMU_Position_GNSS,DAQ-IMU,Position_Latitude,0,21,0.00009,0,-90,90,deg,200,double,TRUE,TRUE +,IMU_Position_GNSS,DAQ-IMU,Position_Longitude,21,21,0.00009,0,-90,-90,deg,200,double,TRUE,TRUE +,IMU_Position_GNSS,DAQ-IMU,Position_Altutude,42,21,0.005,0,-430,10000,m,200,double,TRUE,TRUE +0x55C,IMU_Position_U,DAQ-IMU,Position_Uncertainty_North,0,21,0.0005,0,0,1000,m,200,float,TRUE,TRUE +,IMU_Position_U,DAQ-IMU,Position_Uncertainty_East,21,21,0.0005,0,0,1000,m,200,float,TRUE,TRUE +,IMU_Position_U,DAQ-IMU,Position_Uncertainty_Down,42,21,0.0005,0,0,1000,m,200,float,TRUE,TRUE +0x520,Telemetry_RTC_Time,DAQ-Telemetry,RTC_Hour,0,8,1,0,0,23,hours,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Time,DAQ-Telemetry,RTC_Minute,8,8,1,0,0,59,minutes,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Time,DAQ-Telemetry,RTC_Second,16,8,1,0,0,59,seconds,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Time,DAQ-Telemetry,RTC_Subsecond,24,32,1,0,0,999,millisconds,1000,uint32_t,TRUE,TRUE +0x521,Telemetry_RTC_Date,DAQ-Telemetry,RTC_Year,0,8,1,0,0,99,,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Date,DAQ-Telemetry,RTC_Month,8,8,1,0,1,12,,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Date,DAQ-Telemetry,RTC_Day,16,8,1,0,1,31,,1000,uint8_t,TRUE,TRUE +,Telemetry_RTC_Date,DAQ-Telemetry,RTC_Weekday,24,8,1,0,1,7,,1000,uint8_t,TRUE,TRUE +0x522,Telemetry_Odometer,DAQ-Telemetry,Miles_Driven,0,32,1,0,0,,mi,100,float,TRUE,TRUE +0x523,Telemetry_Status,DAQ-Telemetry,Log_File,0,16,1,0,0,9999,,1000,uint16_t,TRUE,TRUE +,Telemetry_Status,DAQ-Telemetry,Logging_Status,16,8,1,0,0,1,"0x00: OK/Logging +0x01: Card Not Detected +0x02: Mount/Filesystem Error +0x03: Card Full +0x04: SDIO Comms Error",1000,uint8_t,TRUE,TRUE +,Telemetry_Status,DAQ-Telemetry,Wireless_Status,24,8,1,0,0,1,"0x00: OK/Connected +0x01: Handshake Pending +0x02: Handshake Failed +0x03: SPI Comms Error",1000,uint8_t,TRUE,TRUE +0x560,Aero_Strain_Gauge1,DAQ-Strain-Gauge,Strain_Gauge_1,0,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE +,Aero_Strain_Gauge1,DAQ-Strain-Gauge,Strain_Gauge_2,32,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE +0x561,Aero_Strain_Gauge2,DAQ-Strain-Gauge,Strain_Gauge_3,0,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE +,Aero_Strain_Gauge2,DAQ-Strain-Gauge,Strain_Gauge_4,32,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE +0x562,Aero_Strain_Gauge3,DAQ-Strain-Gauge,Strain_Gauge_5,0,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE +,Aero_Strain_Gauge3,DAQ-Strain-Gauge,Strain_Gauge_6,32,32,0.0001,0,-100,100,Newtons,10,float,TRUE,TRUE