Skip to content

Commit

Permalink
Add note on variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg committed Jan 27, 2025
1 parent d2ad30f commit 967689c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dev/source/docs/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 967689c

Please sign in to comment.