pnkx_nav_core 1.0 — every package with a remote is a submodule, and the root CMake builds them all

A single commit on an orphan branch: the whole tree as it should land on a
robot, with no history from the branch it grew out of.

The rule applied: a package that has its own remote becomes a submodule; a
package that only ever lived inside this repository stays as ordinary files.
That comes to 29 submodules, 18 registered here for the first time. They were
sitting in the tree as plain clones, which looks right locally and is empty on
the robot - a clone of this repository would have carried the directory names
and none of the contents.

.gitignore is fixed at the source rather than patched per path. The rule
**/[Pp]ackages/* comes from the Visual Studio template and targets NuGet's
generated packages/ folder; here Packages/ is a SOURCE directory, so it hid
whole packages from git status - and a missing package then becomes invisible
to exactly the command you would use to look for one. It cost move_base2,
dock_pattern_action and sbpl_recovery, and sbpl_recovery surfaced only by
walking the tree for .git directories and diffing against .gitmodules. The
exception now re-includes src/*/Packages/** wholesale, placed immediately after
the NuGet rule so the build-artifact rules further down still win. Listing
paths one by one is what let one slip in the first place.

The root CMakeLists.txt described a tree that no longer exists. Its second half
was a migration shim that looked for a sibling Test/ directory from AMR_T800
and added packages out of it; PNKX_NAV_CORE_BUILD_TEST_PACKAGES defaults to ON,
so with the migration finished it would have hit FATAL_ERROR at configure time.
That is gone, and every package is added in dependency order at its real
in-tree path.

Three guard names are traps worth naming, because a guard that never matches
adds the subdirectory twice on a re-entrant configure:
  - src/Libraries/angles is project robot_angles_prv, and a DIFFERENT package
    called angles lives at src/Algorithms/Libraries/angles. Both are in the
    tree; guarding on `angles` would silently skip the first.
  - dock_pattern_action's library target is dock_pattern_action_handler.
  - move_base2's is move_base2_core.

sbpl_recovery and dock_pattern_action had no standalone branch - catkin was
required at top level, so a build without it died at configure time pointing at
packages that are present. Both now detect the mode and name their CMake
targets directly in standalone, and both drop their plugin at the top of the
build tree, because boost::dll loads by filename and PluginLoaderHelper
resolves that against the build directory: left in a subdirectory a plugin
builds and is then invisible at runtime.

grid_map_core and image_geometry were added because hybrid_local_planner and
depth_image_proc link robot_grid_map_core and robot_image_geometry, and neither
was in the tree - found by scanning every CMakeLists for internal library names
and diffing against the targets the tree defines, then confirmed by the build.

Every submodule points at the tip of the branch it was already pinned to, not
blindly at main. costmap_2d stays on dev_cam_intel; that branch exists for a
reason, and this tree carries field calibration that does not belong on main.

config/ is flattened into config/runtime/, matching the layout the nav core
reads. The .zip snapshots of old package states are gone - manual backups, not
build inputs.

Verified: cmake configure returns 0 and a full standalone build returns 0,
producing 48 shared libraries with nothing gated off.
This commit is contained in:
2026-08-27 10:09:25 +07:00
commit 256d280b71
486 changed files with 72597 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
using System;
using System.Runtime.InteropServices;
namespace NavigationExample
{
// ============================================================================
// TF3 C API - P/Invoke wrapper for libtf3 (tf3 BufferCore)
// ============================================================================
public static class TF3API
{
private const string Tf3DllName = "/usr/local/lib/libtf3.so"; // Linux; Windows: tf3.dll, macOS: libtf3.dylib
public enum TF3_ErrorCode
{
TF3_OK = 0,
TF3_ERROR_LOOKUP = 1,
TF3_ERROR_CONNECTIVITY = 2,
TF3_ERROR_EXTRAPOLATION = 3,
TF3_ERROR_INVALID_ARGUMENT = 4,
TF3_ERROR_TIMEOUT = 5,
TF3_ERROR_UNKNOWN = 99
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct TF3_Transform
{
public long timestamp_sec;
public long timestamp_nsec;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string frame_id;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string child_frame_id;
public double translation_x;
public double translation_y;
public double translation_z;
public double rotation_x;
public double rotation_y;
public double rotation_z;
public double rotation_w;
}
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr tf3_buffer_create(int cache_time_sec);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void tf3_buffer_destroy(IntPtr buffer);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_set_transform(
IntPtr buffer,
ref TF3_Transform transform,
string authority,
[MarshalAs(UnmanagedType.I1)] bool is_static);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_lookup_transform(
IntPtr buffer,
string target_frame,
string source_frame,
long time_sec,
long time_nsec,
out TF3_Transform transform,
out TF3_ErrorCode error_code);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_lookup_transform_full(
IntPtr buffer,
string target_frame,
long target_time_sec,
long target_time_nsec,
string source_frame,
long source_time_sec,
long source_time_nsec,
string fixed_frame,
out TF3_Transform transform,
out TF3_ErrorCode error_code);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_can_transform(
IntPtr buffer,
string target_frame,
string source_frame,
long time_sec,
long time_nsec,
System.Text.StringBuilder error_msg,
int error_msg_len);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern int tf3_get_all_frame_names(IntPtr buffer, System.Text.StringBuilder frames, int frames_len);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_get_frame_tree(IntPtr buffer, System.Text.StringBuilder output, int output_len);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void tf3_clear(IntPtr buffer);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern void tf3_get_current_time(out long sec, out long nsec);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool tf3_get_last_error(IntPtr buffer, System.Text.StringBuilder error_msg, int error_msg_len);
[DllImport(Tf3DllName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr tf3_get_version();
/// <summary>Helper: create TF3_Transform for static transform (identity or given pose).</summary>
public static TF3_Transform CreateStaticTransform(string parentFrame, string childFrame,
double tx = 0, double ty = 0, double tz = 0,
double qx = 0, double qy = 0, double qz = 0, double qw = 1)
{
var t = new TF3_Transform();
t.timestamp_sec = 0;
t.timestamp_nsec = 0;
t.frame_id = parentFrame ?? "";
t.child_frame_id = childFrame ?? "";
t.translation_x = tx;
t.translation_y = ty;
t.translation_z = tz;
t.rotation_x = qx;
t.rotation_y = qy;
t.rotation_z = qz;
t.rotation_w = qw;
return t;
}
}
}