Skip to content

Commit

Permalink
Implemented JointMotion
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Schneider committed Feb 2, 2024
1 parent 1bc2d2d commit 07beef3
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions franky/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
LinearImpedanceMotion,
JointWaypoint,
JointWaypointMotion,
JointMotion,
CartesianWaypointMotion,
LinearMotion,
CartesianPoseStopMotion,
Expand Down
1 change: 1 addition & 0 deletions include/franky.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
22 changes: 22 additions & 0 deletions include/franky/motion/joint_motion.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <atomic>
#include <optional>
#include <ruckig/ruckig.hpp>

#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
7 changes: 7 additions & 0 deletions python/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,13 @@ PYBIND11_MODULE(_franky, m) {
"relative_dynamics_factor"_a = 1.0,
"return_when_finished"_a = true);

py::class_<JointMotion, JointWaypointMotion, std::shared_ptr<JointMotion>>(m, "JointMotion")
.def(py::init<const Vector7d &, ReferenceType, double, bool>(),
"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_<Waypoint<RobotPose>>(m, "CartesianWaypoint")
.def(py::init<>(
[](
Expand Down
25 changes: 25 additions & 0 deletions src/motion/joint_motion.cpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 07beef3

Please sign in to comment.