forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeometry_frame.h
66 lines (50 loc) · 2.22 KB
/
geometry_frame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#pragma once
#include <string>
#include "drake/common/drake_copyable.h"
#include "drake/geometry/geometry_ids.h"
namespace drake {
namespace geometry {
/** This simple class carries the definition of a frame used in the
SceneGraph. To register moving frames with SceneGraph (see
SceneGraph::RegisterFrame()), a geometry source (see
SceneGraph::RegisterSource()) instantiates a frame and passes ownership
over to SceneGraph.
A frame is defined by two pieces of information:
- the name, which must be unique within a single geometry source and
- the "frame group", an integer identifier that can be used to group frames
together within a geometry source.
@internal The "frame group" is intended as a generic synonym for the model
instance id defined by the RigidBodyTree.
@see SceneGraph */
class GeometryFrame {
public:
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(GeometryFrame)
/** Constructor.
@param frame_name The name of the frame.
@param frame_group_id The optional frame group identifier. If unspecified,
defaults to the common, 0 group. Must be
non-negative. */
explicit GeometryFrame(const std::string& frame_name, int frame_group_id = 0);
/** Returns the globally unique id for this geometry specification. Every
instantiation of %FrameInstance will contain a unique id value. The id
value is preserved across copies. After successfully registering this
%FrameInstance, this id will serve as the identifier for the registered
representation as well. */
FrameId id() const { return id_; }
const std::string& name() const { return name_; }
int frame_group() const { return frame_group_; }
private:
// The *globally* unique identifier for this instance. It is functionally
// const (i.e. defined in construction) but not marked const to allow for
// default copying/assigning.
FrameId id_{};
// The name of the frame. Must be unique across frames from the same geometry
// source.
std::string name_;
// TODO(SeanCurtis-TRI): Consider whether this should be an Identifier or
// TypeSafeIndex type.
// The frame group to which this frame belongs.
int frame_group_;
};
} // namespace geometry
} // namespace drake