-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
link_joint_graph_loop_constraint.h
53 lines (41 loc) · 1.72 KB
/
link_joint_graph_loop_constraint.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
#pragma once
#ifndef DRAKE_MULTIBODY_TOPOLOGY_GRAPH_INCLUDED
#error Do not include this file. Use "drake/multibody/topology/graph.h".
#endif
#include <string>
namespace drake {
namespace multibody {
// TODO(sherm1) Promote from internal once API has stabilized: issue #11307.
namespace internal {
/** A weld constraint used to close a topological loop (cycle) in the input
graph after modeling as a forest. The parent/child ordering sets the sign
convention for the constraint multipliers. Added welds between a primary %Link
and one of its shadow Links always make the primary %Link the parent. */
class LinkJointGraph::LoopConstraint {
public:
DRAKE_DEFAULT_COPY_AND_MOVE_AND_ASSIGN(LoopConstraint)
LoopConstraint(LoopConstraintIndex index, std::string name,
ModelInstanceIndex model_instance,
BodyIndex primary_link_index, BodyIndex shadow_link_index)
: index_(index),
name_(name),
model_instance_(model_instance),
primary_link_index_(primary_link_index),
shadow_link_index_(shadow_link_index) {}
LoopConstraintIndex index() const { return index_; }
ModelInstanceIndex model_instance() const { return model_instance_; }
const std::string& name() const { return name_; }
BodyIndex primary_link() const { return primary_link_index_; }
BodyIndex shadow_link() const { return shadow_link_index_; }
private:
LoopConstraintIndex index_;
std::string name_;
ModelInstanceIndex model_instance_;
BodyIndex primary_link_index_;
BodyIndex shadow_link_index_;
// TODO(sherm1) Record the ephemeral MultibodyPlant Constraint here, e.g.:
// MultibodyConstraintId plant_constraint_id_;
};
} // namespace internal
} // namespace multibody
} // namespace drake