Skip to content

Commit ca802b8

Browse files
Revert "Fix usage of explicit instantiation"
This reverts commit 362af03.
1 parent db79299 commit ca802b8

File tree

3 files changed

+54
-24
lines changed

3 files changed

+54
-24
lines changed

include/sot/core/feature-pose.hh

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
*/
88

9-
#ifndef __SOT_FEATURE_POSE_HH__
10-
#define __SOT_FEATURE_POSE_HH__
9+
#ifndef __SOT_FEATURE_TRANSFORMATION_HH__
10+
#define __SOT_FEATURE_TRANSFORMATION_HH__
1111

1212
/* --------------------------------------------------------------------- */
1313
/* --- INCLUDE --------------------------------------------------------- */
@@ -166,13 +166,36 @@ extern template class SOT_CORE_DLLAPI FeaturePose<SE3Representation>;
166166
extern template class SOT_CORE_DLLAPI FeaturePose<R3xSO3Representation>;
167167
#endif
168168

169+
} /* namespace sot */
170+
} /* namespace dynamicgraph */
171+
172+
173+
using namespace std;
174+
using namespace dynamicgraph;
175+
using namespace dynamicgraph::sot;
176+
177+
typedef pinocchio::CartesianProductOperation<
178+
pinocchio::VectorSpaceOperationTpl<3, double>,
179+
pinocchio::SpecialOrthogonalOperationTpl<3, double> >
180+
R3xSO3_t;
181+
typedef pinocchio::SpecialEuclideanOperationTpl<3, double> SE3_t;
182+
183+
namespace dynamicgraph {
184+
namespace sot {
185+
namespace dg = dynamicgraph;
186+
187+
template <Representation_t representation> struct LG_t {
188+
typedef typename boost::mpl::if_c<representation == SE3Representation, SE3_t,
189+
R3xSO3_t>::type type;
190+
};
191+
169192
typedef FeaturePose<R3xSO3Representation> FeaturePose_t;
170193
typedef FeaturePose<SE3Representation> FeaturePoseSE3_t;
194+
}
195+
}
171196

172-
} /* namespace sot */
173-
} /* namespace dynamicgraph */
174197

175-
#endif // #ifndef __SOT_FEATURE_POSE_HH__
198+
#endif // #ifndef __SOT_FEATURE_TRANSFORMATION_HH__
176199

177200
/*
178201
* Local variables:

include/sot/core/feature-pose.hxx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,7 @@
2929

3030
namespace dynamicgraph {
3131
namespace sot {
32-
33-
typedef pinocchio::CartesianProductOperation<
34-
pinocchio::VectorSpaceOperationTpl<3, double>,
35-
pinocchio::SpecialOrthogonalOperationTpl<3, double> >
36-
R3xSO3_t;
37-
typedef pinocchio::SpecialEuclideanOperationTpl<3, double> SE3_t;
38-
39-
namespace internal {
40-
template <Representation_t representation> struct LG_t {
41-
typedef typename boost::mpl::if_c<representation == SE3Representation, SE3_t,
42-
R3xSO3_t>::type type;
43-
};
44-
}
32+
namespace dg = dynamicgraph;
4533

4634
/* --------------------------------------------------------------------- */
4735
/* --- CLASS ----------------------------------------------------------- */
@@ -154,7 +142,7 @@ Vector7 toVector(const MatrixHomogeneous &M) {
154142

155143
template <Representation_t representation>
156144
Matrix &FeaturePose<representation>::computeJacobian(Matrix &J, int time) {
157-
typedef typename internal::LG_t<representation>::type LieGroup_t;
145+
typedef typename LG_t<representation>::type LieGroup_t;
158146

159147
check(*this);
160148

@@ -239,7 +227,7 @@ Vector7 &FeaturePose<representation>::computeQfaMfbDes(Vector7 &res, int time) {
239227

240228
template <Representation_t representation>
241229
Vector &FeaturePose<representation>::computeError(Vector &error, int time) {
242-
typedef typename internal::LG_t<representation>::type LieGroup_t;
230+
typedef typename LG_t<representation>::type LieGroup_t;
243231
check(*this);
244232

245233
const Flags &fl = selectionSIN(time);
@@ -259,7 +247,7 @@ Vector &FeaturePose<representation>::computeError(Vector &error, int time) {
259247
// This function is responsible of converting the input velocity expressed with
260248
// SE(3) convention onto a velocity expressed with the convention of this
261249
// feature (R^3xSO(3) or SE(3)), in the right frame.
262-
template <typename internal::LG_t>
250+
template <typename LG_t>
263251
Vector6d convertVelocity(const MatrixHomogeneous &M,
264252
const MatrixHomogeneous &Mdes,
265253
const Vector &faNufafbDes) {
@@ -282,7 +270,7 @@ Vector6d convertVelocity<R3xSO3_t>(const MatrixHomogeneous &M,
282270
template <Representation_t representation>
283271
Vector &FeaturePose<representation>::computeErrorDot(Vector &errordot,
284272
int time) {
285-
typedef typename internal::LG_t<representation>::type LieGroup_t;
273+
typedef typename LG_t<representation>::type LieGroup_t;
286274
check(*this);
287275

288276
errordot.resize(dimensionSOUT(time));

src/feature/feature-pose.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,36 @@
2525

2626
#include <Eigen/LU>
2727

28+
#include <sot/core/debug.hh>
2829
#include <sot/core/factory.hh>
2930
#include <sot/core/feature-pose.hh>
3031
#include <sot/core/feature-pose.hxx>
3132

33+
using namespace std;
34+
using namespace dynamicgraph;
3235
using namespace dynamicgraph::sot;
3336

37+
typedef pinocchio::CartesianProductOperation<
38+
pinocchio::VectorSpaceOperationTpl<3, double>,
39+
pinocchio::SpecialOrthogonalOperationTpl<3, double> >
40+
R3xSO3_t;
41+
typedef pinocchio::SpecialEuclideanOperationTpl<3, double> SE3_t;
42+
43+
template <Representation_t representation> struct LG_t {
44+
typedef typename boost::mpl::if_c<representation == SE3Representation, SE3_t,
45+
R3xSO3_t>::type type;
46+
};
47+
48+
3449
typedef FeaturePose<R3xSO3Representation> FeaturePose_t;
3550
typedef FeaturePose<SE3Representation> FeaturePoseSE3_t;
3651
template <> DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePose_t, "FeaturePose");
3752
template <>
3853
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePoseSE3_t, "FeaturePoseSE3");
3954

40-
template class FeaturePose<R3xSO3Representation>;
41-
template class FeaturePose<SE3Representation>;
55+
/* --------------------------------------------------------------------- */
56+
/* --- CLASS ----------------------------------------------------------- */
57+
/* --------------------------------------------------------------------- */
58+
59+
static const MatrixHomogeneous Id(MatrixHomogeneous::Identity());
60+

0 commit comments

Comments
 (0)