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
Humanoid Path Planner
hpp-model-urdf
Commits
369e2ac8
Commit
369e2ac8
authored
Sep 27, 2014
by
Florent Lamiraux
Browse files
Use JointTranslation of dimension 2 and 3 for planar and freeflyer root.
parent
e2c0405b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/urdf/parser.cc
View file @
369e2ac8
...
...
@@ -828,60 +828,24 @@ namespace hpp
{
JointPtr_t
joint
,
parent
;
const
fcl
::
Vec3f
T
=
mat
.
getTranslation
();
std
::
string
jointName
=
name
+
"_x"
;
std
::
string
jointName
=
name
+
"_x
yz
"
;
if
(
jointsMap_
.
find
(
jointName
)
!=
jointsMap_
.
end
())
{
throw
std
::
runtime_error
(
std
::
string
(
"Duplicated joint "
)
+
jointName
);
}
// Translation along x
fcl
::
Matrix3f
permutation
;
joint
=
objectFactory_
.
createJointTranslation
(
mat
);
joint
=
objectFactory_
.
createJointTranslation3
(
mat
);
joint
->
name
(
jointName
);
jointsMap_
[
jointName
]
=
joint
;
joint
->
lowerBound
(
0
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
0
,
+
numeric_limits
<
double
>::
infinity
());
joint
->
lowerBound
(
1
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
1
,
+
numeric_limits
<
double
>::
infinity
());
joint
->
lowerBound
(
2
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
2
,
+
numeric_limits
<
double
>::
infinity
());
if
(
robot
)
robot
->
rootJoint
(
joint
);
parent
=
joint
;
// Translation along y
permutation
(
0
,
0
)
=
0
;
permutation
(
0
,
1
)
=
-
1
;
permutation
(
0
,
2
)
=
0
;
permutation
(
1
,
0
)
=
1
;
permutation
(
1
,
1
)
=
0
;
permutation
(
1
,
2
)
=
0
;
permutation
(
2
,
0
)
=
0
;
permutation
(
2
,
1
)
=
0
;
permutation
(
2
,
2
)
=
1
;
fcl
::
Transform3f
pos
;
pos
.
setRotation
(
permutation
*
mat
.
getRotation
());
pos
.
setTranslation
(
T
);
joint
=
objectFactory_
.
createJointTranslation
(
pos
);
jointName
=
name
+
"_y"
;
if
(
jointsMap_
.
find
(
jointName
)
!=
jointsMap_
.
end
())
{
throw
std
::
runtime_error
(
std
::
string
(
"Duplicated joint "
)
+
jointName
);
}
joint
->
name
(
jointName
);
jointsMap_
[
jointName
]
=
joint
;
joint
->
lowerBound
(
0
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
0
,
+
numeric_limits
<
double
>::
infinity
());
parent
->
addChildJoint
(
joint
);
parent
=
joint
;
// Translation along z
permutation
(
0
,
0
)
=
0
;
permutation
(
0
,
1
)
=
0
;
permutation
(
0
,
2
)
=
-
1
;
permutation
(
1
,
0
)
=
0
;
permutation
(
1
,
1
)
=
1
;
permutation
(
1
,
2
)
=
0
;
permutation
(
2
,
0
)
=
1
;
permutation
(
2
,
1
)
=
0
;
permutation
(
2
,
2
)
=
0
;
pos
.
setRotation
(
permutation
*
mat
.
getRotation
());
pos
.
setTranslation
(
T
);
joint
=
objectFactory_
.
createJointTranslation
(
pos
);
jointName
=
name
+
"_z"
;
if
(
jointsMap_
.
find
(
jointName
)
!=
jointsMap_
.
end
())
{
throw
std
::
runtime_error
(
std
::
string
(
"Duplicated joint "
)
+
jointName
);
}
joint
->
name
(
jointName
);
jointsMap_
[
jointName
]
=
joint
;
joint
->
lowerBound
(
0
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
0
,
+
numeric_limits
<
double
>::
infinity
());
parent
->
addChildJoint
(
joint
);
parent
=
joint
;
// joint SO3
joint
=
objectFactory_
.
createJointSO3
(
mat
);
jointName
=
name
+
"_SO3"
;
...
...
@@ -901,46 +865,28 @@ namespace hpp
{
JointPtr_t
joint
,
parent
;
const
fcl
::
Vec3f
T
=
mat
.
getTranslation
();
std
::
string
jointName
=
name
+
"_x"
;
std
::
string
jointName
=
name
+
"_x
y
"
;
if
(
jointsMap_
.
find
(
jointName
)
!=
jointsMap_
.
end
())
{
throw
std
::
runtime_error
(
std
::
string
(
"Duplicated joint "
)
+
jointName
);
}
// Translation along x
fcl
::
Matrix3f
permutation
;
joint
=
objectFactory_
.
createJointTranslation
(
mat
);
joint
=
objectFactory_
.
createJointTranslation
2
(
mat
);
joint
->
name
(
jointName
);
jointsMap_
[
jointName
]
=
joint
;
joint
->
lowerBound
(
0
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
0
,
+
numeric_limits
<
double
>::
infinity
());
joint
->
lowerBound
(
1
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
1
,
+
numeric_limits
<
double
>::
infinity
());
if
(
robot
)
robot
->
rootJoint
(
joint
);
parent
=
joint
;
// Translation along y
permutation
(
0
,
0
)
=
0
;
permutation
(
0
,
1
)
=
-
1
;
permutation
(
0
,
2
)
=
0
;
permutation
(
1
,
0
)
=
1
;
permutation
(
1
,
1
)
=
0
;
permutation
(
1
,
2
)
=
0
;
permutation
(
2
,
0
)
=
0
;
permutation
(
2
,
1
)
=
0
;
permutation
(
2
,
2
)
=
1
;
fcl
::
Transform3f
pos
;
pos
.
setRotation
(
permutation
*
mat
.
getRotation
());
pos
.
setTranslation
(
T
);
joint
=
objectFactory_
.
createJointTranslation
(
pos
);
jointName
=
name
+
"_y"
;
if
(
jointsMap_
.
find
(
jointName
)
!=
jointsMap_
.
end
())
{
throw
std
::
runtime_error
(
std
::
string
(
"Duplicated joint "
)
+
jointName
);
}
joint
->
name
(
jointName
);
jointsMap_
[
jointName
]
=
joint
;
joint
->
lowerBound
(
0
,
-
numeric_limits
<
double
>::
infinity
());
joint
->
upperBound
(
0
,
+
numeric_limits
<
double
>::
infinity
());
parent
->
addChildJoint
(
joint
);
parent
=
joint
;
// Rotation along z
permutation
(
0
,
0
)
=
0
;
permutation
(
0
,
1
)
=
0
;
permutation
(
0
,
2
)
=
-
1
;
permutation
(
1
,
0
)
=
0
;
permutation
(
1
,
1
)
=
1
;
permutation
(
1
,
2
)
=
0
;
permutation
(
2
,
0
)
=
1
;
permutation
(
2
,
1
)
=
0
;
permutation
(
2
,
2
)
=
0
;
fcl
::
Transform3f
pos
;
pos
.
setRotation
(
permutation
*
mat
.
getRotation
());
pos
.
setTranslation
(
T
);
joint
=
objectFactory_
.
createJointRotation
(
pos
);
...
...
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