Skip to content

Commit b76dd95

Browse files
committed
--Reviewer suggestions - missed
1 parent a1bcfc7 commit b76dd95

File tree

6 files changed

+64
-48
lines changed

6 files changed

+64
-48
lines changed

src/esp/bindings/AttributesBindings.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,11 @@ void initAttributesBindings(py::module& m) {
261261
"markerset_name"_a)
262262
.def("get_all_markerset_names", &LinkSet::getAllMarkerSetNames,
263263
R"(Get a list of all the MarkerSet names within this LinkSet)")
264-
.def("get_markerset", &LinkSet::editMarkerSet,
265-
R"(Get an editable reference to the specified MarkerSet, possibly
264+
.def(
265+
"get_markerset", &LinkSet::editMarkerSet,
266+
R"(Get an editable reference to the specified MarkerSet, possibly new and
266267
empty if it does not exist)",
267-
"markerset_name"_a)
268+
"markerset_name"_a)
268269
.def("set_markerset_points", &LinkSet::setMarkerSetPoints,
269270
R"(Sets the marker points for the specified MarkerSet)",
270271
"markerset_name"_a, "marker_list"_a)
@@ -294,16 +295,18 @@ void initAttributesBindings(py::module& m) {
294295
"has_link_markerset", &TaskSet::hasLinkMarkerSet,
295296
R"(Whether or not this TaskSet has a MarkerSet within a LinkSet with the given names)",
296297
"linkset_name"_a, "markerset_dict"_a)
297-
.def("init_link_markerset", &TaskSet::initLinkMarkerSet,
298-
R"(Initialize a MarkerSet within a LinkSet with the given names in
299-
this TaskSet)",
300-
"linkset_name"_a, "markerset_dict"_a)
298+
.def(
299+
"init_link_markerset", &TaskSet::initLinkMarkerSet,
300+
R"(Initialize a MarkerSet within a LinkSet within this TaskSet from a dict
301+
mapping markerset names to lists of points.)",
302+
"linkset_name"_a, "markerset_dict"_a)
301303
.def("get_all_linkset_names", &TaskSet::getAllLinkSetNames,
302304
R"(Get a list of all the LinkSet names within this TaskSet)")
303-
.def("get_linkset", &TaskSet::editLinkSet,
304-
R"(Get an editable reference to the specified LinkSet, possibly
305+
.def(
306+
"get_linkset", &TaskSet::editLinkSet,
307+
R"(Get an editable reference to the specified LinkSet, possibly new and
305308
empty if it does not exist)",
306-
"linkset_name"_a)
309+
"linkset_name"_a)
307310
.def(
308311
"set_linkset_points", &TaskSet::setLinkSetPoints,
309312
R"(Set the marker points in each of the MarkerSets for the specified LinkSet
@@ -359,10 +362,11 @@ void initAttributesBindings(py::module& m) {
359362
"taskset_name"_a, "linkset_name"_a, "markerset_name"_a)
360363
.def("get_all_taskset_names", &MarkerSets::getAllTaskSetNames,
361364
R"(Get a list of all the existing TaskSet names)")
362-
.def("get_taskset", &MarkerSets::editTaskSet,
363-
R"(Get an editable reference to the specified TaskSet, possibly
365+
.def(
366+
"get_taskset", &MarkerSets::editTaskSet,
367+
R"(Get an editable reference to the specified TaskSet, possibly new and
364368
empty if it does not exist)",
365-
"taskset_name"_a)
369+
"taskset_name"_a)
366370
.def(
367371
"set_taskset_points", &MarkerSets::setTaskSetPoints,
368372
R"(Set all the marker points in the specified TaskSet to the 3d point values in the

src/esp/bindings/PhysicsObjectBindings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void declareBasePhysicsObjectWrapper(py::module& m,
7979
R"(Given the list of passed points in this object's local space, return
8080
those points transformed to world space. The link_id is for articulated
8181
objects and is ignored for rigid objects and stages )",
82-
"ws_points"_a, "link_id"_a)
82+
"ls_points"_a, "link_id"_a)
8383
.def_property(
8484
"rotation", &PhysObjWrapper::getRotation,
8585
&PhysObjWrapper::setRotation,
@@ -367,7 +367,7 @@ void declareRigidObjectWrapper(py::module& m,
367367
("Get a copy of the template attributes describing the initial state "
368368
"of this " +
369369
objType +
370-
". These attributes have the combination of date from the "
370+
". These attributes have the combination of data from the "
371371
"original " +
372372
objType +
373373
" attributes and specific instance attributes "
@@ -401,7 +401,7 @@ void declareArticulatedObjectWrapper(py::module& m,
401401
("Get a copy of the template attributes describing the initial state "
402402
"of this " +
403403
objType +
404-
". These attributes have the combination of date from the "
404+
". These attributes have the combination of data from the "
405405
"original " +
406406
objType +
407407
" attributes and specific instance attributes "

src/esp/metadata/URDFParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ bool Parser::validateMeshFile(std::string& meshFilename) {
838838

839839
bool Parser::initTreeAndRoot(const std::shared_ptr<Model>& model) const {
840840
// every link has children links and joints, but no parents, so we create a
841-
// local convenience data structure for keeping child->parent relations
841+
// convenience data structure in the model for keeping child->parent relations
842842
model->m_parentLinkTree.clear();
843843

844844
// loop through all joints, for every link, assign children links and children

src/esp/metadata/attributes/MarkerSets.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class MarkerSet : public esp::core::config::Configuration {
7171

7272
/**
7373
* @brief This class provides an alias for the nested Configuration tree used
74-
* for a single link's 1 or more NarkerSets that should be attached to the
74+
* for a single link's 1 or more MarkerSets that should be attached to the
7575
* named link.
7676
*/
7777
class LinkSet : public esp::core::config::Configuration {
@@ -111,7 +111,7 @@ class LinkSet : public esp::core::config::Configuration {
111111
}
112112

113113
/**
114-
* @brief Retrieve a view of the naamed MarkerSet, if it exists, and
114+
* @brief Retrieve a view of the named MarkerSet, if it exists, and
115115
* nullptr if it does not.
116116
*/
117117
MarkerSet::cptr getMarkerSetView(const std::string& markerSetName) const {
@@ -276,7 +276,7 @@ class TaskSet : public esp::core::config::Configuration {
276276
}
277277

278278
/**
279-
* @brief Retrieve a view of the naamed LinkSet, if it exists, and
279+
* @brief Retrieve a view of the named LinkSet, if it exists, and
280280
* nullptr if it does not.
281281
*/
282282
LinkSet::cptr getLinkSetView(const std::string& linkSetName) const {
@@ -523,7 +523,7 @@ class MarkerSets : public esp::core::config::Configuration {
523523
}
524524

525525
/**
526-
* @brief Retrieve a view of the naamed TaskSet, if it exists, and
526+
* @brief Retrieve a view of the named TaskSet, if it exists, and
527527
* nullptr if it does not.
528528
*/
529529
TaskSet::cptr getTaskSetView(const std::string& taskSetName) const {

src/esp/physics/ArticulatedObject.h

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,10 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
331331
return baseLink_->node();
332332
}
333333
auto linkIter = links_.find(linkId);
334-
CORRADE_INTERNAL_ASSERT(linkIter != links_.end());
334+
ESP_CHECK(
335+
linkIter != links_.end(),
336+
"ArticulatedObject::getLinkSceneNode - no link found with linkId ="
337+
<< linkId);
335338
return linkIter->second->node();
336339
}
337340

@@ -347,7 +350,10 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
347350
return baseLink_->visualNodes_;
348351
}
349352
auto linkIter = links_.find(linkId);
350-
CORRADE_INTERNAL_ASSERT(linkIter != links_.end());
353+
ESP_CHECK(linkIter != links_.end(),
354+
"ArticulatedObject::getLinkVisualSceneNodes - no link found with "
355+
"linkId ="
356+
<< linkId);
351357
return linkIter->second->visualNodes_;
352358
}
353359

@@ -403,7 +409,8 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
403409
}
404410

405411
auto linkIter = links_.find(id);
406-
CORRADE_INTERNAL_ASSERT(linkIter != links_.end());
412+
ESP_CHECK(linkIter != links_.end(),
413+
"ArticulatedObject::getLink - no link found with linkId =" << id);
407414
return *linkIter->second;
408415
}
409416

@@ -448,7 +455,9 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
448455
*/
449456
int getLinkIdFromName(const std::string& _name) const {
450457
auto linkIdIter = linkNamesToIDs_.find(_name);
451-
CORRADE_INTERNAL_ASSERT(linkIdIter != linkNamesToIDs_.end());
458+
ESP_CHECK(linkIdIter != linkNamesToIDs_.end(),
459+
"ArticulatedObject::getLinkIdFromName - no link found with name ="
460+
<< _name);
452461
return linkIdIter->second;
453462
}
454463

@@ -465,34 +474,36 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
465474
* @brief Given the list of passed points in this object's local space, return
466475
* those points transformed to world space.
467476
* @param points vector of points in object local space
468-
* @param linkID Unused for rigids.
477+
* @param linkId Internal link index.
469478
* @return vector of points transformed into world space
470479
*/
471480
std::vector<Mn::Vector3> transformLocalPointsToWorld(
472481
const std::vector<Mn::Vector3>& points,
473-
int linkID) const override {
474-
auto linkIter = links_.find(linkID);
475-
if (linkIter != links_.end()) {
476-
return linkIter->second->transformLocalPointsToWorld(points, linkID);
477-
}
478-
return points;
482+
int linkId) const override {
483+
auto linkIter = links_.find(linkId);
484+
ESP_CHECK(linkIter != links_.end(),
485+
"ArticulatedObject::getLinkVisualSceneNodes - no link found with "
486+
"linkId ="
487+
<< linkId);
488+
return linkIter->second->transformLocalPointsToWorld(points, linkId);
479489
}
480490

481491
/**
482492
* @brief Given the list of passed points in world space, return
483493
* those points transformed to this object's local space.
484494
* @param points vector of points in world space
485-
* @param linkID Unused for rigids.
495+
* @param linkId Internal link index.
486496
* @return vector of points transformed to be in local space
487497
*/
488498
std::vector<Mn::Vector3> transformWorldPointsToLocal(
489499
const std::vector<Mn::Vector3>& points,
490-
int linkID) const override {
491-
auto linkIter = links_.find(linkID);
492-
if (linkIter != links_.end()) {
493-
return linkIter->second->transformWorldPointsToLocal(points, linkID);
494-
}
495-
return points;
500+
int linkId) const override {
501+
auto linkIter = links_.find(linkId);
502+
ESP_CHECK(linkIter != links_.end(),
503+
"ArticulatedObject::getLinkVisualSceneNodes - no link found with "
504+
"linkId ="
505+
<< linkId);
506+
return linkIter->second->transformWorldPointsToLocal(points, linkId);
496507
}
497508

498509
/**
@@ -661,11 +672,12 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
661672
* @param linkId The link's index.
662673
* @return The link's parent joint's name.
663674
*/
664-
virtual std::string getLinkJointName(CORRADE_UNUSED int linkId) const {
675+
virtual std::string getLinkJointName(int linkId) const {
665676
auto linkIter = links_.find(linkId);
666-
ESP_CHECK(linkIter != links_.end(),
667-
"ArticulatedObject::getLinkJointName - no link with linkId ="
668-
<< linkId);
677+
ESP_CHECK(
678+
linkIter != links_.end(),
679+
"ArticulatedObject::getLinkJointName - no link found with linkId ="
680+
<< linkId);
669681
return linkIter->second->linkJointName;
670682
}
671683

@@ -675,15 +687,15 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
675687
* @param linkId The link's index. -1 for base link.
676688
* @return The link's name.
677689
*/
678-
virtual std::string getLinkName(CORRADE_UNUSED int linkId) const {
690+
virtual std::string getLinkName(int linkId) const {
679691
if (linkId == -1) {
680692
return baseLink_->linkName;
681693
}
682694

683695
auto linkIter = links_.find(linkId);
684-
ESP_CHECK(
685-
linkIter != links_.end(),
686-
"ArticulatedObject::getLinkName - no link with linkId =" << linkId);
696+
ESP_CHECK(linkIter != links_.end(),
697+
"ArticulatedObject::getLinkName - no link found with linkId ="
698+
<< linkId);
687699
return linkIter->second->linkName;
688700
}
689701

src/esp/physics/PhysicsObjectBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ class PhysicsObjectBase : public Magnum::SceneGraph::AbstractFeature3D {
638638

639639
/**
640640
* @brief Stores a reference to the markersets for this object, held as a
641-
* smart pointer to a MarkerSets construct, which is an alia for
641+
* smart pointer to a MarkerSets construct, which is an alias for
642642
* a @ref esp::core::config::Configuration.
643643
*/
644644
metadata::attributes::MarkerSets::ptr markerSets_ = nullptr;

0 commit comments

Comments
 (0)