diff --git a/test/integration/visual_dom.cc b/test/integration/visual_dom.cc index dd7d27fcc..df124f51b 100644 --- a/test/integration/visual_dom.cc +++ b/test/integration/visual_dom.cc @@ -203,6 +203,30 @@ TEST(DOMVisual, Transparency) EXPECT_FLOAT_EQ(0.22f, vis1->Transparency()); } +////////////////////////////////////////////////// +TEST(DOMVisual, LaserRetro) +{ + const std::string testFile = + sdf::filesystem::append(PROJECT_SOURCE_PATH, "test", "sdf", + "shapes.sdf"); + + // Load the SDF file + sdf::Root root; + EXPECT_TRUE(root.Load(testFile).empty()); + + const sdf::Model *model = root.ModelByIndex(0); + ASSERT_NE(nullptr, model); + + const sdf::Link *link = model->LinkByIndex(0); + ASSERT_NE(nullptr, link); + + const sdf::Visual *vis1 = link->VisualByName("sphere_vis_laser_retro"); + ASSERT_NE(nullptr, vis1); + + ASSERT_EQ(true, vis1->HasLaserRetro()); + EXPECT_DOUBLE_EQ(1150, vis1->LaserRetro()); +} + ///////////////////////////////////////////////// TEST(DOMVisual, LoadModelFramesRelativeToJoint) { diff --git a/test/sdf/shapes.sdf b/test/sdf/shapes.sdf index b5e2ce799..3401fbb15 100644 --- a/test/sdf/shapes.sdf +++ b/test/sdf/shapes.sdf @@ -153,6 +153,15 @@ + + + 1150 + + + 0.5 + + +