Franky  0.9.1
A High-Level Motion API for Franka
joint_state.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 #include <Eigen/Core>
5 #include <utility>
6 
7 #include "franky/robot_pose.hpp"
9 
10 namespace franky {
11 
17 class JointState {
18  public:
19  // Suppress implicit conversion warning
20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wimplicit-conversion"
27  JointState(Vector7d position) : position_(std::move(position)), velocity_(Vector7d::Zero()) {}
28 #pragma clang diagnostic pop
29 
35  : position_(std::move(position)), velocity_(std::move(velocity)) {}
36 
37  JointState(const JointState &) = default;
38 
39  JointState() = default;
40 
44  [[nodiscard]] inline Vector7d position() const {
45  return position_;
46  }
47 
51  [[nodiscard]] inline Vector7d velocity() const {
52  return velocity_;
53  }
54 
55  private:
56  Vector7d position_;
57  Vector7d velocity_;
58 };
59 
60 } // namespace franky
Joint state of a robot.
Definition: joint_state.hpp:17
JointState()=default
Vector7d velocity() const
The velocity component of the state.
Definition: joint_state.hpp:51
JointState(const JointState &)=default
JointState(Vector7d position)
Construct a joint state with the given joint positions and zero velocities.
Definition: joint_state.hpp:27
JointState(Vector7d position, Vector7d velocity)
Definition: joint_state.hpp:34
Vector7d position() const
The position component of the state.
Definition: joint_state.hpp:44
Definition: gripper.cpp:3
Eigen::Vector< double, 7 > Vector7d
Definition: types.hpp:9