Skip to content

Commit 2307fde

Browse files
lmontautjcarpent
authored andcommitted
Swept-Sphere: fix doxygen xml parser
1 parent d8d8a65 commit 2307fde

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

doc/python/doxygen_xml_parser.py

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ def _templateParamToDict(param):
116116
else:
117117
return {"type": type_.text, "name": ""}
118118
else:
119+
if type_.text is None:
120+
# type_ is not a typename but an existing type
121+
type_ = type_.find("ref")
119122
assert defname.text == declname.text
120123
return {"type": type_.text, "name": defname.text}
121124

include/hpp/fcl/narrowphase/gjk.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ enum SupportOptions {
7171
/// `WithSweptSphere`, the support functions take into account the shapes' swept
7272
/// sphere radii. Please see `MinkowskiDiff::set(const ShapeBase*, const
7373
/// ShapeBase*)` for more details.
74-
template <int SupportOptions>
74+
template <int _SupportOptions = SupportOptions::NoSweptSphere>
7575
Vec3f getSupport(const ShapeBase* shape, const Vec3f& dir, int& hint);
7676

7777
/// @brief Minkowski difference class of two shapes
@@ -143,7 +143,7 @@ struct HPP_FCL_DLLAPI MinkowskiDiff {
143143
/// involved in the collision, and not relying on GJK/EPA, the
144144
/// `SupportOptions` template parameter should be set to `WithSweptSphere`.
145145
/// This is for example the case for specialized collision/distance functions.
146-
template <int SupportOptions>
146+
template <int _SupportOptions = SupportOptions::NoSweptSphere>
147147
void set(const ShapeBase* shape0, const ShapeBase* shape1);
148148

149149
/// @brief Set the two shapes, with a relative transformation.
@@ -153,7 +153,7 @@ struct HPP_FCL_DLLAPI MinkowskiDiff {
153153
/// @param tf1 the transformation of the second shape.
154154
/// @tparam `SupportOptions` see `set(const ShapeBase*, const
155155
/// ShapeBase*)` for more details.
156-
template <int SupportOptions>
156+
template <int _SupportOptions = SupportOptions::NoSweptSphere>
157157
void set(const ShapeBase* shape0, const ShapeBase* shape1,
158158
const Transform3f& tf0, const Transform3f& tf1);
159159

@@ -164,9 +164,9 @@ struct HPP_FCL_DLLAPI MinkowskiDiff {
164164
/// object.
165165
/// @tparam `SupportOptions` see `set(const ShapeBase*, const
166166
/// ShapeBase*)` for more details.
167-
template <int SupportOptions>
167+
template <int _SupportOptions = SupportOptions::NoSweptSphere>
168168
inline Vec3f support0(const Vec3f& dir, int& hint) const {
169-
return getSupport<SupportOptions>(shapes[0], dir, hint);
169+
return getSupport<_SupportOptions>(shapes[0], dir, hint);
170170
}
171171

172172
/// @brief support function for shape1.
@@ -176,10 +176,10 @@ struct HPP_FCL_DLLAPI MinkowskiDiff {
176176
/// object.
177177
/// @tparam `SupportOptions` see `set(const ShapeBase*, const
178178
/// ShapeBase*)` for more details.
179-
template <int SupportOptions>
179+
template <int _SupportOptions = SupportOptions::NoSweptSphere>
180180
inline Vec3f support1(const Vec3f& dir, int& hint) const {
181181
// clang-format off
182-
return oR1 * getSupport<SupportOptions>(shapes[1], oR1.transpose() * dir, hint) + ot1;
182+
return oR1 * getSupport<_SupportOptions>(shapes[1], oR1.transpose() * dir, hint) + ot1;
183183
// clang-format on
184184
}
185185

python/gjk.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void exposeGJK() {
115115
&MinkowskiDiffWrapper::set),
116116
doxygen::member_func_doc(static_cast<void (MinkowskiDiff::*)(
117117
const ShapeBase*, const ShapeBase*)>(
118-
&MinkowskiDiff::set<false>)))
118+
&MinkowskiDiff::set<SupportOptions::NoSweptSphere>)))
119119

120120
.def("set",
121121
static_cast<void (*)(MinkowskiDiff&, const ShapeBase*,
@@ -127,12 +127,15 @@ void exposeGJK() {
127127
const ShapeBase*, const ShapeBase*, const Transform3f&,
128128
const Transform3f&)>(
129129
&MinkowskiDiff::set<SupportOptions::NoSweptSphere>)))
130+
130131
.def("support0", &MinkowskiDiffWrapper::support0,
131132
doxygen::member_func_doc(
132133
&MinkowskiDiff::support0<SupportOptions::NoSweptSphere>))
134+
133135
.def("support1", &MinkowskiDiffWrapper::support1,
134136
doxygen::member_func_doc(
135137
&MinkowskiDiff::support1<SupportOptions::NoSweptSphere>))
138+
136139
.def("support", &MinkowskiDiff::support,
137140
doxygen::member_func_doc(&MinkowskiDiff::support))
138141

0 commit comments

Comments
 (0)