From 967689cefa6b3494d4cbd09f244ae87496629d27 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Sun, 26 Jan 2025 18:46:42 -0600 Subject: [PATCH] Add note on variable naming --- dev/source/docs/style-guide.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/source/docs/style-guide.rst b/dev/source/docs/style-guide.rst index 687a12e44d..e0ae6893b0 100644 --- a/dev/source/docs/style-guide.rst +++ b/dev/source/docs/style-guide.rst @@ -402,22 +402,23 @@ Functions that return a single physical value or variables that represent a phys uint16 get_angle() { ... }; float distance; -Functions or variables that represent a value relative to a frame should be suffixed with the frame first, then with the physical unit (if any). +Functions or variables that represent a value relative to a frame should be suffixed with the frame first, then with the physical unit (if different than SI units). SI suffixes are occasionally used to avoid confusion in modules with similar variables of different units,but only if necessary to avoid confusion. **Right:** :: - uint16 get_distance_ned_cm() { ... }; - uint16 get_distance_enu_m() { ... }; + uint16_t get_distance_ned_cm() { ... }; float position_neu_mm; + unit16_t course; (in degrees) **Wrong:** :: - uint16 get_distance() { ... }; + uint16_t get_distance_ned() { ... }; float position; + unit16_t course_deg; Commenting