hpp-pinocchio  4.9.1
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
configuration.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Author: Florent Lamiraux
4 //
5 //
6 // This file is part of hpp-pinocchio
7 // hpp-pinocchio is free software: you can redistribute it
8 // and/or modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation, either version
10 // 3 of the License, or (at your option) any later version.
11 //
12 // hpp-pinocchio is distributed in the hope that it will be
13 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Lesser Public License for more details. You should have
16 // received a copy of the GNU Lesser General Public License along with
17 // hpp-pinocchio If not, see
18 // <http://www.gnu.org/licenses/>.
19 
20 #ifndef HPP_PINOCCHIO_CONFIGURATION_HH
21 # define HPP_PINOCCHIO_CONFIGURATION_HH
22 
23 # include <iomanip>
24 # include <hpp/pinocchio/fwd.hh>
25 
26 namespace hpp {
27  namespace pinocchio {
33  void saturate (const DevicePtr_t& robot,
34  ConfigurationOut_t configuration);
35 
41  bool saturate (const DevicePtr_t& robot,
42  ConfigurationOut_t configuration,
43  ArrayXb& saturation);
44 
63  template<bool saturateConfig, typename LieGroup>
64  void integrate (const DevicePtr_t& robot,
65  ConfigurationIn_t configuration,
66  vectorIn_t velocity, ConfigurationOut_t result);
67 
68  void integrate (const DevicePtr_t& robot,
69  ConfigurationIn_t configuration,
70  vectorIn_t velocity, ConfigurationOut_t result);
71 
84  template <typename LieGroup>
85  void interpolate (const DevicePtr_t& robot,
88  const value_type& u,
89  ConfigurationOut_t result);
90 
91  void interpolate (const DevicePtr_t& robot,
94  const value_type& u,
95  ConfigurationOut_t result);
96 
112  template <typename LieGroup>
113  void difference (const DevicePtr_t& robot, ConfigurationIn_t q1,
114  ConfigurationIn_t q2, vectorOut_t result);
115 
116  void difference (const DevicePtr_t& robot, ConfigurationIn_t q1,
117  ConfigurationIn_t q2, vectorOut_t result);
118 
127  bool isApprox (const DevicePtr_t& robot, ConfigurationIn_t q1,
128  ConfigurationIn_t q2, value_type eps);
129 
136  ConfigurationIn_t q2);
137 
144  void normalize (const DevicePtr_t& robot, Configuration_t& q);
145 
148  inline void normalize (const DevicePtr_t& robot, ConfigurationOut_t q)
149  {
150  Configuration_t qq = q;
151  normalize(robot, qq);
152  q = qq;
153  }
154 
158  bool isNormalized (const DevicePtr_t& robot, ConfigurationIn_t q,
159  const value_type& eps);
160 
162  inline std::string displayConfig (ConfigurationIn_t q, int precision = 20)
163  {
164  std::ostringstream oss; oss << "(" << std::setprecision (precision);
165  for (size_type i=0; i < q.size (); ++i) {
166  oss << q [i] << ",";
167  }
168  oss << ")";
169  return oss.str ();
170  }
171 
173  std::ostream& display (std::ostream& os, const SE3& m);
174  } // namespace pinocchio
175 } // namespace hpp
176 #endif // HPP_PINOCCHIO_CONFIGURATION_HH
value_type distance(const DevicePtr_t &robot, ConfigurationIn_t q1, ConfigurationIn_t q2)
boost::shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:104
Utility functions.
Eigen::Ref< vector_t > vectorOut_t
Definition: fwd.hh:81
void normalize(const DevicePtr_t &robot, Configuration_t &q)
matrix_t::Index size_type
Definition: fwd.hh:84
Eigen::Ref< Configuration_t > ConfigurationOut_t
Definition: fwd.hh:78
::pinocchio::SE3 SE3
Definition: fwd.hh:70
bool isApprox(const DevicePtr_t &robot, ConfigurationIn_t q1, ConfigurationIn_t q2, value_type eps)
bool isNormalized(const DevicePtr_t &robot, ConfigurationIn_t q, const value_type &eps)
Eigen::Array< bool, Eigen::Dynamic, 1 > ArrayXb
Definition: fwd.hh:73
void difference(const DevicePtr_t &robot, ConfigurationIn_t q1, ConfigurationIn_t q2, vectorOut_t result)
void integrate(const DevicePtr_t &robot, ConfigurationIn_t configuration, vectorIn_t velocity, ConfigurationOut_t result)
void saturate(const DevicePtr_t &robot, ConfigurationOut_t configuration)
double value_type
Definition: fwd.hh:40
Eigen::Ref< const Configuration_t > ConfigurationIn_t
Definition: fwd.hh:77
Eigen::Ref< const vector_t > vectorIn_t
Definition: fwd.hh:80
std::string displayConfig(ConfigurationIn_t q, int precision=20)
Write configuration in a string.
Definition: configuration.hh:162
vector_t Configuration_t
Definition: fwd.hh:76
std::ostream & display(std::ostream &os, const SE3 &m)
Write a SE3 taking into account the indentation.
void interpolate(const DevicePtr_t &robot, ConfigurationIn_t q0, ConfigurationIn_t q1, const value_type &u, ConfigurationOut_t result)