Skip to content

Commit 9543eec

Browse files
jmirabelolivier-stasse
authored andcommitted
Fix usage of explicit instantiation
1 parent 6d3e0de commit 9543eec

File tree

3 files changed

+24
-54
lines changed

3 files changed

+24
-54
lines changed

include/sot/core/feature-pose.hh

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

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

1212
/* --------------------------------------------------------------------- */
1313
/* --- INCLUDE --------------------------------------------------------- */
@@ -166,36 +166,13 @@ 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-
192169
typedef FeaturePose<R3xSO3Representation> FeaturePose_t;
193170
typedef FeaturePose<SE3Representation> FeaturePoseSE3_t;
194-
}
195-
}
196171

172+
} /* namespace sot */
173+
} /* namespace dynamicgraph */
197174

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

200177
/*
201178
* Local variables:

include/sot/core/feature-pose.hxx

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

3030
namespace dynamicgraph {
3131
namespace sot {
32-
namespace dg = dynamicgraph;
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+
}
3345

3446
/* --------------------------------------------------------------------- */
3547
/* --- CLASS ----------------------------------------------------------- */
@@ -142,7 +154,7 @@ Vector7 toVector(const MatrixHomogeneous &M) {
142154

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

147159
check(*this);
148160

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

228240
template <Representation_t representation>
229241
Vector &FeaturePose<representation>::computeError(Vector &error, int time) {
230-
typedef typename LG_t<representation>::type LieGroup_t;
242+
typedef typename internal::LG_t<representation>::type LieGroup_t;
231243
check(*this);
232244

233245
const Flags &fl = selectionSIN(time);
@@ -247,7 +259,7 @@ Vector &FeaturePose<representation>::computeError(Vector &error, int time) {
247259
// This function is responsible of converting the input velocity expressed with
248260
// SE(3) convention onto a velocity expressed with the convention of this
249261
// feature (R^3xSO(3) or SE(3)), in the right frame.
250-
template <typename LG_t>
262+
template <typename internal::LG_t>
251263
Vector6d convertVelocity(const MatrixHomogeneous &M,
252264
const MatrixHomogeneous &Mdes,
253265
const Vector &faNufafbDes) {
@@ -270,7 +282,7 @@ Vector6d convertVelocity<R3xSO3_t>(const MatrixHomogeneous &M,
270282
template <Representation_t representation>
271283
Vector &FeaturePose<representation>::computeErrorDot(Vector &errordot,
272284
int time) {
273-
typedef typename LG_t<representation>::type LieGroup_t;
285+
typedef typename internal::LG_t<representation>::type LieGroup_t;
274286
check(*this);
275287

276288
errordot.resize(dimensionSOUT(time));

src/feature/feature-pose.cpp

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

2626
#include <Eigen/LU>
2727

28-
#include <sot/core/debug.hh>
2928
#include <sot/core/factory.hh>
3029
#include <sot/core/feature-pose.hh>
3130
#include <sot/core/feature-pose.hxx>
3231

33-
using namespace std;
34-
using namespace dynamicgraph;
3532
using namespace dynamicgraph::sot;
3633

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-
4934
typedef FeaturePose<R3xSO3Representation> FeaturePose_t;
5035
typedef FeaturePose<SE3Representation> FeaturePoseSE3_t;
5136
template <> DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePose_t, "FeaturePose");
5237
template <>
5338
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePoseSE3_t, "FeaturePoseSE3");
5439

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

0 commit comments

Comments
 (0)