forked from pantor/frankx
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented non-zero velocity joint waypoints
- Loading branch information
1 parent
6be576f
commit faa1f8d
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include <optional> | ||
#include <Eigen/Core> | ||
#include <utility> | ||
|
||
#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 |