|
28 | 28 | - [Performance](#performance) |
29 | 29 | - [Volumetric data](#volumetric-data) |
30 | 30 | - [Rotations / orientations](#rotations-orientations) |
| 31 | +- [Coordinate systems](#coordinate-systems) |
| 32 | + - [Geodetic coordinates](#geodetic-coordinates) |
31 | 33 | - [Date, time, and locale](#date-time-and-locale) |
32 | 34 | - [General style policies](#general-style-policies) |
33 | 35 | - [Naming](#naming) |
|
49 | 51 | - [Other](#other-1) |
50 | 52 | - [ROS](#ros) |
51 | 53 | - [Telemetry](#telemetry) |
52 | | - - [Geodetic coordinates](#geodetic-coordinates) |
53 | 54 |
|
54 | 55 | Introduction |
55 | 56 | ============ |
@@ -516,6 +517,25 @@ quaternion is always the right thing to use – they are wrong. |
516 | 517 |
|
517 | 518 | - Should be used by default. |
518 | 519 |
|
| 520 | +Coordinate systems |
| 521 | +================== |
| 522 | + |
| 523 | +Geodetic coordinates |
| 524 | +-------------------- |
| 525 | + |
| 526 | +- Do not use `LLA` abbreviation for geodetic coordinates – it is ambiguous since |
| 527 | + both `Lat-Lon` and `Lon-Lat` orders are common in practice. |
| 528 | + |
| 529 | +- There are two commonly used altitude measurements: with respect to the mean |
| 530 | + sea level, and to the WGS84 ellipsoid. Mean sea level (MSL) is more fragile |
| 531 | + and computationally expensive due to sea level determination logic. Ellipsoid |
| 532 | + altitude should be preferred in practice. |
| 533 | + |
| 534 | +- Do not use 32-bit floats for storing geodetic coordinates, this leads to a |
| 535 | + substantial, a couple of meters, errors simply due to representation limits. |
| 536 | + If memory usage is a concern, use 32-bit integers instead to get much smaller |
| 537 | + and uniform errors. |
| 538 | + |
519 | 539 | Date, time, and locale |
520 | 540 | ====================== |
521 | 541 |
|
@@ -616,6 +636,11 @@ Formatting |
616 | 636 | - Use 4 spaces for indentation: 2 is not enough, 8 is too much, anything else is |
617 | 637 | a perversion. |
618 | 638 |
|
| 639 | +- When editing files try to minimize the number of affected lines – this makes |
| 640 | + diffs more compact and readable. There are certain formatting conventions that |
| 641 | + can be helpful, e.g., when multiple parameters are passed to a function each |
| 642 | + of them, as well as the closing brace, should be on separate lines. |
| 643 | + |
619 | 644 | Use tools |
620 | 645 | --------- |
621 | 646 |
|
|
792 | 817 | - Templated constructors do not allow explicit parameter specification -- |
793 | 818 | templated parameters must be deduced from constructor inputs. |
794 | 819 |
|
| 820 | +- Many common styles and static analysis tools insist on initialization of |
| 821 | + member variables on declaration and in member initializer lists of |
| 822 | + constructors when possible, which is obviously not always the case. When such |
| 823 | + conventions are enforced you end up with member initialization logic scattered |
| 824 | + all over the place. In my opinion a dedicated initializaion method called from |
| 825 | + a constructor is the most transparent approach. |
| 826 | + |
795 | 827 | ### Macro |
796 | 828 |
|
797 | | -- Macro should be avoided when possible. |
| 829 | +- If macro can help you to reduce code verbosity and avoid repetition, you |
| 830 | + should use it unless there is another way to achieve the same results. Banning |
| 831 | + macro completely, especially in third party libraries, is simply retarded. |
| 832 | + Copy-pasting is a much bigger sin than presumable obscurity introduced by |
| 833 | + macro. |
798 | 834 |
|
799 | 835 | - Macro name must be in all capitals with underscores and have a prefix to avoid |
800 | 836 | collisions, e.g., `MYCOMPANY_DEBUG`. |
@@ -1024,9 +1060,3 @@ Telemetry |
1024 | 1060 | applications. |
1025 | 1061 |
|
1026 | 1062 | - Must have: `grafana`, `PlotJuggler`. |
1027 | | - |
1028 | | -Geodetic coordinates |
1029 | | --------------------- |
1030 | | - |
1031 | | -- Do not use `LLA` abbreviation for geodetic coordinates – it is ambiguous since |
1032 | | - both `Lat-Lon` and `Lon-Lat` orders are common in practice. |
|
0 commit comments