Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
pinocchio
Commits
5d641655
Commit
5d641655
authored
Sep 26, 2016
by
jcarpent
Browse files
[Model] Remove default name for joint
parent
d07b6f69
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/multibody/model.hpp
View file @
5d641655
...
...
@@ -158,11 +158,11 @@ namespace se3
///
template
<
typename
JointModelDerived
>
JointIndex
addJoint
(
const
JointIndex
parent
,
const
JointModelBase
<
JointModelDerived
>
&
joint_model
,
const
SE3
&
joint_placement
,
const
std
::
string
&
joint_name
,
const
Eigen
::
VectorXd
&
max_effort
,
const
Eigen
::
VectorXd
&
max_velocity
,
const
Eigen
::
VectorXd
&
min_config
,
const
Eigen
::
VectorXd
&
max_config
,
const
std
::
string
&
joint_name
=
""
const
Eigen
::
VectorXd
&
max_config
);
///
...
...
@@ -184,7 +184,7 @@ namespace se3
///
template
<
typename
JointModelDerived
>
JointIndex
addJoint
(
const
JointIndex
parent
,
const
JointModelBase
<
JointModelDerived
>
&
joint_model
,
const
SE3
&
joint_placement
,
const
std
::
string
&
joint_name
=
""
const
std
::
string
&
joint_name
);
///
...
...
src/multibody/model.hxx
View file @
5d641655
...
...
@@ -56,11 +56,11 @@ namespace se3
Model
::
JointIndex
Model
::
addJoint
(
const
Model
::
JointIndex
parent
,
const
JointModelBase
<
JointModelDerived
>
&
joint_model
,
const
SE3
&
joint_placement
,
const
std
::
string
&
joint_name
,
const
Eigen
::
VectorXd
&
max_effort
,
const
Eigen
::
VectorXd
&
max_velocity
,
const
Eigen
::
VectorXd
&
min_config
,
const
Eigen
::
VectorXd
&
max_config
,
const
std
::
string
&
joint_name
const
Eigen
::
VectorXd
&
max_config
)
{
assert
(
(
njoints
==
(
int
)
joints
.
size
())
&&
(
njoints
==
(
int
)
inertias
.
size
())
...
...
@@ -80,7 +80,7 @@ namespace se3
inertias
.
push_back
(
Inertia
::
Zero
());
parents
.
push_back
(
parent
);
jointPlacements
.
push_back
(
joint_placement
);
names
.
push_back
(
(
joint_name
!=
""
)
?
joint_name
:
randomStringGenerator
(
8
)
);
names
.
push_back
(
joint_name
);
nq
+=
joint_model
.
nq
();
nv
+=
joint_model
.
nv
();
...
...
@@ -116,7 +116,7 @@ namespace se3
min_config
=
Eigen
::
VectorXd
::
Constant
(
joint_model
.
nq
(),
std
::
numeric_limits
<
double
>::
max
());
max_config
=
Eigen
::
VectorXd
::
Constant
(
joint_model
.
nq
(),
std
::
numeric_limits
<
double
>::
max
());
return
addJoint
(
parent
,
joint_model
,
joint_placement
,
max_effort
,
max_velocity
,
min_config
,
max_config
,
joint_name
);
return
addJoint
(
parent
,
joint_model
,
joint_placement
,
joint_name
,
max_effort
,
max_velocity
,
min_config
,
max_config
);
}
inline
int
Model
::
addJointFrame
(
const
JointIndex
&
jidx
,
...
...
src/parsers/sample-models.cpp
View file @
5d641655
...
...
@@ -41,11 +41,12 @@ namespace se3
if
(
setRandomLimits
)
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
SE3
::
Random
(),
name
+
"_joint"
,
TV
::
Random
()
+
TV
::
Constant
(
1
),
TV
::
Random
()
+
TV
::
Constant
(
1
),
CV
::
Random
()
-
CV
::
Constant
(
1
),
CV
::
Random
()
+
CV
::
Constant
(
1
)
,
name
+
"_joint"
);
CV
::
Random
()
+
CV
::
Constant
(
1
)
);
else
idx
=
model
.
addJoint
(
model
.
getJointId
(
parent_name
),
joint
,
placement
,
name
+
"_joint"
);
...
...
src/parsers/urdf/model.cpp
View file @
5d641655
...
...
@@ -99,8 +99,9 @@ namespace se3
idx
=
model
.
addJoint
(
frame
.
parent
,
jmodel
,
frame
.
placement
*
joint_placement
,
max_effort
,
max_velocity
,
min_config
,
max_config
,
joint_name
);
joint_name
,
max_effort
,
max_velocity
,
min_config
,
max_config
);
FrameIndex
jointFrameId
=
(
FrameIndex
)
model
.
addJointFrame
(
idx
,
(
int
)
parentFrameId
);
// C-style cast to remove polluting compilation warning. This is Bad practice. See issue #323 (rework indexes)
appendBodyToJoint
(
model
,
jointFrameId
,
Y
,
SE3
::
Identity
(),
body_name
);
}
...
...
unittest/joint-configurations.cpp
View file @
5d641655
...
...
@@ -48,11 +48,11 @@ void addJointAndBody(Model & model, const JointModelBase<D> & jmodel, const Mode
typedef
typename
D
::
ConfigVector_t
CV
;
idx
=
model
.
addJoint
(
parent_id
,
jmodel
,
joint_placement
,
name
+
"_joint"
,
TV
::
Zero
(),
1e3
*
(
TV
::
Random
()
+
TV
::
Constant
(
1
)),
1e3
*
(
CV
::
Random
()
-
CV
::
Constant
(
1
)),
1e3
*
(
CV
::
Random
()
+
CV
::
Constant
(
1
)),
name
+
"_joint"
1e3
*
(
CV
::
Random
()
+
CV
::
Constant
(
1
))
);
model
.
appendBodyToJoint
(
idx
,
Y
,
SE3
::
Identity
());
...
...
unittest/visitor.cpp
View file @
5d641655
...
...
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE ( test_runal )
using
namespace
se3
;
se3
::
Model
model
;
model
.
addJoint
(
0
,
se3
::
JointModelRevoluteUnaligned
(
0
,
0
,
1
),
se3
::
SE3
::
Random
());
model
.
addJoint
(
0
,
se3
::
JointModelRevoluteUnaligned
(
0
,
0
,
1
),
se3
::
SE3
::
Random
()
,
""
);
Data
data
(
model
);
for
(
Model
::
JointIndex
i
=
1
;
i
<
(
Model
::
JointIndex
)
model
.
njoints
;
++
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment