diff --git a/franky/__init__.py b/franky/__init__.py index 3f5a7c9b..cea79e09 100644 --- a/franky/__init__.py +++ b/franky/__init__.py @@ -29,6 +29,7 @@ LinearImpedanceMotion, JointWaypoint, JointWaypointMotion, + JointMotion, CartesianWaypointMotion, LinearMotion, CartesianPoseStopMotion, diff --git a/include/franky.hpp b/include/franky.hpp index 8f0f8a18..20aebcad 100644 --- a/include/franky.hpp +++ b/include/franky.hpp @@ -4,6 +4,7 @@ #include "franky/motion/condition.hpp" #include "franky/motion/exponential_impedance_motion.hpp" #include "franky/motion/impedance_motion.hpp" +#include "franky/motion/joint_motion.hpp" #include "franky/motion/joint_waypoint_motion.hpp" #include "franky/motion/linear_impedance_motion.hpp" #include "franky/motion/linear_motion.hpp" diff --git a/include/franky/motion/joint_motion.hpp b/include/franky/motion/joint_motion.hpp new file mode 100644 index 00000000..9459d3cb --- /dev/null +++ b/include/franky/motion/joint_motion.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include + +#include "franky/robot_pose.hpp" +#include "franky/motion/joint_waypoint_motion.hpp" +#include "franky/motion/reference_type.hpp" + +namespace franky { + +class JointMotion : public JointWaypointMotion { + public: + explicit JointMotion( + const Vector7d &target, + ReferenceType reference_type, + RelativeDynamicsFactor relative_dynamics_factor, + bool return_when_finished); +}; + +} // namespace franky diff --git a/python/python.cpp b/python/python.cpp index b77a9e32..4f793f17 100644 --- a/python/python.cpp +++ b/python/python.cpp @@ -653,6 +653,13 @@ PYBIND11_MODULE(_franky, m) { "relative_dynamics_factor"_a = 1.0, "return_when_finished"_a = true); + py::class_>(m, "JointMotion") + .def(py::init(), + "target"_a, + py::arg_v("reference_type", ReferenceType::Absolute, "_franky.ReferenceType.Absolute"), + "relative_dynamics_factor"_a = 1.0, + "return_when_finished"_a = true); + py::class_>(m, "CartesianWaypoint") .def(py::init<>( []( diff --git a/src/motion/joint_motion.cpp b/src/motion/joint_motion.cpp new file mode 100644 index 00000000..4c2bd533 --- /dev/null +++ b/src/motion/joint_motion.cpp @@ -0,0 +1,25 @@ +#include "franky/motion/joint_motion.hpp" + +#include "franky/motion/joint_waypoint_motion.hpp" + +namespace franky { + +JointMotion::JointMotion( + const Vector7d &target, + ReferenceType reference_type, + RelativeDynamicsFactor relative_dynamics_factor, + bool return_when_finished) + : JointWaypointMotion( + { + { + .target = target, + .reference_type = reference_type, + .relative_dynamics_factor = relative_dynamics_factor + } + }, { + Params{ + .return_when_finished = return_when_finished + } + }) {} + +} // namespace franky