pnkx_nav_core 1.0 — every package is a submodule at its own pinned commit
A single commit on an orphan branch, so this is the whole tree as it should
land on a robot, with no history from the branch it grew out of.
Every package is now a git submodule - 26 of them, 15 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. That failure reports
itself as "works on my machine, not on the robot", and it is the reason this
conversion happened at all.
Newly registered:
src/Navigations/Packages/move_base2
src/Algorithms/Packages/actions/dock_pattern_action
src/Algorithms/Packages/global_planners/sbpl_lattice_planner
src/Algorithms/Packages/local_planners/{hybrid,mppi,priest}_local_planner
src/Libraries/{action_core,angles,depth_image_proc,dock_pattern_detector}
src/Libraries/{mission_adapters,recovery_core,robot_line_extraction}
src/Libraries/{robot_sensor_ports,sbpl}
.gitignore had a rule - **/[Pp]ackages/* - that hid move_base2 and
dock_pattern_action from git status entirely, so they would have been left out
without anything being said. The exception is written for those two paths only
rather than by loosening the rule.
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 to main.
The other 25 are at the tip of main.
config/ is flattened into config/runtime/, matching the layout the nav core
reads. The .zip snapshots of old package states are gone - they were manual
backups, not build inputs.
This commit is contained in:
142
examples/README.md
Normal file
142
examples/README.md
Normal file
@@ -0,0 +1,142 @@
|
||||
# Hướng dẫn chạy C# Example
|
||||
|
||||
## Yêu cầu
|
||||
|
||||
1. **.NET SDK** (version 6.0 trở lên hoặc .NET 10)
|
||||
2. **C API Library** đã được build (`libnav_c_api.so`)
|
||||
3. **Linux environment** (hoặc WSL nếu dùng Windows)
|
||||
|
||||
## Bước 1: Build C API Library
|
||||
|
||||
```bash
|
||||
cd /home/robotics/AGV/Diff_Wheel_Prj/pnkx_nav_core
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ..
|
||||
make nav_c_api
|
||||
```
|
||||
|
||||
Library sẽ được tạo tại: `build/src/APIs/c_api/libnav_c_api.so`
|
||||
|
||||
## Bước 2: Chạy script tự động (Khuyến nghị)
|
||||
|
||||
```bash
|
||||
cd /home/robotics/AGV/Diff_Wheel_Prj/pnkx_nav_core/examples
|
||||
chmod +x run_example.sh
|
||||
./run_example.sh
|
||||
```
|
||||
|
||||
Script sẽ tự động:
|
||||
- Build library nếu chưa có
|
||||
- Tạo C# project
|
||||
- Copy library và source code
|
||||
- Set LD_LIBRARY_PATH cho tất cả dependencies
|
||||
- Build và chạy example
|
||||
|
||||
## Bước 3: Hoặc chạy thủ công
|
||||
|
||||
### Tạo C# Project
|
||||
|
||||
```bash
|
||||
cd /home/robotics/AGV/Diff_Wheel_Prj/pnkx_nav_core/examples
|
||||
dotnet new console -n NavigationExample
|
||||
cd NavigationExample
|
||||
```
|
||||
|
||||
### Copy file và library
|
||||
|
||||
```bash
|
||||
# Copy C# source code
|
||||
cp ../CSharpExample.cs Program.cs
|
||||
|
||||
# Copy library vào thư mục project
|
||||
cp ../../build/src/APIs/c_api/libnav_c_api.so .
|
||||
```
|
||||
|
||||
## Bước 4: Cập nhật .csproj (nếu cần)
|
||||
|
||||
Tạo file `NavigationExample.csproj`:
|
||||
|
||||
```xml
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="libnav_c_api.so">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
## Bước 4: Build và chạy
|
||||
|
||||
```bash
|
||||
# Set LD_LIBRARY_PATH để tìm được tất cả dependencies
|
||||
export LD_LIBRARY_PATH=../../build/src/APIs/c_api:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Libraries/robot_costmap_2d:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Libraries/geometry2/robot_tf3_geometry_msgs:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Libraries/geometry2/robot_tf3_sensor_msgs:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Packages/move_base:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Cores/move_base_core:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Libraries/tf3:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../../build/src/Navigations/Libraries/robot_time:$LD_LIBRARY_PATH
|
||||
|
||||
# Build
|
||||
dotnet build
|
||||
|
||||
# Chạy
|
||||
dotnet run
|
||||
```
|
||||
|
||||
## Lưu ý
|
||||
|
||||
1. **Library path**: Đảm bảo `libnav_c_api.so` có thể được tìm thấy:
|
||||
- Copy vào cùng thư mục với executable
|
||||
- Hoặc set `LD_LIBRARY_PATH` environment variable
|
||||
- Hoặc copy vào `/usr/local/lib` và chạy `ldconfig`
|
||||
|
||||
2. **Dependencies**: Library cần các dependencies khác:
|
||||
```bash
|
||||
# Kiểm tra dependencies
|
||||
ldd libnav_c_api.so
|
||||
|
||||
# Đảm bảo tất cả dependencies đều có sẵn
|
||||
```
|
||||
|
||||
3. **Permissions**: Đảm bảo file có quyền execute:
|
||||
```bash
|
||||
chmod +x libnav_c_api.so
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Lỗi: "Unable to load DLL 'libnav_c_api.so'"
|
||||
|
||||
**Giải pháp:**
|
||||
```bash
|
||||
# Set LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=/home/robotics/AGV/Diff_Wheel_Prj/pnkx_nav_core/build/src/APIs/c_api:$LD_LIBRARY_PATH
|
||||
|
||||
# Hoặc copy library vào system path
|
||||
sudo cp libnav_c_api.so /usr/local/lib/
|
||||
sudo ldconfig
|
||||
```
|
||||
|
||||
### Lỗi: "DllNotFoundException"
|
||||
|
||||
**Giải pháp:**
|
||||
- Kiểm tra tên file library có đúng không
|
||||
- Kiểm tra architecture (x64 vs x86)
|
||||
- Kiểm tra dependencies: `ldd libnav_c_api.so`
|
||||
|
||||
### Lỗi: "Symbol not found"
|
||||
|
||||
**Giải pháp:**
|
||||
- Đảm bảo library đã được build đầy đủ
|
||||
- Kiểm tra tên hàm trong C# có khớp với C API không
|
||||
|
||||
Reference in New Issue
Block a user