From faa1f8d9f0f26181b8df7aa6e6263e9ef331b85d Mon Sep 17 00:00:00 2001 From: Tim Schneider Date: Mon, 27 May 2024 21:50:43 +0200 Subject: [PATCH] Implemented non-zero velocity joint waypoints --- include/franky/joint_state.hpp | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 include/franky/joint_state.hpp diff --git a/include/franky/joint_state.hpp b/include/franky/joint_state.hpp new file mode 100644 index 00000000..1de3ca68 --- /dev/null +++ b/include/franky/joint_state.hpp @@ -0,0 +1,40 @@ +#pragma once + +#include +#include +#include + +#include "franky/robot_pose.hpp" +#include "franky/robot_velocity.hpp" + +namespace franky { + +class JointState { + public: + // Suppress implicit conversion warning +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wimplicit-conversion" + JointState(Vector7d position) : position_(std::move(position)), velocity_(Vector7d::Zero()) {} +#pragma clang diagnostic pop + + JointState(Vector7d pose, Vector7d velocity) + : position_(std::move(pose)), velocity_(std::move(velocity)) {} + + JointState(const JointState &) = default; + + JointState() = default; + + [[nodiscard]] inline Vector7d position() const { + return position_; + } + + [[nodiscard]] inline Vector7d velocity() const { + return velocity_; + } + + private: + Vector7d position_; + Vector7d velocity_; +}; + +} // namespace franky