diff --git a/drake_ros_examples/examples/hydroelastic/hydroelastic.cc b/drake_ros_examples/examples/hydroelastic/hydroelastic.cc index a6090c5f..144ccace 100644 --- a/drake_ros_examples/examples/hydroelastic/hydroelastic.cc +++ b/drake_ros_examples/examples/hydroelastic/hydroelastic.cc @@ -67,8 +67,7 @@ void AddScene(MultibodyPlantd* plant) { std::filesystem::path fs_path{ parser.package_map().GetPath("drake_ros_examples")}; - parser.AddAllModelsFromFile( - (fs_path / "hydroelastic/hydroelastic.sdf").string()); + parser.AddModels((fs_path / "hydroelastic/hydroelastic.sdf").string()); } int do_main() { diff --git a/drake_ros_examples/examples/multirobot/multirobot.cc b/drake_ros_examples/examples/multirobot/multirobot.cc index e95e9e90..e01529dd 100644 --- a/drake_ros_examples/examples/multirobot/multirobot.cc +++ b/drake_ros_examples/examples/multirobot/multirobot.cc @@ -84,8 +84,10 @@ int main(int argc, char** argv) { // coordinates in the array std::stringstream model_instance_name; model_instance_name << model_name << xx << '_' << yy; - auto model_instance = - parser.AddModelFromFile(model_file_path, model_instance_name.str()); + parser.SetAutoRenaming(true); + auto model_instance = parser.AddModels(model_file_path)[0]; + + plant.RenameModelInstance(model_instance, model_instance_name.str()); // Weld the robot to the world so it doesn't fall through the floor auto& base_frame = plant.GetFrameByName("base", model_instance);