Model instance information for multibody trees.
A MultibodyTree is composed of a number of MultibodyElement items. In more complex trees, these items will be loaded from multiple models (e.g. robot arm, attached gripper, free bodies being manipulated). Each model may have a different controller or observer, so the ability to view the state or command actuation for each model independently can be useful. For this reason, elements are associated with a ModelInstanceIndex to determine which model an element belongs to. In most cases, the allocation of model instances and assignment of elements to the appropriate model instance will be handled by the parser loading the model.
There are two special ModelElementIndex values. The world body is always ModelInstanceIndex 0, and ModelInstanceIndex 1 is reserved for all elements with no explicit model instance. This is generally only relevant for elements created programmatically (and for which a model instance is not explicitly specified), as model parsers should handle creating model elements as needed.
For different types of MultibodyElement, the model instance is sometimes specified explicitly, and sometimes inferred when the element is created. The current convention is:
#include <string>
#include <vector>
#include "drake/common/default_scalars.h"
#include "drake/common/drake_copyable.h"
#include "drake/common/eigen_types.h"
#include "drake/multibody/tree/joint_actuator.h"
#include "drake/multibody/tree/mobilizer.h"
#include "drake/multibody/tree/multibody_element.h"
#include "drake/multibody/tree/multibody_tree_indexes.h"
Namespaces | |
drake | |
drake::multibody | |
Functions | |
DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS (class ::drake::multibody::internal::ModelInstance) | |
DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS | ( | class ::drake::multibody::internal::ModelInstance | ) |