From 111b390f7b741b6c3d2c130333a958df4541f3a6 Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 22 Nov 2026 11:18:33 -0500 Subject: [PATCH] KinematicTool: keep plotting when Ruckig fails With ATC_ACC_R_MAX of 0 the Ruckig result is undefined, so reading result.value threw and no plot updated. After any Ruckig error the jerk array was missing, so the jerk plot threw. Handle the missing result and start the Ruckig state with a jerk sample. --- KinematicTool/KinematicTool.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/KinematicTool/KinematicTool.js b/KinematicTool/KinematicTool.js index f9152f85f..aaf1e74f4 100644 --- a/KinematicTool/KinematicTool.js +++ b/KinematicTool/KinematicTool.js @@ -432,6 +432,12 @@ function update_ruckig(config, desired, state, dt) const ruckig = new RuckigModule.Ruckig(1); const result = ruckig.calculate(input, trajectory); + if (result === undefined) { + // Result type is not registered with embind so there is no error code + console.log('Unknown error.') + return + } + if (result.value !== 0) { if (result.value === -100) { console.log('Invalid input parameters.') @@ -508,7 +514,8 @@ async function run_attitude() time: [0], pos: [wrap_PI(radians(parseFloat(document.getElementById("initial_pos").value)))], vel: [radians(parseFloat(document.getElementById("initial_vel").value))], - accel: [0] + accel: [0], + jerk: [0] } // Run until current reaches target