Frankx  0.2.0
A High-Level Motion API for Franka
motion_path.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Eigen/Core>
4 
5 #include <movex/path/path.hpp>
6 #include <movex/waypoint.hpp>
7 
8 
9 namespace movex {
10 
15 struct PathMotion {
17 
18  std::vector<Waypoint> waypoints;
19 
20  explicit PathMotion(const std::vector<Waypoint>& waypoints): waypoints(waypoints) { }
21  explicit PathMotion(const std::vector<Affine>& waypoints, double blend_max_distance = 0.0) {
22  this->waypoints.resize(waypoints.size());
23  for (size_t i = 0; i < waypoints.size(); i += 1) {
24  this->waypoints[i] = Waypoint(waypoints[i], std::nullopt, blend_max_distance);
25  }
26  }
27 };
28 
29 
30 struct LinearPathMotion: public PathMotion {
31  explicit LinearPathMotion(const Affine& target): PathMotion({ Waypoint(target) }) { }
32  explicit LinearPathMotion(const Affine& target, double elbow): PathMotion({ Waypoint(target, elbow) }) { }
33 };
34 
35 
38  explicit LinearRelativePathMotion(const Affine& affine, double elbow): PathMotion({ Waypoint(affine, elbow, Waypoint::ReferenceType::Relative) }) { }
39 };
40 
41 } // namespace movex
movex::LinearRelativePathMotion::LinearRelativePathMotion
LinearRelativePathMotion(const Affine &affine, double elbow)
Definition: motion_path.hpp:38
movex::PathMotion
Definition: motion_path.hpp:15
movex::LinearPathMotion::LinearPathMotion
LinearPathMotion(const Affine &target)
Definition: motion_path.hpp:31
movex::PathMotion::waypoints
std::vector< Waypoint > waypoints
Definition: motion_path.hpp:18
movex::Waypoint
Definition: waypoint.hpp:12
movex::LinearPathMotion
Definition: motion_path.hpp:30
movex::PathMotion::PathMotion
PathMotion(const std::vector< Waypoint > &waypoints)
Definition: motion_path.hpp:20
frankx::Affine
affx::Affine Affine
Definition: motion_generator.hpp:15
movex::LinearRelativePathMotion
Definition: motion_path.hpp:36
movex::PathMotion::Affine
affx::Affine Affine
Definition: motion_path.hpp:16
movex::Waypoint::ReferenceType::Relative
@ Relative
movex
Definition: motion_impedance.hpp:13
movex::LinearRelativePathMotion::LinearRelativePathMotion
LinearRelativePathMotion(const Affine &affine)
Definition: motion_path.hpp:37
waypoint.hpp
path.hpp
movex::PathMotion::PathMotion
PathMotion(const std::vector< Affine > &waypoints, double blend_max_distance=0.0)
Definition: motion_path.hpp:21
movex::LinearPathMotion::LinearPathMotion
LinearPathMotion(const Affine &target, double elbow)
Definition: motion_path.hpp:32