humoto
task_jointsbounds.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4  @copyright 2014-2017 INRIA. Licensed under the Apache License, Version 2.0.
5  (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
6 
7  @brief
8 */
9 
10 #pragma once
11 
12 namespace humoto
13 {
14  namespace pepper_ik
15  {
16  /**
17  * @brief Bound joint angles
18  */
19  template <int t_features>
21  {
22  public:
23  TaskJointsBounds () : TaskILU("TaskJointsBounds")
24  {
25  }
26 
27 
28  /// @copydoc humoto::TaskBase::form
29  void form( const humoto::SolutionStructure &sol_structure,
30  const humoto::Model &model_base,
31  const humoto::ControlProblem &control_problem)
32  {
34  dynamic_cast <const humoto::pepper_ik::Model<t_features> &>(model_base);
35 
37 
38  humoto::IndexVector &I = getIndices();
39  Eigen::VectorXd &lb = getLowerBounds();
40  Eigen::VectorXd &ub = getUpperBounds();
41 
42  I.resize(loc_var.length_);
43 
44  for (std::size_t i = 0; i < loc_var.length_; ++i)
45  {
46  I[i] = loc_var.offset_ + i;
47  }
48 
49  lb = model.constraints_.joint_position_bounds_min_
50  -
51  model.getState().joint_angles_;
52  ub = model.constraints_.joint_position_bounds_max_
53  -
54  model.getState().joint_angles_;
55  }
56  };
57  } //pepper
58 } //humoto
Abstract base class (for control problems)
static const char * JOINTS_VARIABLES_ID
Joint angles.
Definition: common.h:19
#define HUMOTO_LOCAL
Definition: export_import.h:26
Analog of &#39;sol_structure&#39; struct in Octave code. [determine_solution_structure.m].
Definition: solution.h:33
Eigen::Matrix< unsigned int, Eigen::Dynamic, 1 > IndexVector
Definition: utility.h:19
void form(const humoto::SolutionStructure &sol_structure, const humoto::Model &model_base, const humoto::ControlProblem &control_problem)
Form the task.
Task: lb <= x[I] <= ub.
Definition: task.h:572
Location getSolutionPartLocation(const std::string &id) const
Get location of a data in the solution vector.
Definition: solution.h:122
The root namespace of HuMoTo.
Definition: config.h:12
Instances of this class are passed to a virtual method &#39;humoto::TaskBase::form()&#39;, so even though this class is basically useless in its present form we cannot avoid its definition using a template.
Definition: model.h:41
const GeneralizedCoordinates< t_features > & getState() const
Return current model state.
Definition: model.h:733
Constraints constraints_
Definition: model.h:264
Location of a data chunk (offset + length).
Definition: utility.h:146