Skip to content

Commit c430dae

Browse files
committed
Add section on coordinate system, + minor additions.
1 parent 1502fb5 commit c430dae

1 file changed

Lines changed: 38 additions & 8 deletions

File tree

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
- [Performance](#performance)
2929
- [Volumetric data](#volumetric-data)
3030
- [Rotations / orientations](#rotations-orientations)
31+
- [Coordinate systems](#coordinate-systems)
32+
- [Geodetic coordinates](#geodetic-coordinates)
3133
- [Date, time, and locale](#date-time-and-locale)
3234
- [General style policies](#general-style-policies)
3335
- [Naming](#naming)
@@ -49,7 +51,6 @@
4951
- [Other](#other-1)
5052
- [ROS](#ros)
5153
- [Telemetry](#telemetry)
52-
- [Geodetic coordinates](#geodetic-coordinates)
5354

5455
Introduction
5556
============
@@ -516,6 +517,25 @@ quaternion is always the right thing to use – they are wrong.
516517

517518
- Should be used by default.
518519

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+
519539
Date, time, and locale
520540
======================
521541

@@ -616,6 +636,11 @@ Formatting
616636
- Use 4 spaces for indentation: 2 is not enough, 8 is too much, anything else is
617637
a perversion.
618638

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+
619644
Use tools
620645
---------
621646

@@ -792,9 +817,20 @@ C++
792817
- Templated constructors do not allow explicit parameter specification --
793818
templated parameters must be deduced from constructor inputs.
794819

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+
795827
### Macro
796828

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.
798834

799835
- Macro name must be in all capitals with underscores and have a prefix to avoid
800836
collisions, e.g., `MYCOMPANY_DEBUG`.
@@ -1024,9 +1060,3 @@ Telemetry
10241060
applications.
10251061

10261062
- 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

Comments
 (0)