代码: https://github.com/julyfun/robotoy
![[Pasted image 20251222152219.png]]
![[Pasted image 20251222152230.png]]
![[Pasted image 20251222152240.png]]
![[Pasted image 20251222152247.png]]

使用方式
见 https://github.com/julyfun/robotoy/blob/main/robotoy/itp_state/tests/test_package.py
1itp_state = ItpState()2itp_state.init(v_max=v_max, a_max=a_max, j_max=j_max, fps=fps)3# config4itp_state = ItpState()5itp_state.init(v_max=v_max, a_max=a_max, j_max=j_max, fps=fps)6
7# set initial state8itp_state.init(x0=x0, v0=v0)9for i, (x, v, t) in enumerate(zip(x_samples, v_samples, t_samples)):10 points_needed = int((t - last_itpltn_t) * fps)11 res += itp_state.interpolate(12 arr(x), arr(v), points_needed, first_delta_t=(last_itpltn_t - t)13 )