Skip to content
Snippets Groups Projects
Commit 6c6f2d6b authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

add method 'exp' that takes an EmbeddedTangentVector

[[Imported from SVN: r6708]]
parent cd44250b
No related branches found
No related tags found
No related merge requests found
...@@ -20,8 +20,14 @@ struct RigidBodyMotion ...@@ -20,8 +20,14 @@ struct RigidBodyMotion
/** \brief The type used for coordinates */ /** \brief The type used for coordinates */
typedef T ctype; typedef T ctype;
/** \brief The exponential map from a given point $p \in SE(d)$. */ /** \brief The exponential map from a given point $p \in SE(d)$.
static RigidBodyMotion<dim,ctype> exp(const RigidBodyMotion<dim,ctype>& p, const TangentVector& v) {
Why the template parameter? Well, it should work with both TangentVector and EmbeddedTangentVector.
In general these differ and we could just have two exp methods. However in 2d they do _not_ differ,
and then the compiler complains about having two methods with the same signature.
*/
template <class TVector>
static RigidBodyMotion<dim,ctype> exp(const RigidBodyMotion<dim,ctype>& p, const TVector& v) {
RigidBodyMotion<dim,ctype> result; RigidBodyMotion<dim,ctype> result;
...@@ -30,8 +36,11 @@ struct RigidBodyMotion ...@@ -30,8 +36,11 @@ struct RigidBodyMotion
result.r[i] = p.r[i] + v[i]; result.r[i] = p.r[i] + v[i];
// Add rotational correction // Add rotational correction
typename Rotation<dim,ctype>::TangentVector qCorr; typedef typename Dune::SelectType<Dune::is_same<TVector,TangentVector>::value,
for (int i=0; i<Rotation<dim,ctype>::TangentVector::size; i++) typename Rotation<dim,ctype>::TangentVector,
typename Rotation<dim,ctype>::EmbeddedTangentVector>::Type RotationTangentVector;
RotationTangentVector qCorr;
for (int i=0; i<RotationTangentVector::size; i++)
qCorr[i] = v[dim+i]; qCorr[i] = v[dim+i];
result.q = Rotation<dim,ctype>::exp(p.q, qCorr); result.q = Rotation<dim,ctype>::exp(p.q, qCorr);
......
...@@ -225,6 +225,11 @@ public: ...@@ -225,6 +225,11 @@ public:
return p.mult(corr); return p.mult(corr);
} }
/** \brief The exponential map from a given point $p \in SO(3)$. */
static Rotation<3,T> exp(const Rotation<3,T>& p, const EmbeddedTangentVector& v) {
DUNE_THROW(Dune::NotImplemented, "exp... EmbeddedTangentVector");
}
static Dune::FieldMatrix<T,4,3> Dexp(const Dune::FieldVector<T,3>& v) { static Dune::FieldMatrix<T,4,3> Dexp(const Dune::FieldVector<T,3>& v) {
Dune::FieldMatrix<T,4,3> result(0); Dune::FieldMatrix<T,4,3> result(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment