This is a Source plugin for MADS.
Required MADS version: 1.3.1. Required PCL version: 1.13 or 1.14.
Currently, the supported platforms are:
- Linux
- MacOS
- Windows
Linux and MacOS:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install buildWindows:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release
cmake --install build --config ReleaseThe steps below describe how to prepare a Windows development machine for building and running the hpe plugin and its dependencies.
-
Install MADS
- Download and install the latest MADS executable from: https://github.com/pbosetti/MADS/releases
-
OpenCV
- Download the OpenCV Windows release from https://opencv.org/releases/
- Run the downloaded executable and extract the folder to
C:\opencv.
-
OpenVINO 2023.3
- Download the OpenVINO 2023.3 archive for Windows: https://docs.openvino.ai/2023.3/openvino_docs_install_guides_overview.html?VERSION=v_2023_3_0&OP_SYSTEM=WINDOWS&DISTRIBUTION=ARCHIVE
- Extract the archive and move the resulting folder to
C:\Program Files (x86)\Intel. - Rename the folder to
openvino_2023.3.
-
Add required directories to the system PATH (verify the exact paths after installation):
C:\opencv\build\x64\vc16\binC:\Program Files (x86)\Intel\openvino_2023.3\runtime\bin\intel64\ReleaseC:\Program Files (x86)\Intel\openvino_2023.3\runtime\3rdparty\tbb\bin
-
Set environment variables (PowerShell example):
setx OpenCV_DIR C:\opencv
setx OpenVINO_DIR "C:\Program Files (x86)\Intel\openvino_2023.3"-
Install PCL (Point Cloud Library)
-
Download the PCL v1.14.1 installer from: https://github.com/PointCloudLibrary/pcl/releases
-
Run the installer and accept the defaults (you can disable desktop icons if desired).
-
Add the following paths to PATH (adjust if you installed to a different folder):
-
C:\Program Files\PCL 1.14.1 -
C:\Program Files\PCL 1.14.1\bin -
C:\Program Files\PCL 1.14.1\include -
C:\Program Files\PCL 1.14.1\3rdParty -
C:\Program Files\PCL 1.14.1\3rdParty\VTK\bin
-
-
Azure Kinect SDK and Body Tracking SDK
-
Install Azure Kinect Sensor SDK v1.4.1: https://www.microsoft.com/en-us/download/details.aspx?id=101454
-
Install Azure Kinect Body Tracking SDK v1.1.2: https://www.microsoft.com/en-us/download/details.aspx?id=104221
-
Set environment variables:
K4A_DIR=>C:\Program Files\Azure Kinect SDK v1.4.1K4ABT_DIR=>C:\Program Files\Azure Kinect Body Tracking SDK
-
Add to PATH:
C:\Program Files\Azure Kinect SDK v1.4.1\toolsC:\Program Files\Azure Kinect Body Tracking SDK\tools
-
-
Microsoft MPI
-
Install Microsoft MPI (MS-MPI) from: https://www.microsoft.com/en-us/download/details.aspx?id=105289
-
Add to PATH (if not added by the installer):
C:\Program Files\Microsoft MPI\Bin
-
-
pkg-config-lite (optional, used by some build tools)
- Download pkg-config-lite from: https://sourceforge.net/projects/pkgconfiglite/files/0.28-1/
- Extract
pkg-config-lite-0.28-1toC:\pkg-config-lite-0.28-1and addC:\pkg-config-lite-0.28-1\binto PATH.
-
Restart your PC to ensure environment variable changes take effect.
-
Build and install
hpe(assumingmadsis on PATH andmads -preturns MADS prefix):
git clone <repo-url> C:\mirrorworld\hpe
cd C:\mirrorworld\hpe
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release
cmake --build build --config Release -t install-
Optional: MongoDB for storing logs
- Install and run Docker Desktop (no login required): https://www.docker.com/
- Start a MongoDB container (from the project root you can create a
dbfolder to persist data) and install the MongoDB C++ driver locally (instructions summarized). AddC:\mongo-cxx-driver\binto PATH if you installed it there.
docker run --name mads-mongo --restart unless-stopped -v ${PWD}/db:/data/db -p27017:27017 -d mongo
# Download the mongo-cxx-driver archive (or use browser to download if curl flags are not supported)
curl -OL https://github.com/mongodb/mongo-cxx-driver/releases/download/r4.1.1/mongo-cxx-driver-r4.1.1.tar.gz
# or download via browser and extract
# tar -xzf mongo-cxx-driver-r4.1.1.tar.gz
# cd mongo-cxx-driver-r4.1.1/build
cmake -G "Visual Studio 17 2022" -A "x64" -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=C:\mongo-cxx-driver
cmake --build . --config RelWithDebInfo
cmake --build . --target install --config RelWithDebInfoIf you only need to update MADS to a new version and want to avoid recompiling all dependencies, do the following before building again:
-
Delete the following folders from the build tree (these are re-downloaded/build subprojects):
build/_deps/plugin-buildbuild/_deps/pugg-build
-
Rebuild and install (from project root):
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release -t installThis forces CMake to refresh the plugin/pugg subprojects and pick up the new MADS installation without re-building every external dependency.
- Find the broker IP address to provide to remote agents (run on the broker machine). This prints available network interfaces and their IP addresses.
mads-broker -n list- Choose the interface you want (for example, index
11or nameen0) and start the broker bound to that interface.The broker will print the<IP>and<PORT>that remote agents should use. If agents run on the same machine as the broker, you can omit IP and PORT when starting them.
# Example: bind to interface named en0
mads-broker -n en0-
If you want to save data to MongoDB, ensure the Mongo container is running (see step 12 above) or start it with Docker.
-
Start the logger:
mads-logger- Start
hpeagents (on each agent machine, or locally):
mads-source -s tcp://<IP>:<PORT> hpe.pluginReplace <IP> and <PORT> with the values printed by mads-broker.
If you don't want to compile the Kinect Azure libraries, add the option:
cmake -Bbuild -DSKIP_KINECT_AZURE=ONThis allows you to compile the project even on systems where Kinect Azure libraries are not available.
All runtime debug flags are read from the mads.ini file under the [hpe.debug] section (see the example below). Each boolean flag enables additional logging, diagnostics and (in some cases) saving of intermediate files into a Debug/ folder. Enabling debug options can slow processing and increase disk usage — use them only when troubleshooting.
For each flag we list (A) what is printed to the terminal when the flag is enabled and (B) what files (if any) are written to disk and where.
-
check_computation_time(boolean):- Prints computational times for each step.
-
setup_video_capture(boolean)- Camera/device detection and chosen device id (e.g. "Camera id: 0" or default message).
- Selected resolution and framerate information.
- Kinect Azure calibration and tracker processing mode messages (e.g. "Body tracker processing mode: ...").
- Warnings/errors if devices fail to open or transforms cannot be created.
- Messages when debug directories are created (e.g. "Created debug directory: ").
Debug/camera_intrinsics.csv— CSV with cx, cy, fx, fy (created for MKV/dummy and Azure cases).Debug/conversion matrices/x_conversion_matrix.txtand.../y_conversion_matrix.txt— pixel-to-real-world conversion matrices (TXT).- Transformed RGB images saved as
azure_rgb_transformed_to_depth_coordinates.jpgormkv_rgb_transformed_to_depth_coordinates.jpginside theDebug/tree.
-
acquire_frame(boolean)- Per-frame acquisition status and errors (e.g. "Error: Failed to get valid color image ...").
- For MKV/dummy mode it logs frame timestamps and the global frame counter (frame time and counter values).
- Warnings about missing streams in MKV (e.g. "This MKV file might not contain color stream data").
- Dummy/MKV mode: RGB and depth images saved under
Debug/rgb images in depth coordinates/andDebug/depth images/with filenames containing agent id and timestamp/frame number.
-
skeleton_from_depth_compute(boolean)- Logs when no bodies are detected ("No bodies detected in the frame.").
- If a body is detected prints the entire 3D skeleton to the terminal (each joint name and [x,y,z]).
-
skeleton_from_rgb_compute(boolean)- Pipeline readiness and errors (e.g. "Pipeline is not ready to process", "Timeout waiting for pipeline data").
-
hessian_compute(boolean)- Warnings/errors if the pipeline is not initialized or no keypoints are available.
- The function draws ellipses and keypoints on
_rgb(visible in the viewer if enabled).
-
cov3D_compute(boolean)Debug/Covariances 3D/cov3D_data.jsonappended JSON frames containing the 3x3 covariance matrices for each processed frame.
-
consistency_check(boolean)- Currently the code only prints a single line: "Performing consistency check..."; the actual consistency logic is not implemented.
-
point_cloud_filter(boolean)- Messages when body index map is null or when filtering is disabled (e.g. "Body index map is null. Creating unfiltered point cloud.").
- Writes PLY files for filtered/unfiltered (according to
filter_point_cloudvalue) point clouds intoDebug/point clouds/named<frame>_filtered_point_cloud_frame.plyor<frame>_unfiltered_point_cloud_frame.ply.
-
coordinate_transform(boolean)- Prints the message "Applying camera coordinate transformation..." and prints the transformed 3D joint coordinates to the terminal.
-
viewer(boolean)- The viewer displays images in real-time but does not save files by itself
Notes: Clean up Debug/ periodically — images, PLYs and JSON logs can grow quickly when debugging is enabled.
The plugin supports the following settings in the INI file:
[hpe]
pub_topic = "hpe_out"
period = 30
azure_device = 0
CUDA = false
model_file = "C:/mirrorworld/hpe/models/human-pose-estimation-0001.xml"
dummy = false
filter_point_cloud = false
resolution_rgb = "1280x720"
calibration_mode = false
[hpe.debug]
check_computational_times = true
setup_video_capture = false
acquire_frame = false
skeleton_from_depth_compute = false
skeleton_from_rgb_compute = false
hessian_compute = false
cov3D_compute = false
consistency_check = false
point_cloud_filter = false
coordinate_transform = false
viewer = false
[hpe.SN000367520812]
Rxx = 1
Rxy = 0
Rxz = 0
Ryx = 0
Ryy = 1
Ryz = 0
Rzx = 0
Rzy = 0
Rzz = 1
Tx = 0
Ty = 0
Tz = 0