DHCalc is a C++ command-line tool for Denavit-Hartenberg forward kinematics.
A TSV (tab-separated values) is the chosen file format, because a DH table is already tabular data and TSV keeps the input easy to read, easy to generate from spreadsheets or scripts, and easy to parse in a lightweight CLI application.
| Column | Required | Alternatives |
|---|---|---|
r |
yes | — |
d |
yes | — |
θ |
yes, exactly one | θ_rad · θ_deg (by default) |
α |
yes, exactly one | α_rad · α_deg (by default) |
joint_name |
no | — |
Notes:
- Blank lines are ignored.
- Lines starting with
#are treated as comments. - Column order can vary.
- The parser expects simple tab-separated values without quoting.
See in examples/stanford_arm.dh.tsv
At configure time CMake also generates examples/empty.dh.tsv, a header-only table with the canonical column order and zero data rows.
Requirements:
- CMake 3.20 or newer
- A C++20 compiler
- Eigen 3.3+ installed on the system
- GoogleTest installed on the system (for tests)
Build commands:
mkdir build && cd build
cmake ..
make && cd ..
# or
cmake -B build
cmake --build buildBasic usage:
./build/dhcalc <path-to-dh-table.tsv>Optional precision control:
./build/dhcalc examples/stanford_arm.dh.tsv --precision 4ctest --test-dir build --output-on-failure| Binary | Directory | Purpose |
|---|---|---|
dhcalc_parser_tests |
tests/parser/ |
TSV parsing, header validation, error handling |
dhcalc_fk_tests |
tests/fk/ |
Joint transforms, chain multiplication, formatting |
dhcalc_stress_tests |
tests/stress/ |
Large generated tables in /tmp/, timing |