Skip to content

Commit be4a836

Browse files
authored
Merge pull request #2284 from florent-lamiraux/devel
Some minor modifications necessary to upgrade HPP
2 parents df3aa95 + 317a9fa commit be4a836

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### Fixed
1010

11+
- Fix `appendModel` build when called with template arguments different than the ones from `context` ([#2284](https://github.com/stack-of-tasks/pinocchio/pull/2284))
12+
- Fix `TransformRevoleTpl::rotation` and `TransformHelicalTpl::rotation` build ([#2284](https://github.com/stack-of-tasks/pinocchio/pull/2284))
1113
- Fix compilation issue for Boost 1.85 ([#2255](https://github.com/stack-of-tasks/pinocchio/pull/2255))
1214
- Fix python bindings of `contactInverseDynamics` ([#2263](https://github.com/stack-of-tasks/pinocchio/pull/2263))
1315
- Deactivate `BUILD_WITH_LIBPYTHON` when building with PyPy ([#2274](https://github.com/stack-of-tasks/pinocchio/pull/2274))

include/pinocchio/algorithm/model.hxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ namespace pinocchio
380380
for (JointIndex joint_idA = 1; joint_idA < modelA.joints.size(); ++joint_idA)
381381
{
382382
const JointIndex joint_id = model.getJointId(modelA.names[joint_idA]);
383-
const JointModel & joint_model = model.joints[joint_id];
384-
const JointModel & joint_modelA = modelA.joints[joint_idA];
383+
const typename Model::JointModel & joint_model = model.joints[joint_id];
384+
const typename Model::JointModel & joint_modelA = modelA.joints[joint_idA];
385385

386386
joint_model.jointConfigSelector(config_vector) =
387387
joint_modelA.jointConfigSelector(config_vectorA);
@@ -409,8 +409,8 @@ namespace pinocchio
409409
for (JointIndex joint_idB = 1; joint_idB < modelB.joints.size(); ++joint_idB)
410410
{
411411
const JointIndex joint_id = model.getJointId(modelB.names[joint_idB]);
412-
const JointModel & joint_model = model.joints[joint_id];
413-
const JointModel & joint_modelB = modelB.joints[joint_idB];
412+
const typename Model::JointModel & joint_model = model.joints[joint_id];
413+
const typename Model::JointModel & joint_modelB = modelB.joints[joint_idB];
414414

415415
joint_model.jointConfigSelector(config_vector) =
416416
joint_modelB.jointConfigSelector(config_vectorB);

include/pinocchio/multibody/joint/joint-helical.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace pinocchio
7979
typedef Matrix3 AngularType;
8080
typedef Matrix3 AngularRef;
8181
typedef Matrix3 ConstAngularRef;
82-
typedef typename Vector3::ConstantReturnType LinearType;
82+
typedef Vector3 LinearType;
8383
typedef typename Vector3::ConstantReturnType LinearRef;
8484
typedef const typename Vector3::ConstantReturnType ConstLinearRef;
8585
typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
@@ -201,7 +201,7 @@ namespace pinocchio
201201
}
202202
AngularType rotation() const
203203
{
204-
AngularType m(AngularType::Identity(3));
204+
AngularType m(AngularType::Identity());
205205
_setRotation(m);
206206
return m;
207207
}

include/pinocchio/multibody/joint/joint-revolute.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ namespace pinocchio
186186
}
187187
AngularType rotation() const
188188
{
189-
AngularType m(AngularType::Identity(3));
189+
AngularType m(AngularType::Identity());
190190
_setRotation(m);
191191
return m;
192192
}

unittest/all-joints.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ struct TestJointModelIsEqual : TestJointModel<TestJointModelIsEqual>
193193
}
194194
};
195195

196+
struct TestJointModelTransform : TestJointModel<TestJointModelTransform>
197+
{
198+
template<typename JointModel>
199+
static void test(const JointModelBase<JointModel> & jmodel)
200+
{
201+
typedef typename JointModel::JointDataDerived JointData;
202+
JointData jdata = jmodel.createData();
203+
Eigen::Matrix<typename JointModel::Scalar, 3, 1> v = jdata.M_accessor().translation();
204+
Eigen::Matrix<typename JointModel::Scalar, 3, 3> R = jdata.M_accessor().rotation();
205+
}
206+
};
207+
196208
BOOST_AUTO_TEST_CASE(isEqual)
197209
{
198210
typedef JointCollectionDefault::JointModelVariant JointModelVariant;
@@ -211,6 +223,14 @@ BOOST_AUTO_TEST_CASE(isEqual)
211223
BOOST_CHECK(jmodel_any != jmodelx);
212224
}
213225

226+
BOOST_AUTO_TEST_CASE(transform)
227+
{
228+
typedef JointCollectionDefault::JointModelVariant JointModelVariant;
229+
boost::mpl::for_each<JointModelVariant::types>(TestJointModelTransform());
230+
231+
TestJointModelTransform()(JointModel());
232+
}
233+
214234
struct TestJointModelCast : TestJointModel<TestJointModelCast>
215235
{
216236
template<typename JointModel>

0 commit comments

Comments
 (0)