Skip to content

Commit 0117e35

Browse files
committed
Allow higher order spline derivatives.
1 parent a29e647 commit 0117e35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spatialmath/spline.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ def __call__(self, t: float) -> SE3:
133133
"""
134134
return SE3.Rt(t=self.spline_xyz(t), R=self.spline_so3(t).as_matrix())
135135

136-
def derivative(self, t: float) -> Twist3:
137-
linear_vel = self.spline_xyz.derivative()(t)
138-
angular_vel = self.spline_so3(
139-
t, 1
136+
def derivative(self, t: float, order: int = 1) -> Twist3:
137+
linear = self.spline_xyz.derivative(order)(t)
138+
angular = self.spline_so3(
139+
t, order
140140
) # 1 is angular rate, 2 is angular acceleration
141-
return Twist3(linear_vel, angular_vel)
141+
return Twist3(linear, angular)
142142

143143

144144
class SplineFit:

0 commit comments

Comments
 (0)