按规划持续工作
结论:五轴 switchkins remap native 执行路径已扩展到 vendored xyzac/xyzbc switchkins demo,验证仍通过 LinuxCNC REMAP/O-word/open/read/execute 路径和 HAL adapter 边界完成,未新增自写 M428/M429/M430 或运动学语义。
This commit is contained in:
@@ -213,7 +213,7 @@ The validation fails if:
|
||||
| `linuxcnc_interp_init_harness` | Validates vendored LinuxCNC `Interp::init()` emits canonical initialization boundaries, reads metric/inch machine units, and synchronizes current/selected tool slots through standalone status adapters. |
|
||||
| `linuxcnc_indexer_harness` | Validates vendored LinuxCNC single-axis rotary indexer dispatch emits lock/unlock and motion boundaries through the standalone event sink. |
|
||||
| `linuxcnc_remap_hal_sync_harness` | Validates vendored LinuxCNC `M68`/`M66` execution can drive the standalone HAL adapter boundary used by 5-axis switchkins remap files, including `_hal[motion.switchkins-type]` readback. |
|
||||
| `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines, then runs vendored `xyzac_switchkins_test_1.ngc` and `xyzac_switchkins_test_3.ngc` through the LinuxCNC file `open/read/execute` path. |
|
||||
| `linuxcnc_5axis_remap_execute_harness` | Validates vendored LinuxCNC `REMAP` parsing plus NGC remap execution for the 5-axis `M429 -> M428 -> M430 -> M429` switchkins path in the `xyzac-trt` and `xyzbc-trt` sample machines, then runs vendored `xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`, `xyzac_switchkins_test_1.ngc`, and `xyzac_switchkins_test_3.ngc` through the LinuxCNC file `open/read/execute` path. |
|
||||
| `linuxcnc_tp_api_probe` | Validates vendored LinuxCNC trajectory planner calls for linear, arc, and queued motion paths. |
|
||||
| `linuxcnc_kinematics_probe` | Validates vendored LinuxCNC `trivkins.c` plus `kins_util.c` initialize and perform identity forward/inverse mapping through the standalone HAL/RTAPI boundary. |
|
||||
| `linuxcnc_5axis_kinematics_probe` | Validates vendored LinuxCNC `5axiskins.c` through `switchkins.c`, including 5-axis forward/inverse round-trip behavior and switching to identity kinematics. |
|
||||
|
||||
@@ -799,17 +799,20 @@ Current five-axis switchkins status:
|
||||
4. `linuxcnc_remap_parse_harness` now links vendored `interp_remap.cc` and
|
||||
validates the LinuxCNC `Interp::parse_remap()` path for `xyzac-trt` and
|
||||
`xyzbc-trt` `M428`/`M429`/`M430` NGC remap descriptors.
|
||||
5. `linuxcnc_remap_hal_sync_harness` validates vendored LinuxCNC `M68` and
|
||||
`M66` synchronization through the standalone HAL adapter boundary.
|
||||
6. `linuxcnc_5axis_remap_execute_harness` executes the `xyzac-trt` and
|
||||
`xyzbc-trt` switchkins `M429 -> M428 -> M430 -> M429` paths plus vendored
|
||||
`xyzac_switchkins.ngc`, `xyzbc_switchkins.ngc`,
|
||||
`xyzac_switchkins_test_1.ngc`, and `xyzac_switchkins_test_3.ngc` through
|
||||
LinuxCNC remap/file execution paths.
|
||||
|
||||
Next work:
|
||||
|
||||
1. Route vendored LinuxCNC O-word remap execution through the standalone
|
||||
interpreter harness for parsed NGC remaps.
|
||||
2. Connect the standalone HAL adapter so LinuxCNC `M68`/`M66` remap
|
||||
synchronization updates and reads `_hal[motion.switchkins-type]`.
|
||||
3. Add a native machine-session harness for `xyzac-trt` and `xyzbc-trt`
|
||||
programs that switch `M429 -> M428 -> M429`.
|
||||
4. Export the validated switchkins/remap status through the WASM SDK and INI
|
||||
1. Export the validated switchkins/remap status through the WASM SDK and INI
|
||||
panel without adding JavaScript CNC semantics.
|
||||
2. Add browser/Node smoke coverage that runs the vendored 5-axis remap demo
|
||||
fixtures through the WASM interpreter boundary.
|
||||
|
||||
Involved LinuxCNC source:
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Current validation is intentionally mechanical:
|
||||
| Identity/trivial kinematics | `src/emc/kinematics/kinematics.h`, `cubic.h`, `kins_util.c`, `trivkins.c` | Copy unchanged | HAL component lifecycle and RTAPI module metadata are replaced by standalone shims; forward/inverse mapping behavior remains LinuxCNC source | Vendor byte sync, per-file source probes, `linuxcnc_kinematics_probe` |
|
||||
| Switchable 5-axis bridge kinematics | `src/emc/kinematics/5axiskins.c`, `switchkins.c`, `switchkins.h`, `userkfuncs.c`, plus `src/rtapi/rtapi_ctype.h` | Copy unchanged | HAL pin allocation, HAL component lifecycle, and RTAPI module metadata are standalone runtime edges; switchable 5-axis forward/inverse behavior remains LinuxCNC source | Vendor byte sync, per-file source probes, `linuxcnc_5axis_kinematics_probe` |
|
||||
| TRT table-rotary kinematics | `src/emc/kinematics/trtfuncs.c`, `xyzac-trt-kins.c`, `xyzbc-trt-kins.c` | Copy unchanged | HAL pin allocation and switchkins lifecycle stay runtime boundaries; XYZAC/XYZBC TRT forward/inverse behavior remains LinuxCNC source | Vendor byte sync, per-file source probes, `linuxcnc_xyzac_trt_kinematics_probe`, `linuxcnc_xyzbc_trt_kinematics_probe` |
|
||||
| Five-axis switchkins machine configs and M428/M429/M430 remaps | `configs/sim/axis/vismach/5axis/bridgemill/*`, `table-dual-rotary/*`, and `table-rotary-tilting/*` selected INI, HAL, tool-table, XML, demo, and `remap_subs/*.ngc` files plus `src/emc/rs274ngc/interp_remap.cc` | Copy unchanged | `M428`, `M429`, and `M430` remain LinuxCNC `REMAP` entries that call LinuxCNC NGC subroutines using `M68`, `M66`, `_hal[motion.switchkins-type]`, and the INI/HAL `motion.analog-out-03 => motion.switchkins-type` link; standalone remap descriptor parsing now routes through vendored `Interp::parse_remap()` and `find_ngc_file()`, while full O-word remap execution and HAL synchronization remain runtime edges | Vendor byte sync, `linuxcnc_5axis_remap_asset_probe`, `linuxcnc_remap_parse_harness`, browser INI panel sample loaded from vendored `xyzab-tdr.ini` |
|
||||
| Five-axis switchkins machine configs and M428/M429/M430 remaps | `configs/sim/axis/vismach/5axis/bridgemill/*`, `table-dual-rotary/*`, and `table-rotary-tilting/*` selected INI, HAL, tool-table, XML, demo, and `remap_subs/*.ngc` files plus `src/emc/rs274ngc/interp_remap.cc` | Copy unchanged | `M428`, `M429`, and `M430` remain LinuxCNC `REMAP` entries that call LinuxCNC NGC subroutines using `M68`, `M66`, `_hal[motion.switchkins-type]`, and the INI/HAL `motion.analog-out-03 => motion.switchkins-type` link; standalone remap descriptor parsing routes through vendored `Interp::parse_remap()` and `find_ngc_file()`, and NGC remap/file execution routes through vendored LinuxCNC O-word and `open()`/`read()`/`execute()` paths while HAL synchronization stays a runtime adapter boundary | Vendor byte sync, `linuxcnc_5axis_remap_asset_probe`, `linuxcnc_remap_parse_harness`, `linuxcnc_remap_hal_sync_harness`, `linuxcnc_5axis_remap_execute_harness`, browser INI panel sample loaded from vendored `xyzab-tdr.ini` |
|
||||
| Additional non-switchable kinematics | `src/emc/kinematics/corexykins.c`, `rotatekins.c`, `rosekins.c`, `maxkins.c`, `lineardeltakins.c`, `lineardeltakins-common.h`, `rotarydeltakins.c`, `rotarydeltakins-common.h`, `scorbot-kins.c`, `tripodkins.c`, `scarakins.c`, `pumakins.c`, `pumakins.h`, `genhexkins.c`, `genhexkins.h`, `genserfuncs.c`, `genserkins.c`, `genserkins.h`, `ugenserkins.c`, `pentakins.c`, `pentakins.h`, `cubic.c` | Copy unchanged | HAL pin allocation, HAL parameter allocation, HAL component lifecycle, RTAPI module metadata, Go math C/C++ linkage, switchkins iterative-forward warmup, and userspace test-program process entry remain standalone runtime edges; forward/inverse behavior remains LinuxCNC source where the module exposes it | Vendor byte sync, per-file source probes, `linuxcnc_corexy_kinematics_probe`, `linuxcnc_rotate_kinematics_probe`, `linuxcnc_rose_kinematics_probe`, `linuxcnc_max_kinematics_probe`, `linuxcnc_lineardelta_kinematics_probe`, `linuxcnc_rotarydelta_kinematics_probe`, `linuxcnc_scorbot_kinematics_probe`, `linuxcnc_tripod_kinematics_probe`, `linuxcnc_scara_kinematics_probe`, `linuxcnc_puma_kinematics_probe`, `linuxcnc_genser_kinematics_probe`, `linuxcnc_genhex_kinematics_probe`, `linuxcnc_pentakins_kinematics_probe` |
|
||||
| Trajectory planner | `src/emc/tp/tp.c`, `tc.c`, `tcq.c`, `spherical_arc.c`, `blendmath.c`, `sp_scurve.c`, `ruckig_wrapper.c`, plus matching `*.h` files | Copy unchanged | Native realtime scheduling and motion process state are replaced by standalone probe setup; the WASM TP probe uses the same deterministic status/config boundary and calls vendored TP APIs through a narrow C ABI | Vendor byte sync, per-file source probes, `linuxcnc_tp_api_probe`, `tests/wasm/node/verify_tp_wasm.sh` |
|
||||
| Ruckig C planner support | Selected `src/emc/tp/cruckig/*.c` and `*.h` files in the manifest | Copy unchanged | Used as LinuxCNC planner support code through vendored TP sources | Vendor byte sync, per-file source probes, `tests/wasm/node/verify_tp_wasm.sh` |
|
||||
@@ -59,7 +59,7 @@ Current validation is intentionally mechanical:
|
||||
| RTAPI | `rtapi_*.h`, TP, posemath, motion headers | Minimal standalone shim in `runtime/core/shims/rtapi.h` |
|
||||
| NML transport | `emc.hh`, motion/NML type headers | Transport is not ported; only the status/type edges needed by vendored compute code are exposed through standalone shims and probes |
|
||||
| HAL runtime | named parameter lookup, kinematics component lifecycle, and runtime status edges | Standalone HAL adapter under `runtime/core/linuxcnc_wrap/` |
|
||||
| Python/remap | `rs274ngc_pre.cc`, `interp_o_word.cc`, `interp_remap.cc`, remap hooks, selected LinuxCNC `configs/sim/axis/vismach/5axis/*/remap_subs/*.ngc` files | Python calls remain stubbed at the runtime boundary today; five-axis M428/M429/M430 source assets are vendored unchanged, and the NGC remap descriptor path now parses through vendored LinuxCNC code. The next runtime step is to route LinuxCNC O-word remap execution plus HAL pin synchronization through standalone adapters without reimplementing the remap semantics |
|
||||
| Python/remap | `rs274ngc_pre.cc`, `interp_o_word.cc`, `interp_remap.cc`, remap hooks, selected LinuxCNC `configs/sim/axis/vismach/5axis/*/remap_subs/*.ngc` files | Python calls remain stubbed at the runtime boundary today; five-axis M428/M429/M430 source assets are vendored unchanged, the NGC remap descriptor path parses through vendored LinuxCNC code, and native validation now executes the switchkins NGC remap files plus selected demo programs through vendored LinuxCNC O-word and file execution paths while `_hal[...]` synchronization is supplied by the standalone HAL adapter |
|
||||
| Canonical machine actions | `interp_convert.cc`, `interp_execute.cc`, `interp_queue.cc` | Captured by standalone canonical event sink functions for regression fixtures |
|
||||
| Realtime scheduling | TP and motion headers | Not ported; native TP probes seed deterministic status/config state |
|
||||
| GUI | None used as implementation | Native LinuxCNC GUI remains reference-only |
|
||||
|
||||
@@ -42,6 +42,18 @@ void print_bool(const std::string &name, bool value)
|
||||
std::cout << name << "=" << (value ? 1 : 0) << "\n";
|
||||
}
|
||||
|
||||
void print_interp_error(Interp &interp, const std::string &label, int rc)
|
||||
{
|
||||
char error_buf[LINELEN] = {0};
|
||||
interp.error_text(rc, error_buf, sizeof(error_buf));
|
||||
std::cout << label << "_error_text=" << error_buf << "\n";
|
||||
std::cout << label << "_sequence_number=" << interp._setup.sequence_number << "\n";
|
||||
std::cout << label << "_linetext=" << interp._setup.linetext << "\n";
|
||||
std::cout << label << "_blocktext=" << interp._setup.blocktext << "\n";
|
||||
}
|
||||
|
||||
constexpr int kMaxDemoFileSteps = 4096;
|
||||
|
||||
void seed_switchkins_hal()
|
||||
{
|
||||
standalone::reset_hal_adapter();
|
||||
@@ -63,7 +75,7 @@ void initialize_interp(Interp &interp)
|
||||
|
||||
interp._setup.length_units = CANON_UNITS_MM;
|
||||
interp._setup.distance_mode = DISTANCE_MODE::ABSOLUTE;
|
||||
interp._setup.ijk_distance_mode = DISTANCE_MODE::ABSOLUTE;
|
||||
interp._setup.ijk_distance_mode = DISTANCE_MODE::INCREMENTAL;
|
||||
interp._setup.feed_mode = FEED_MODE::UNITS_PER_MINUTE;
|
||||
interp._setup.plane = CANON_PLANE::XY;
|
||||
interp._setup.motion_mode = G_0;
|
||||
@@ -173,7 +185,7 @@ bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||
int final_rc = INTERP_OK;
|
||||
bool reached_exit = false;
|
||||
|
||||
while (read_count < 512 && execute_count < 512) {
|
||||
while (read_count < kMaxDemoFileSteps && execute_count < kMaxDemoFileSteps) {
|
||||
const int read_rc = interp.read();
|
||||
if (read_rc == INTERP_ENDFILE) {
|
||||
std::cout << label << "_file_read_eof=" << read_rc << "\n";
|
||||
@@ -182,8 +194,9 @@ bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||
}
|
||||
|
||||
++read_count;
|
||||
std::cout << label << "_file_read_" << read_count << "=" << read_rc << "\n";
|
||||
if ((read_rc != INTERP_OK) && (read_rc != INTERP_EXECUTE_FINISH)) {
|
||||
std::cout << label << "_file_read_" << read_count << "=" << read_rc << "\n";
|
||||
print_interp_error(interp, label + "_file_read", read_rc);
|
||||
final_rc = read_rc;
|
||||
ok = false;
|
||||
break;
|
||||
@@ -191,7 +204,6 @@ bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||
|
||||
int execute_rc = interp.execute();
|
||||
++execute_count;
|
||||
std::cout << label << "_file_execute_" << execute_count << "=" << execute_rc << "\n";
|
||||
final_rc = execute_rc;
|
||||
if (execute_rc == INTERP_EXECUTE_FINISH) {
|
||||
++finish_count;
|
||||
@@ -199,6 +211,9 @@ bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||
|
||||
if ((execute_rc != INTERP_OK) && (execute_rc != INTERP_EXIT)) {
|
||||
if (execute_rc != INTERP_EXECUTE_FINISH) {
|
||||
std::cout << label << "_file_execute_" << execute_count << "="
|
||||
<< execute_rc << "\n";
|
||||
print_interp_error(interp, label + "_file_execute", execute_rc);
|
||||
ok = false;
|
||||
final_rc = execute_rc;
|
||||
break;
|
||||
@@ -220,8 +235,8 @@ bool execute_demo_file(const MachineCase &machine, const DemoCase &demo)
|
||||
ok &= reached_exit;
|
||||
ok &= read_count > 0;
|
||||
ok &= execute_count > 0;
|
||||
ok &= read_count < 512;
|
||||
ok &= execute_count < 512;
|
||||
ok &= read_count < kMaxDemoFileSteps;
|
||||
ok &= execute_count < kMaxDemoFileSteps;
|
||||
ok &= read_hal_named(interp, label, "_hal[motion.switchkins-type]",
|
||||
demo.expected_switchkins);
|
||||
|
||||
@@ -266,6 +281,18 @@ int main()
|
||||
}
|
||||
|
||||
const DemoCase demos[] = {
|
||||
{
|
||||
"xyzac_switchkins",
|
||||
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
|
||||
"xyzac_switchkins.ngc",
|
||||
0.0,
|
||||
},
|
||||
{
|
||||
"xyzbc_switchkins",
|
||||
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
|
||||
"xyzbc_switchkins.ngc",
|
||||
0.0,
|
||||
},
|
||||
{
|
||||
"xyzac_switchkins_test_1",
|
||||
"configs/sim/axis/vismach/5axis/table-rotary-tilting/demos/"
|
||||
@@ -280,9 +307,10 @@ int main()
|
||||
},
|
||||
};
|
||||
|
||||
for (const auto &demo : demos) {
|
||||
ok &= execute_demo_file(cases[0], demo);
|
||||
}
|
||||
ok &= execute_demo_file(cases[0], demos[0]);
|
||||
ok &= execute_demo_file(cases[1], demos[1]);
|
||||
ok &= execute_demo_file(cases[0], demos[2]);
|
||||
ok &= execute_demo_file(cases[0], demos[3]);
|
||||
|
||||
print_bool("fiveaxis_linuxcnc_remap_execute_path", ok);
|
||||
return ok ? 0 : 1;
|
||||
|
||||
@@ -302,6 +302,22 @@ grep -Fq "xyzbc_trt_M428_execute_1=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_M430_execute_0=2" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_M430_execute_1=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_linuxcnc_remap_execute_path=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_read_count=620" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_execute_count=620" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_finish_count=21" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_read_count=620" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_execute_count=620" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_finish_count=21" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_final_rc=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_file_reached_exit=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins__hal[motion.switchkins-type]: rc=0 found=1 value=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzbc_trt_xyzbc_switchkins_linuxcnc_demo_file_execute=1" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_open=0" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_read_count=248" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
grep -Fq "xyzac_trt_xyzac_switchkins_test_1_file_execute_count=248" "$FIVEAXIS_REMAP_EXECUTE_STDOUT"
|
||||
|
||||
Reference in New Issue
Block a user