Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves potential linking error in python bindings #9820

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions geometry/internal_frame.cc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "drake/geometry/internal_frame.h"

#include "drake/common/never_destroyed.h"

namespace drake {
namespace geometry {
namespace internal {

const FrameId InternalFrame::kWorldFrame{FrameId::get_new_id()};

InternalFrame::InternalFrame() {}

InternalFrame::InternalFrame(SourceId source_id, FrameId frame_id,
Expand All @@ -30,6 +30,11 @@ bool InternalFrame::operator!=(const InternalFrame& other) const {
return !(*this == other);
}

FrameId InternalFrame::world_frame_id() {
static const never_destroyed<FrameId> kWorldFrame{FrameId::get_new_id()};
return kWorldFrame.access();
}

} // namespace internal
} // namespace geometry
} // namespace drake
5 changes: 1 addition & 4 deletions geometry/internal_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class InternalFrame {
instances of SceneGraph. The world frame will eventually have an arbitrary
number of child frames and geometries; but there will always only be one
world frame. */
static FrameId world_frame_id() { return kWorldFrame; }
static FrameId world_frame_id();

/** Reports the reserved frame group for the world frame. */
static int world_frame_group() {
Expand Down Expand Up @@ -198,9 +198,6 @@ class InternalFrame {
// that were hung on geometries that were already rigidly affixed.
// It does *not* include geometries hung on child frames.
std::unordered_set<GeometryId> child_geometries_;

// The frame identifier of the world frame.
static const FrameId kWorldFrame;
};

} // namespace internal
Expand Down