robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
split_direction.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_SPLIT_DIRECTION_HPP_
2#define ROBOTOC_SPLIT_DIRECTION_HPP_
3
4#include <iostream>
5
6#include "Eigen/Core"
7
11
12
13namespace robotoc {
14
21public:
26 SplitDirection(const Robot& robot);
27
32
36 ~SplitDirection() = default;
37
41 SplitDirection(const SplitDirection&) = default;
42
47
51 SplitDirection(SplitDirection&&) noexcept = default;
52
56 SplitDirection& operator=(SplitDirection&&) noexcept = default;
57
62 void setContactDimension(const int dimf);
63
69
74 Eigen::VectorXd dx;
75
80 Eigen::VectorBlock<Eigen::VectorXd> dq();
81
85 const Eigen::VectorBlock<const Eigen::VectorXd> dq() const;
86
91 Eigen::VectorBlock<Eigen::VectorXd> dv();
92
96 const Eigen::VectorBlock<const Eigen::VectorXd> dv() const;
97
101 Eigen::VectorXd du;
102
108 Eigen::VectorBlock<Eigen::VectorXd> daf();
109
113 const Eigen::VectorBlock<const Eigen::VectorXd> daf() const;
114
119 Eigen::VectorBlock<Eigen::VectorXd> da();
120
124 const Eigen::VectorBlock<const Eigen::VectorXd> da() const;
125
131 Eigen::VectorBlock<Eigen::VectorXd> ddvf();
132
136 const Eigen::VectorBlock<const Eigen::VectorXd> ddvf() const;
137
142 Eigen::VectorBlock<Eigen::VectorXd> ddv();
143
147 const Eigen::VectorBlock<const Eigen::VectorXd> ddv() const;
148
154 Eigen::VectorBlock<Eigen::VectorXd> df();
155
159 const Eigen::VectorBlock<const Eigen::VectorXd> df() const;
160
165 Eigen::VectorXd dlmdgmm;
166
171 Eigen::VectorBlock<Eigen::VectorXd> dlmd();
172
176 const Eigen::VectorBlock<const Eigen::VectorXd> dlmd() const;
177
182 Eigen::VectorBlock<Eigen::VectorXd> dgmm();
183
187 const Eigen::VectorBlock<const Eigen::VectorXd> dgmm() const;
188
194 Eigen::VectorBlock<Eigen::VectorXd> dbetamu();
195
199 const Eigen::VectorBlock<const Eigen::VectorXd> dbetamu() const;
200
205 Eigen::VectorBlock<Eigen::VectorXd> dbeta();
206
210 const Eigen::VectorBlock<const Eigen::VectorXd> dbeta() const;
211
217 Eigen::VectorBlock<Eigen::VectorXd> dmu();
218
222 const Eigen::VectorBlock<const Eigen::VectorXd> dmu() const;
223
228 Eigen::VectorXd dnu_passive;
229
235 Eigen::VectorBlock<Eigen::VectorXd> dxi();
236
240 const Eigen::VectorBlock<const Eigen::VectorXd> dxi() const;
241
245 double dts;
246
250 double dts_next;
251
255 void setZero();
256
261 int dimf() const;
262
267 int dims() const;
268
274
280 bool isApprox(const SplitDirection& other) const;
281
286 void setRandom();
287
292 void setRandom(const ContactStatus& contact_status);
293
298 void setRandom(const ImpactStatus& impact_status);
299
306 void setRandom(const ContactStatus& contact_status,
307 const ImpactStatus& impact_status);
308
314 static SplitDirection Random(const Robot& robot);
315
322 static SplitDirection Random(const Robot& robot,
323 const ContactStatus& contact_status);
324
331 static SplitDirection Random(const Robot& robot,
332 const ImpactStatus& impact_status);
333
341 static SplitDirection Random(const Robot& robot,
342 const ContactStatus& contact_status,
343 const ImpactStatus& impact_status);
344
348 void disp(std::ostream& os) const;
349
350 friend std::ostream& operator<<(std::ostream& os, const SplitDirection& d);
351
352private:
353 Eigen::VectorXd daf_full_, dbetamu_full_, dxi_full_;
354 int dimv_, dimu_, dim_passive_, dimf_, dims_;
355
356};
357
358} // namespace robotoc
359
360#include "robotoc/core/split_direction.hxx"
361
362#endif // ROBOTOC_SPLIT_OCP_DIRECTION_HPP_
Contact status of robot model.
Definition: contact_status.hpp:32
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
Dynamics and kinematics model of robots. Wraps pinocchio::Model and pinocchio::Data....
Definition: robot.hpp:32
Newton direction of the solution to the optimal control problem split into a time stage.
Definition: split_direction.hpp:20
Eigen::VectorXd dx
Stack of the Newton directions of SplitSolution::q and SplitSolution::v. Size is 2 * Robot::dimv().
Definition: split_direction.hpp:74
void setContactDimension(const int dimf)
Sets contact status, i.e., set dimension of the contact forces.
Definition: split_direction.hxx:10
Eigen::VectorBlock< Eigen::VectorXd > da()
Newton direction of SplitSolution::a. Size is Robot::dimv().
Definition: split_direction.hxx:61
int dims() const
Returns the dimension of the switching constraint.
Definition: split_direction.hxx:193
double dts
Newton direction of the switching time.
Definition: split_direction.hpp:245
Eigen::VectorBlock< Eigen::VectorXd > dv()
Newton direction of SplitSolution::gmm. Size is Robot::dimv().
Definition: split_direction.hxx:37
Eigen::VectorBlock< Eigen::VectorXd > dbeta()
Newton direction of SplitSolution::beta. Size is Robot::dimv().
Definition: split_direction.hxx:142
Eigen::VectorXd du
Newton direction of SplitSolution::u. Size is Robot::dimu().
Definition: split_direction.hpp:101
SplitDirection & operator=(const SplitDirection &)=default
Default copy operator.
Eigen::VectorXd dnu_passive
Newton direction of SplitSolution::nu_passive. Size is Robot::dim_passive().
Definition: split_direction.hpp:228
Eigen::VectorBlock< Eigen::VectorXd > dbetamu()
Stack of the Newton direction of SplitSolution::beta and SplitSolution::mu_stack()....
Definition: split_direction.hxx:131
Eigen::VectorBlock< Eigen::VectorXd > dgmm()
Newton direction of SplitSolution::gmm. Size is Robot::dimv().
Definition: split_direction.hxx:118
double dts_next
Newton direction of the next switching time.
Definition: split_direction.hpp:250
bool isApprox(const SplitDirection &other) const
Return true if two SplitDirection have the same values and false if not.
Eigen::VectorBlock< Eigen::VectorXd > ddvf()
Stack of Newton direction of SplitSolution::dv and SplitSolution::f. Size is Robot::dimv() + ContactS...
Definition: split_direction.hxx:72
SplitDirection(const SplitDirection &)=default
Default copy constructor.
Eigen::VectorBlock< Eigen::VectorXd > ddv()
Newton direction of SplitSolution::dv. Size is Robot::dimv().
Definition: split_direction.hxx:83
void setRandom()
Sets each component vector by random value based on the current contact status.
static SplitDirection Random(const Robot &robot)
Generates split direction filled randomly.
Eigen::VectorBlock< Eigen::VectorXd > dmu()
Newton direction of SplitSolution::mu_stack(). Size is SplitSolution::dimf().
Definition: split_direction.hxx:153
Eigen::VectorBlock< Eigen::VectorXd > dlmd()
Newton direction of SplitSolution::lmd. Size is Robot::dimv().
Definition: split_direction.hxx:105
void setSwitchingConstraintDimension(const int dims)
Sets the dimension of the switching constraint.
Definition: split_direction.hxx:17
Eigen::VectorBlock< Eigen::VectorXd > daf()
Stack of Newton direction of SplitSolution::a and SplitSolution::f. Size is Robot::dimv() + ContactSt...
Definition: split_direction.hxx:50
Eigen::VectorXd dlmdgmm
Stack of the Newton direction of SplitSolution::lmd and SplitSolution::gmm. Size is 2 * Robot::dimv()...
Definition: split_direction.hpp:165
~SplitDirection()=default
Default destructor.
void disp(std::ostream &os) const
Displays the split direction onto a ostream.
Eigen::VectorBlock< Eigen::VectorXd > df()
Newton direction of SplitSolution::f_stack(). Size is ContactStatus::dimf().
Definition: split_direction.hxx:94
SplitDirection()
Default constructor.
int dimf() const
Returns the dimension of the contact.
Definition: split_direction.hxx:188
Eigen::VectorBlock< Eigen::VectorXd > dxi()
Newton direction of SplitSolution::xi_stack(). Size is SplitSolution::dims().
Definition: split_direction.hxx:164
Eigen::VectorBlock< Eigen::VectorXd > dq()
Newton direction of SplitSolution::q. Size is Robot::dimv().
Definition: split_direction.hxx:24
SplitDirection(SplitDirection &&) noexcept=default
Default move constructor.
bool isDimensionConsistent() const
Checks dimensional consistency of each component.
SplitDirection(const Robot &robot)
Construct a split solution.
void setZero()
Set the all directions zero.
Definition: split_direction.hxx:175
Definition: constraint_component_base.hpp:17