@@ -29,13 +29,17 @@ class RobotVelocity {
29
29
30
30
[[nodiscard]] franka::CartesianVelocities as_franka_velocity () const ;
31
31
32
- [[nodiscard]] inline RobotVelocity transform (const Affine &transform) const {
33
- return RobotVelocity (
34
- transform * end_effector_linear_velocity_, transform * end_effector_angular_velocity_, elbow_velocity_);
32
+ [[nodiscard]] inline RobotVelocity transform (const Affine &affine) const {
33
+ return transform (affine.rotation ());
34
+ }
35
+
36
+ template <typename RotationMatrixType>
37
+ [[nodiscard]] inline RobotVelocity transform (const RotationMatrixType &rotation) const {
38
+ return {rotation * end_effector_linear_velocity_, rotation * end_effector_angular_velocity_, elbow_velocity_};
35
39
}
36
40
37
41
[[nodiscard]] inline RobotVelocity with_elbow_velocity (const std::optional<double > elbow_velocity) const {
38
- return RobotVelocity ( end_effector_linear_velocity_, end_effector_angular_velocity_, elbow_velocity) ;
42
+ return { end_effector_linear_velocity_, end_effector_angular_velocity_, elbow_velocity} ;
39
43
}
40
44
41
45
[[nodiscard]] inline Eigen::Vector3d end_effector_linear_velocity () const {
@@ -56,8 +60,13 @@ class RobotVelocity {
56
60
std::optional<double > elbow_velocity_;
57
61
};
58
62
59
- inline RobotVelocity operator *(const Affine &transform, const RobotVelocity &robot_velocity) {
60
- return robot_velocity.transform (transform);
63
+ inline RobotVelocity operator *(const Affine &affine, const RobotVelocity &robot_velocity) {
64
+ return robot_velocity.transform (affine);
65
+ }
66
+
67
+ template <typename RotationMatrixType>
68
+ inline RobotVelocity operator *(const RotationMatrixType &rotation, const RobotVelocity &robot_velocity) {
69
+ return robot_velocity.transform (rotation);
61
70
}
62
71
63
72
} // namespace franky
0 commit comments