Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
34794fd4
Commit
34794fd4
authored
8 years ago
by
Justin Carpentier
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #358 from jcarpent/devel
Add default value to JointModelBase indexes
parents
94259309
3d124db5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/algorithm/finite-differences.hxx
+2
-1
2 additions, 1 deletion
src/algorithm/finite-differences.hxx
src/multibody/joint/joint-base.hpp
+4
-1
4 additions, 1 deletion
src/multibody/joint/joint-base.hpp
unittest/joint.cpp
+17
-1
17 additions, 1 deletion
unittest/joint.cpp
with
23 additions
and
3 deletions
src/algorithm/finite-differences.hxx
+
2
−
1
View file @
34794fd4
...
...
@@ -50,8 +50,9 @@ namespace se3
{
using
namespace
se3
::
details
;
Eigen
::
VectorXd
fd_increment
(
model
.
nv
);
BOOST_FOREACH
(
const
JointModel
&
jmodel
,
model
.
joints
)
for
(
int
k
=
1
;
k
<
model
.
joints
.
size
();
++
k
)
{
const
JointModel
&
jmodel
=
model
.
joints
[
k
];
FinitDiffEpsVisitor
::
run
(
jmodel
,
FinitDiffEpsVisitor
::
ArgsType
(
fd_increment
));
}
...
...
This diff is collapsed.
Click to expand it.
src/multibody/joint/joint-base.hpp
+
4
−
1
View file @
34794fd4
...
...
@@ -22,6 +22,7 @@
#include
"pinocchio/multibody/fwd.hpp"
#include
<Eigen/Core>
#include
<limits>
namespace
se3
{
...
...
@@ -426,12 +427,14 @@ namespace se3
/// Default constructor: protected.
///
/// Prevent the construction of stand-alone JointModelBase.
inline
JointModelBase
()
{}
// TODO: default value should be set to -1
inline
JointModelBase
()
:
i_id
(
std
::
numeric_limits
<
JointIndex
>::
max
()),
i_q
(
-
1
),
i_v
(
-
1
)
{}
/// Copy constructor: protected.
///
/// Copy of stand-alone JointModelBase are prevented, but can be used from inhereting
/// objects. Copy is done by calling copy operator.
inline
JointModelBase
(
const
JointModelBase
&
clone
)
{
*
this
=
clone
;
}
/// Copy operator: protected.
///
/// Copy of stand-alone JointModelBase are prevented, but can be used from inhereting
...
...
This diff is collapsed.
Click to expand it.
unittest/joint.cpp
+
17
−
1
View file @
34794fd4
...
...
@@ -21,6 +21,8 @@
#include
<boost/test/unit_test.hpp>
#include
<boost/utility/binary.hpp>
using
namespace
se3
;
template
<
typename
T
>
void
test_joint_methods
(
T
&
jmodel
,
typename
T
::
JointDataDerived
&
jdata
)
{
...
...
@@ -127,7 +129,21 @@ BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
BOOST_AUTO_TEST_CASE
(
test_all_joints
)
{
using
namespace
se3
;
boost
::
mpl
::
for_each
<
JointModelVariant
::
types
>
(
TestJoint
());
}
BOOST_AUTO_TEST_CASE
(
test_empty_model
)
{
JointModel
jmodel
;
std
::
cout
<<
"nq "
<<
jmodel
.
nq
()
<<
std
::
endl
;
std
::
cout
<<
"nv "
<<
jmodel
.
nv
()
<<
std
::
endl
;
std
::
cout
<<
"idx_q "
<<
jmodel
.
idx_q
()
<<
std
::
endl
;
std
::
cout
<<
"idx_v "
<<
jmodel
.
idx_v
()
<<
std
::
endl
;
std
::
cout
<<
"id "
<<
jmodel
.
id
()
<<
std
::
endl
;
std
::
cout
<<
"name "
<<
jmodel
.
shortname
()
<<
std
::
endl
;
BOOST_CHECK
(
jmodel
.
idx_q
()
==
-
1
);
BOOST_CHECK
(
jmodel
.
idx_v
()
==
-
1
);
}
BOOST_AUTO_TEST_SUITE_END
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment