From 31eea59a2453dae9de58da703b52644f6b12a05f Mon Sep 17 00:00:00 2001 From: ggould-tri Date: Mon, 17 Aug 2020 16:22:11 -0400 Subject: [PATCH] Model Directives mechanism for scene assembly. * Toward #13282 * A domain-specific language for assembling MultibodyPlant scenes from multiple SDF files. * Helpful for assembling large scenes without huge unwieldy sdf/xacro files. * A temporary accomodation until sdformat adds similar functionality. --- common/schema/dev/BUILD.bazel | 1 + common/schema/dev/rotation.h | 4 +- multibody/parsing/dev/BUILD.bazel | 64 +++++++++++++ multibody/parsing/dev/README.md | 89 ++++++++++++++++++ multibody/parsing/dev/model_directives.h | 20 ++-- .../parsing/dev/process_model_directives.cc | 52 +++++----- .../parsing/dev/process_model_directives.h | 25 +++-- .../parsing/dev/test/model_directives_test.cc | 14 +-- .../dev/test/process_model_directives_test.cc | 43 ++++----- .../add_backreference.yaml | 0 .../add_scoped_mid.yaml | 4 +- .../add_scoped_sub.yaml | 4 +- .../add_scoped_top.yaml | 8 +- .../circle.png | Bin .../process_model_directives_test/package.xml | 11 +++ .../simple_model.sdf | 5 +- 16 files changed, 259 insertions(+), 85 deletions(-) create mode 100644 multibody/parsing/dev/BUILD.bazel create mode 100644 multibody/parsing/dev/README.md rename multibody/parsing/dev/test/{models => process_model_directives_test}/add_backreference.yaml (100%) rename multibody/parsing/dev/test/{models => process_model_directives_test}/add_scoped_mid.yaml (82%) rename multibody/parsing/dev/test/{models => process_model_directives_test}/add_scoped_sub.yaml (86%) rename multibody/parsing/dev/test/{models => process_model_directives_test}/add_scoped_top.yaml (86%) rename multibody/parsing/dev/test/{models => process_model_directives_test}/circle.png (100%) create mode 100644 multibody/parsing/dev/test/process_model_directives_test/package.xml rename multibody/parsing/dev/test/{models => process_model_directives_test}/simple_model.sdf (75%) diff --git a/common/schema/dev/BUILD.bazel b/common/schema/dev/BUILD.bazel index 4590dcef5690..6fb0478424a9 100644 --- a/common/schema/dev/BUILD.bazel +++ b/common/schema/dev/BUILD.bazel @@ -39,6 +39,7 @@ drake_cc_library( name = "transform", srcs = ["transform.cc"], hdrs = ["transform.h"], + visibility = ["//multibody/parsing/dev:__pkg__"], deps = [ ":rotation", ":stochastic", diff --git a/common/schema/dev/rotation.h b/common/schema/dev/rotation.h index e7094e87cfae..d476f16b4f04 100644 --- a/common/schema/dev/rotation.h +++ b/common/schema/dev/rotation.h @@ -34,7 +34,7 @@ struct Rotation { Identity() = default; template - void Serialize(Archive* a) {} + void Serialize(Archive*) {} }; /// A roll-pitch-yaw rotation, using the angle conventions of Drake's @@ -72,7 +72,7 @@ struct Rotation { Uniform() = default; template - void Serialize(Archive* a) {} + void Serialize(Archive*) {} }; /// Returns true iff this is fully deterministic. diff --git a/multibody/parsing/dev/BUILD.bazel b/multibody/parsing/dev/BUILD.bazel new file mode 100644 index 000000000000..8270b45d3a6a --- /dev/null +++ b/multibody/parsing/dev/BUILD.bazel @@ -0,0 +1,64 @@ +# -*- python -*- + +load( + "@drake//tools/skylark:drake_cc.bzl", + "drake_cc_googletest", + "drake_cc_library", +) +load("//tools/lint:lint.bzl", "add_lint_tests") + +drake_cc_library( + name = "process_model_directives", + srcs = ["process_model_directives.cc"], + hdrs = ["process_model_directives.h"], + data = [ + "//manipulation/models/jaco_description:models", + ], + deps = [ + ":model_directives", + "//common:filesystem", + "//common:find_resource", + "//common/yaml:yaml_read_archive", + "//multibody/parsing", + "//multibody/plant", + ], +) + +filegroup( + name = "process_model_directives_test_models", + testonly = True, + data = glob(["test/process_model_directives_test/**"]), +) + +drake_cc_googletest( + name = "process_model_directives_test", + data = [ + ":process_model_directives_test_models", + ], + deps = [ + ":process_model_directives", + ], +) + +drake_cc_library( + name = "model_directives", + hdrs = [ + "model_directives.h", + ], + deps = [ + "//common:essential", + "//common:name_value", + "//common/schema/dev:transform", + "//math:geometric_transform", + ], +) + +drake_cc_googletest( + name = "model_directives_test", + deps = [ + ":model_directives", + "//common/yaml:yaml_read_archive", + ], +) + +add_lint_tests() diff --git a/multibody/parsing/dev/README.md b/multibody/parsing/dev/README.md new file mode 100644 index 000000000000..15a563c496b6 --- /dev/null +++ b/multibody/parsing/dev/README.md @@ -0,0 +1,89 @@ +The Model Directives mechanism +============================== + +Model Directives is a small yaml-based language for building a complex +MultibodyPlant-based scene out of numerous SDFs. For instance in the TRI +dish-loading demo we have individual SDF files for the counter, sink, cameras, +pedestal, arm, gripper, and each manipuland. A single SDF for this would be +unwieldy and difficult to maintain and collaborate on, but SDF's file +inclusion mechanisms have not yet proven adequate to this task. + +We expect that this mechanism will be temporary and will be removed when +sdformat adds similar functionality. Users should be aware that this library +will be deprecated if/when sdformat reaches feature parity with it. + + +## Syntax + +The easiest syntax reference is the unit test files in `test/models/*.yaml` of +this directory. + +A model directives file is a yaml file with a top level `directives:` group. +Within this group are a series of directives: + + * `AddModel` takes a `file` and `name` and loads the SDF/URDF file indicated + as a new model instance with the given name. + * `AddModelInstance` Creates a new, empty model instance in the plant with + the indicated `name`. + * `AddPackagePath` takes `name` and `path` and makes `package://name` URIs + be resolved to `path`. This directive is due for deprecation soon and + should generally be avoided. + * `AddFrame` takes a `name` and a `X_PF` transform and adds a new frame to + the model. Note that the transform is as specified in the `Transform` + scenario schema and can reference an optional base frame, in which case + the frame will be added to the base frame's model instance. + * `AddDirectives` takes a `file` naming a model directives file and an + optional `model_namespace`; it loads the model directives from that file + with the namespace prefixed to them (see Scoping, below). + * `AddWeld` takes a `parent` and `child` frame and welds them together. + + +## Use + +The easiest use reference is the unit test `process_model_directives_test.cc`. + +A simple example of a use would be: + +```cpp + ModelDirectives station_directives = LoadModelDirectives( + FindResourceOrThrow("my_exciting_project/models/my_scene.yaml")); + MultibodyPlant plant; + ProcessModelDirectives(station_directives, &plant); + plant.Finalize(); +``` + +This loads the model directives from that filename, constructs a plant, and +uses the model directives to populate the plant. + + +## Scoping + +Elements (frames, bodies, etc.) in `MultibodyPlant` belong to model instances. +Model instances can have any name specifiers, and can contain the "namespace" +delimiter `::`. Element names should not contain `::`. + +Examples: + +- `my_frame` implies no explicit model instance. +- `my_model::my_frame` implies the model instance `my_model`, the frame +`my_frame`. +- `top_level::my_model::my_frame` implies the model instance +`top_level::my_model`, the frame `my_frame`. + + +## Conditions for deprecation + +We expect and hope to deprecate this mechanism when either: + +SDF format properly specifies, and Drake supports, the following: + + * What `` statements should *really* do (e.g. namespacing models, + joints, etc.) without kludging Drake's parsing + * How to weld models together with joints external to the models + +OR if we find a mechanism whereby xacro could accomplish the same thing: + + * Drake's `package://` / `model://` mechanism were mature and correct, and + `sdformat` didn't use singletons for search paths. + * It was easier for one xacro to locate other xacros (possibly via a + workaround using a wrapper script to inject `DRAKE_PATH`) diff --git a/multibody/parsing/dev/model_directives.h b/multibody/parsing/dev/model_directives.h index 084032e27316..5679c01edb2a 100644 --- a/multibody/parsing/dev/model_directives.h +++ b/multibody/parsing/dev/model_directives.h @@ -11,14 +11,14 @@ #include "drake/common/eigen_types.h" #include "drake/common/name_value.h" +#include "drake/common/schema/dev/transform.h" #include "drake/common/text_logging.h" #include "drake/math/rigid_transform.h" #include "drake/math/roll_pitch_yaw.h" -#include "common/schema/transform.h" -namespace anzu { -namespace common { -namespace schema { +namespace drake { +namespace multibody { +namespace parsing { struct AddWeld { bool IsValid() const { @@ -128,7 +128,7 @@ struct AddFrame { std::string name; // Pose of frame to be added, `F`, w.r.t. parent frame `P` (as defined by // `X_PF.base_frame`). - Transform X_PF; + drake::schema::Transform X_PF; }; struct AddDirectives { @@ -225,15 +225,15 @@ struct ModelDirectives { inline void AddPackageToModelDirectives(const std::string& package_name, const std::string& package_path, ModelDirectives* directives) { - common::schema::AddPackagePath add_package_path; + AddPackagePath add_package_path; add_package_path.name = package_name; add_package_path.path = package_path; - common::schema::ModelDirective directive; + ModelDirective directive; directive.add_package_path = add_package_path; directives->directives.insert( directives->directives.begin(), directive); } -} // namespace schema -} // namespace common -} // namespace anzu +} // namespace parsing +} // namespace multibody +} // namespace drake diff --git a/multibody/parsing/dev/process_model_directives.cc b/multibody/parsing/dev/process_model_directives.cc index 86132ba6ec44..c8d7fc3c47c2 100644 --- a/multibody/parsing/dev/process_model_directives.cc +++ b/multibody/parsing/dev/process_model_directives.cc @@ -1,24 +1,24 @@ -#include "common/process_model_directives.h" +#include "drake/multibody/parsing/dev/process_model_directives.h" #include #include +#include #include +#include "drake/common/filesystem.h" #include "drake/common/find_resource.h" +#include "drake/common/schema/dev/transform.h" #include "drake/common/yaml/yaml_read_archive.h" #include "drake/multibody/parsing/parser.h" -#include "common/filesystem.h" -#include "common/find_resource.h" -#include "common/starts_with.h" -#include "common/yaml_load.h" -namespace anzu { -namespace common { +namespace drake { +namespace multibody { +namespace parsing { using std::make_unique; using Eigen::Isometry3d; -namespace fs = anzu::filesystem; +namespace fs = drake::filesystem; using drake::FindResourceOrThrow; using drake::math::RigidTransformd; using drake::multibody::FixedOffsetFrame; @@ -29,8 +29,6 @@ using drake::multibody::PackageMap; using drake::multibody::Parser; using drake::yaml::YamlReadArchive; -using schema::ModelDirectives; - namespace { // If `*ptr` is null, construct `T(args...)` and reassign the pointer. @@ -42,7 +40,7 @@ std::unique_ptr ConstructIfNullAndReassign(T** ptr, Args&&... args) { out = std::make_unique(std::forward(args)...); *ptr = out.get(); } - return std::move(out); + return out; } } // namespace @@ -319,15 +317,23 @@ void ProcessModelDirectives( ModelDirectives LoadModelDirectives(const std::string& filename) { drake::log()->debug("LoadModelDirectives: {}", filename); - auto directives = common::YamlLoadWithDefaults(filename); + + // TODO(ggould-tri) This should use the YamlLoadWithDefaults mechanism + // instead once that is ported to drake. + ModelDirectives directives; + YAML::Node root = YAML::LoadFile(filename); + drake::yaml::YamlReadArchive::Options options; + options.allow_cpp_with_no_yaml = true; + drake::yaml::YamlReadArchive(root, options).Accept(&directives); + DRAKE_DEMAND(directives.IsValid()); return directives; } void FlattenModelDirectives( - const schema::ModelDirectives& directives, + const ModelDirectives& directives, const PackageMap& package_map, - schema::ModelDirectives* out) { + ModelDirectives* out) { // NOTE: Does not handle scoping! for (auto& directive : directives.directives) { if (directive.add_directives) { @@ -356,9 +362,9 @@ ModelInfo MakeModelInfo(const std::string& model_name, // TODO(eric.cousineau): Do we *really* need this function? This seems like // it'd be better handled as an MBP subgraph. -schema::ModelDirectives MakeModelsAttachedToFrameDirectives( +ModelDirectives MakeModelsAttachedToFrameDirectives( const std::vector& models_to_add) { - schema::ModelDirectives directives; + ModelDirectives directives; // One for add frame, one for add model, one for add weld. directives.directives.resize(models_to_add.size() * 3); @@ -370,25 +376,26 @@ schema::ModelDirectives MakeModelsAttachedToFrameDirectives( // Add frame first. if (!model_to_add.X_PC.IsExactlyIdentity()) { - schema::AddFrame frame_dir; + AddFrame frame_dir; attachment_frame_name = model_to_add.model_name + "_attachment_frame"; frame_dir.name = attachment_frame_name; frame_dir.X_PF.base_frame = model_to_add.parent_frame_name; frame_dir.X_PF.translation = drake::Vector(model_to_add.X_PC.translation()); - frame_dir.X_PF.rotation = schema::Rotation{model_to_add.X_PC.rotation()}; + frame_dir.X_PF.rotation = + drake::schema::Rotation{model_to_add.X_PC.rotation()}; directives.directives.at(index++).add_frame = frame_dir; } // Add model - schema::AddModel model_dir; + AddModel model_dir; model_dir.file = model_to_add.model_path; model_dir.name = model_to_add.model_name; directives.directives.at(index++).add_model = model_dir; - common::schema::AddWeld weld_dir; + AddWeld weld_dir; weld_dir.parent = attachment_frame_name; weld_dir.child = model_to_add.model_name + "::" + model_to_add.child_frame_name; @@ -399,5 +406,6 @@ schema::ModelDirectives MakeModelsAttachedToFrameDirectives( return directives; } -} // namespace common -} // namespace anzu +} // namespace parsing +} // namespace multibody +} // namespace drake diff --git a/multibody/parsing/dev/process_model_directives.h b/multibody/parsing/dev/process_model_directives.h index 2b74e8fb6c3a..78aec2d2a6b4 100644 --- a/multibody/parsing/dev/process_model_directives.h +++ b/multibody/parsing/dev/process_model_directives.h @@ -1,22 +1,20 @@ #pragma once -/// Processes stuff from `common/schema/model_directives.h`. See -// `common/schema/README.md` for more info. - #include #include #include +#include "drake/multibody/parsing/dev/model_directives.h" #include "drake/multibody/parsing/package_map.h" #include "drake/multibody/parsing/parser.h" #include "drake/multibody/plant/multibody_plant.h" #include "drake/multibody/tree/multibody_tree_indexes.h" -#include "common/schema/model_directives.h" -namespace anzu { -namespace common { +namespace drake { +namespace multibody { +namespace parsing { -schema::ModelDirectives LoadModelDirectives(const std::string& filename); +ModelDirectives LoadModelDirectives(const std::string& filename); /// ModelDirectives refer to their resources by URIs like /// `package://somepackage/somepath/somefile.sdf`, where somepackage refers to @@ -57,13 +55,13 @@ ModelInfo MakeModelInfo( * `child_frame_name` to `parent_frame_name` directly. The `model_instance` * field is ignored for this purposes. */ -schema::ModelDirectives MakeModelsAttachedToFrameDirectives( +ModelDirectives MakeModelsAttachedToFrameDirectives( const std::vector& models_to_add); // Flatten model directives. -void FlattenModelDirectives(const schema::ModelDirectives& directives, +void FlattenModelDirectives(const ModelDirectives& directives, const drake::multibody::PackageMap& package_map, - schema::ModelDirectives* out); + ModelDirectives* out); /// Provides a magical way to inject error (randomization) for synthesis. /// Maps from (parent_frame, child_frame) -> X_PCe, where Ce is the perturbed @@ -79,7 +77,7 @@ using ModelWeldErrorFunction = /// Note: The passed-in parser will be mutated to add the jaco_description /// package to its package map (since model directives and their contents are /// allowed to refer to the package directly for workaround reasons). -void ProcessModelDirectives(const schema::ModelDirectives& directives, +void ProcessModelDirectives(const ModelDirectives& directives, drake::multibody::MultibodyPlant* plant, std::vector* added_models = nullptr, drake::multibody::Parser* parser = nullptr, @@ -127,5 +125,6 @@ ScopedName ParseScopedName(const std::string& full_name); } // namespace internal -} // namespace common -} // namespace anzu +} // namespace parsing +} // namespace multibody +} // namespace drake diff --git a/multibody/parsing/dev/test/model_directives_test.cc b/multibody/parsing/dev/test/model_directives_test.cc index da5e045ea447..4de1b3a33206 100644 --- a/multibody/parsing/dev/test/model_directives_test.cc +++ b/multibody/parsing/dev/test/model_directives_test.cc @@ -1,5 +1,5 @@ // Minimal test to make sure stuff doesn't explode. -#include "common/schema/model_directives.h" +#include "drake/multibody/parsing/dev/model_directives.h" #include @@ -7,9 +7,9 @@ using drake::yaml::YamlReadArchive; -namespace anzu { -namespace common { -namespace schema { +namespace drake { +namespace multibody { +namespace parsing { namespace { // TODO(jeremy.nimmer) We can remove this argument from the call sites below @@ -49,6 +49,6 @@ GTEST_TEST(ModelDirectivesTest, Success) { } } // namespace -} // namespace schema -} // namespace common -} // namespace anzu +} // namespace parsing +} // namespace multibody +} // namespace drake diff --git a/multibody/parsing/dev/test/process_model_directives_test.cc b/multibody/parsing/dev/test/process_model_directives_test.cc index a6a2ec699ec0..831a47d0752f 100644 --- a/multibody/parsing/dev/test/process_model_directives_test.cc +++ b/multibody/parsing/dev/test/process_model_directives_test.cc @@ -1,16 +1,17 @@ -#include "common/process_model_directives.h" +#include "drake/multibody/parsing/dev/process_model_directives.h" #include #include +#include "drake/common/filesystem.h" +#include "drake/common/find_resource.h" #include "drake/math/rigid_transform.h" #include "drake/multibody/plant/multibody_plant.h" -#include "common/filesystem.h" -#include "common/find_resource.h" -namespace anzu { -namespace common { +namespace drake { +namespace multibody { +namespace parsing { namespace { using std::optional; @@ -20,24 +21,24 @@ using drake::multibody::Frame; using drake::multibody::MultibodyPlant; using drake::multibody::Parser; using drake::systems::DiagramBuilder; -using schema::ModelDirectives; -// Because this test is meant to test ProcessModelDirectives without using -// anzu features, but because the test data is in anzu (for now), provide -// a bespoke way to get a multibody::Parser that knows about anzu. -// TODO(ggould) Remove this method when the test data moves to drake. +const char* const kTestDir = + "drake/multibody/parsing/dev/test/process_model_directives_test"; + +// Our unit test's package is not normally loaded; construct a parser that +// has it and can resolve package://process_model_directives_test urls. std::unique_ptr make_parser(MultibodyPlant* plant) { auto parser = std::make_unique(plant); - const anzu::filesystem::path abspath_xml = - FindAnzuResourceOrThrow("package.xml"); - parser->package_map().Add("anzu", abspath_xml.parent_path().string()); - return std::move(parser); + const drake::filesystem::path abspath_xml = FindResourceOrThrow( + std::string(kTestDir) + "/package.xml"); + parser->package_map().AddPackageXml(abspath_xml.string()); + return parser; } // Simple smoke test of the most basic model directives. GTEST_TEST(ProcessModelDirectivesTest, BasicSmokeTest) { ModelDirectives station_directives = LoadModelDirectives( - FindAnzuResourceOrThrow("common/test/models/add_scoped_sub.yaml")); + FindResourceOrThrow(std::string(kTestDir) + "/add_scoped_sub.yaml")); const MultibodyPlant empty_plant(0.0); MultibodyPlant plant(0.0); @@ -61,7 +62,7 @@ GTEST_TEST(ProcessModelDirectivesTest, BasicSmokeTest) { // testing its interaction with SceneGraph. GTEST_TEST(ProcessModelDirectivesTest, AddScopedSmokeTest) { ModelDirectives directives = LoadModelDirectives( - "common/test/models/add_scoped_top.yaml"); + FindResourceOrThrow(std::string(kTestDir) + "/add_scoped_top.yaml")); // Ensure that we have a SceneGraph present so that we test relevant visual // pieces. @@ -103,7 +104,7 @@ GTEST_TEST(ProcessModelDirectivesTest, AddScopedSmokeTest) { GTEST_TEST(ProcessModelDirectivesTest, SmokeTestInjectWeldError) { const RigidTransformd error_transform({0.1, 0., 0.1}, {2, 3, 4}); ModelDirectives directives = LoadModelDirectives( - FindAnzuResourceOrThrow("common/test/models/add_scoped_sub.yaml")); + FindResourceOrThrow(std::string(kTestDir) + "/add_scoped_sub.yaml")); // This error function should add model error to exactly one weld, the // attachment of the `first_instance` sdf model to the `smoke_test_origin` @@ -122,8 +123,7 @@ GTEST_TEST(ProcessModelDirectivesTest, SmokeTestInjectWeldError) { }; ProcessModelDirectives(directives, &plant, - nullptr, make_parser(&plant).get(), - error); + nullptr, make_parser(&plant).get(), error); plant.Finalize(); // This should have created an error frame for the relevant weld. @@ -153,5 +153,6 @@ GTEST_TEST(ProcessModelDirectivesTest, SmokeTestInjectWeldError) { } } // namespace -} // namespace common -} // namespace anzu +} // namespace parsing +} // namespace multibody +} // namespace drake diff --git a/multibody/parsing/dev/test/models/add_backreference.yaml b/multibody/parsing/dev/test/process_model_directives_test/add_backreference.yaml similarity index 100% rename from multibody/parsing/dev/test/models/add_backreference.yaml rename to multibody/parsing/dev/test/process_model_directives_test/add_backreference.yaml diff --git a/multibody/parsing/dev/test/models/add_scoped_mid.yaml b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_mid.yaml similarity index 82% rename from multibody/parsing/dev/test/models/add_scoped_mid.yaml rename to multibody/parsing/dev/test/process_model_directives_test/add_scoped_mid.yaml index e66c48cc50dd..e75456c5f702 100644 --- a/multibody/parsing/dev/test/models/add_scoped_mid.yaml +++ b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_mid.yaml @@ -12,11 +12,11 @@ directives: base_frame: world translation: [10, 0, 0] - add_directives: - file: package://anzu/common/test/models/add_scoped_sub.yaml + file: package://process_model_directives_test/add_scoped_sub.yaml model_namespace: nested # Include a test for model directives backreferences (which are possibly a bug; # see the included file for details) - add_directives: - file: package://anzu/common/test/models/add_backreference.yaml + file: package://process_model_directives_test/add_backreference.yaml model_namespace: nested diff --git a/multibody/parsing/dev/test/models/add_scoped_sub.yaml b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_sub.yaml similarity index 86% rename from multibody/parsing/dev/test/models/add_scoped_sub.yaml rename to multibody/parsing/dev/test/process_model_directives_test/add_scoped_sub.yaml index f1246e1e2a1f..d62a394045fb 100644 --- a/multibody/parsing/dev/test/models/add_scoped_sub.yaml +++ b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_sub.yaml @@ -7,7 +7,7 @@ directives: - add_model: # This name will be prefixed by `model_namespace`. name: simple_model - file: package://anzu/common/test/models/simple_model.sdf + file: package://process_model_directives_test/simple_model.sdf - add_frame: # This will implicitly resolve to the `simple_model` instance. @@ -25,7 +25,7 @@ directives: - add_model: name: extra_model - file: package://anzu/common/test/models/simple_model.sdf + file: package://process_model_directives_test/simple_model.sdf - add_weld: parent: simple_model::frame diff --git a/multibody/parsing/dev/test/models/add_scoped_top.yaml b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_top.yaml similarity index 86% rename from multibody/parsing/dev/test/models/add_scoped_top.yaml rename to multibody/parsing/dev/test/process_model_directives_test/add_scoped_top.yaml index b8b9d314212a..e81f60b19415 100644 --- a/multibody/parsing/dev/test/models/add_scoped_top.yaml +++ b/multibody/parsing/dev/test/process_model_directives_test/add_scoped_top.yaml @@ -14,7 +14,7 @@ directives: X_PF: base_frame: world - add_directives: - file: package://anzu/common/test/models/add_scoped_sub.yaml + file: package://process_model_directives_test/add_scoped_sub.yaml - add_frame: name: simple_model::top_added_frame X_PF: @@ -32,7 +32,7 @@ directives: base_frame: world translation: [0, 1, 0] - add_directives: - file: package://anzu/common/test/models/add_scoped_sub.yaml + file: package://process_model_directives_test/add_scoped_sub.yaml model_namespace: left - add_frame: name: left::simple_model::top_added_frame @@ -49,7 +49,7 @@ directives: base_frame: world translation: [0, -1, 0] - add_directives: - file: package://anzu/common/test/models/add_scoped_sub.yaml + file: package://process_model_directives_test/add_scoped_sub.yaml model_namespace: right - add_frame: name: right::simple_model::top_added_frame @@ -61,7 +61,7 @@ directives: - add_model_instance: name: mid - add_directives: - file: package://anzu/common/test/models/add_scoped_mid.yaml + file: package://process_model_directives_test/add_scoped_mid.yaml model_namespace: mid - add_frame: name: mid::nested::simple_model::top_added_frame diff --git a/multibody/parsing/dev/test/models/circle.png b/multibody/parsing/dev/test/process_model_directives_test/circle.png similarity index 100% rename from multibody/parsing/dev/test/models/circle.png rename to multibody/parsing/dev/test/process_model_directives_test/circle.png diff --git a/multibody/parsing/dev/test/process_model_directives_test/package.xml b/multibody/parsing/dev/test/process_model_directives_test/package.xml new file mode 100644 index 000000000000..61c989b9ab4f --- /dev/null +++ b/multibody/parsing/dev/test/process_model_directives_test/package.xml @@ -0,0 +1,11 @@ + + + process_model_directives_test + 0.0.0 + + Unit test data for `process_model_directives.cc` + + John Doe + Jane Doe + N/A + diff --git a/multibody/parsing/dev/test/models/simple_model.sdf b/multibody/parsing/dev/test/process_model_directives_test/simple_model.sdf similarity index 75% rename from multibody/parsing/dev/test/models/simple_model.sdf rename to multibody/parsing/dev/test/process_model_directives_test/simple_model.sdf index b8f60a69455e..90e709ee4775 100644 --- a/multibody/parsing/dev/test/models/simple_model.sdf +++ b/multibody/parsing/dev/test/process_model_directives_test/simple_model.sdf @@ -13,10 +13,11 @@ - package://anzu/common/test/models_data/circle.png + package://process_model_directives_test/circle.png