hpp-pinocchio 6.0.0
Wrapping of the kinematic/dynamic chain Pinocchio for HPP.
Loading...
Searching...
No Matches
special-euclidean.hh
Go to the documentation of this file.
1// Copyright (c) 2018, Joseph Mirabel
2// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_PINOCCHIO_LIEGROUP_SPECIAL_EUCLIDEAN_OPERATION_HH
30#define HPP_PINOCCHIO_LIEGROUP_SPECIAL_EUCLIDEAN_OPERATION_HH
31
32#include <pinocchio/multibody/liegroup/special-euclidean.hpp>
33
34namespace hpp {
35namespace pinocchio {
36namespace liegroup {
37template <int N>
39 : public ::pinocchio::SpecialEuclideanOperationTpl<N, value_type> {
40 typedef ::pinocchio::SpecialEuclideanOperationTpl<N, value_type> Base;
41 enum { NT = N, NR = Base::NV - N, BoundSize = NT };
42
43 template <class ConfigL_t, class ConfigR_t>
44 double squaredDistance(const Eigen::MatrixBase<ConfigL_t>& q0,
45 const Eigen::MatrixBase<ConfigR_t>& q1) {
46 return Base::squaredDistance(q0, q1);
47 }
48
49 // Intentionally not implemented as it does not make sense.
50 /*
51 template <class ConfigL_t, class ConfigR_t>
52 static double squaredDistance(
53 const Eigen::MatrixBase<ConfigL_t> & q0,
54 const Eigen::MatrixBase<ConfigR_t> & q1,
55 const typename ConfigL_t::Scalar& w)
56 {
57 typedef liegroup::CartesianProductOperation<
58 liegroup::VectorSpaceOperation<NT, false>,
59 liegroup::SpecialOrthogonalOperation<N>
60 > type;
61 return type::squaredDistance (q0, q1, w);
62 }
63 */
64
65 template <class ConfigIn_t, class ConfigOut_t>
66 static void setBound(const Eigen::MatrixBase<ConfigIn_t>& bound,
67 const Eigen::MatrixBase<ConfigOut_t>& out) {
68 if (bound.size() == Base::NQ || bound.size() == BoundSize) {
69 const_cast<Eigen::MatrixBase<ConfigOut_t>&>(out).head(bound.size()) =
70 bound;
71 } else {
72 HPP_THROW(std::invalid_argument, "Expected vector of size "
73 << BoundSize << " or " << Base::NQ
74 << ", got size " << bound.size());
75 }
76 }
77
78 template <class JacobianIn_t, class JacobianOut_t>
80 const Eigen::MatrixBase<JacobianIn_t>& Jin,
81 const Eigen::MatrixBase<JacobianOut_t>& Jout) {
82 const_cast<Eigen::MatrixBase<JacobianOut_t>&>(Jout) =
83 Jin.template bottomLeftCorner<3, 3>();
84 }
85};
86} // namespace liegroup
87} // namespace pinocchio
88} // namespace hpp
89
90#endif // HPP_PINOCCHIO_LIEGROUP_SPECIAL_EUCLIDEAN_OPERATION_HH
Utility functions.
Definition body.hh:39
Definition collision-object.hh:40
Definition special-euclidean.hh:39
static void getRotationSubJacobian(const Eigen::MatrixBase< JacobianIn_t > &Jin, const Eigen::MatrixBase< JacobianOut_t > &Jout)
Definition special-euclidean.hh:79
::pinocchio::SpecialEuclideanOperationTpl< N, value_type > Base
Definition special-euclidean.hh:40
static void setBound(const Eigen::MatrixBase< ConfigIn_t > &bound, const Eigen::MatrixBase< ConfigOut_t > &out)
Definition special-euclidean.hh:66
double squaredDistance(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1)
Definition special-euclidean.hh:44
@ BoundSize
Definition special-euclidean.hh:41
@ NT
Definition special-euclidean.hh:41
@ NR
Definition special-euclidean.hh:41