File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -555,19 +555,25 @@ class ArticulatedObject : public esp::physics::PhysicsObjectBase {
555555 for (const auto & linkEntry : taskEntry.second ) {
556556 const std::string linkName = linkEntry.first ;
557557 int linkId = getLinkIdFromName (linkName);
558- auto linkIter = links_.find (linkId);
559- ESP_CHECK (
560- linkIter != links_.end (),
561- " ArticulatedObject::getMarkerPointsGlobal - no link found with "
562- " linkId ="
563- << linkId);
558+ // locally access the unique pointer's payload
559+ const esp::physics::ArticulatedLink* aoLink;
560+ if (linkId == -1 ) {
561+ aoLink = baseLink_.get ();
562+ } else {
563+ auto linkIter = links_.find (linkId);
564+ ESP_CHECK (
565+ linkIter != links_.end (),
566+ " ArticulatedObject::getMarkerPointsGlobal - no link found with "
567+ " linkId ="
568+ << linkId);
569+ aoLink = linkIter->second .get ();
570+ }
564571 std::unordered_map<std::string, std::vector<Mn::Vector3>> perLinkMap;
565572 // for each set in link
566573 for (const auto & markersEntry : linkEntry.second ) {
567574 const std::string markersName = markersEntry.first ;
568575 perLinkMap[markersName] =
569- linkIter->second ->transformLocalPointsToWorld (markersEntry.second ,
570- linkId);
576+ aoLink->transformLocalPointsToWorld (markersEntry.second , linkId);
571577 }
572578 perTaskMap[linkName] = perLinkMap;
573579 }
You can’t perform that action at this time.
0 commit comments