ExactCubicTrajectoryTask.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
9 
10 namespace mc_tasks
11 {
12 
22 struct MC_TASKS_DLLAPI ExactCubicTrajectoryTask : public SplineTrajectoryTask<ExactCubicTrajectoryTask>
23 {
25 
46  double duration,
47  double stiffness,
48  double weight,
49  const sva::PTransformd & target,
50  const std::vector<std::pair<double, Eigen::Vector3d>> & posWp = {},
51  const Eigen::Vector3d & init_vel = Eigen::Vector3d::Zero(),
52  const Eigen::Vector3d & init_acc = Eigen::Vector3d::Zero(),
53  const Eigen::Vector3d & end_vel = Eigen::Vector3d::Zero(),
54  const Eigen::Vector3d & end_acc = Eigen::Vector3d::Zero(),
55  const std::vector<std::pair<double, Eigen::Matrix3d>> & oriWp = {});
56 
78  ExactCubicTrajectoryTask(const mc_rbdyn::Robots & robots,
79  unsigned int robotIndex,
80  const std::string & surfaceName,
81  double duration,
82  double stiffness,
83  double weight,
84  const sva::PTransformd & target,
85  const std::vector<std::pair<double, Eigen::Vector3d>> & posWp = {},
86  const Eigen::Vector3d & init_vel = Eigen::Vector3d::Zero(),
87  const Eigen::Vector3d & init_acc = Eigen::Vector3d::Zero(),
88  const Eigen::Vector3d & end_vel = Eigen::Vector3d::Zero(),
89  const Eigen::Vector3d & end_acc = Eigen::Vector3d::Zero(),
90  const std::vector<std::pair<double, Eigen::Matrix3d>> & oriWp = {});
91 
96  const mc_trajectory::ExactCubic & spline() const { return bspline; };
101  mc_trajectory::ExactCubic & spline() { return bspline; };
102 
105  void addToGUI(mc_rtc::gui::StateBuilder & gui) override;
106 
109  void posWaypoints(const std::vector<std::pair<double, Eigen::Vector3d>> & posWp);
110 
119  void constraints(const Eigen::Vector3d & init_vel,
120  const Eigen::Vector3d & init_acc,
121  const Eigen::Vector3d & end_vel,
122  const Eigen::Vector3d & end_acc);
123 
124 protected:
128  void targetPos(const Eigen::Vector3d & target);
129 
131  const Eigen::Vector3d & targetPos() const;
132 
133 protected:
135  sva::PTransformd initialPose_;
136 };
137 
138 } // namespace mc_tasks
mc_rbdyn::Robots
Definition: Robots.h:15
mc_tasks::ExactCubicTrajectoryTask
Track an exact cubic spline, that is a curve passing exactly through waypoints in position,...
Definition: ExactCubicTrajectoryTask.h:22
MC_TASKS_DLLAPI
#define MC_TASKS_DLLAPI
Definition: api.h:50
mc_trajectory::ExactCubic
Represents an Exact Cubic spline : a curve that passes exactly through waypoints in position,...
Definition: ExactCubic.h:22
mc_tasks::ExactCubicTrajectoryTask::initialPose_
sva::PTransformd initialPose_
Definition: ExactCubicTrajectoryTask.h:135
mc_tasks::SplineTrajectoryTask
Generic CRTP implementation for a task tracking a curve in both position and orientation....
Definition: SplineTrajectoryTask.h:37
mc_rbdyn::RobotFrame
Definition: RobotFrame.h:21
mc_tasks::ExactCubicTrajectoryTask::spline
mc_trajectory::ExactCubic & spline()
accessor to the underlying spline (used by SplineTrajectoryTask)
Definition: ExactCubicTrajectoryTask.h:101
mc_tasks::ExactCubicTrajectoryTask::spline
const mc_trajectory::ExactCubic & spline() const
const accessor to the underlying spline (used by SplineTrajectoryTask)
Definition: ExactCubicTrajectoryTask.h:96
SplineTrajectoryTask.h
mc_rtc::gui::StateBuilder
Definition: StateBuilder.h:27
mc_tasks::ExactCubicTrajectoryTask::bspline
mc_trajectory::ExactCubic bspline
Definition: ExactCubicTrajectoryTask.h:134
mc_tasks
Definition: StabilizerStandingState.h:11
ExactCubic.h