diff --git a/visualization/motion_planning_tasks/properties/CMakeLists.txt b/visualization/motion_planning_tasks/properties/CMakeLists.txt index f9fa7de0..edbb46e5 100644 --- a/visualization/motion_planning_tasks/properties/CMakeLists.txt +++ b/visualization/motion_planning_tasks/properties/CMakeLists.txt @@ -2,16 +2,13 @@ set(MOVEIT_LIB_NAME motion_planning_tasks_properties) set(SOURCES property_factory.cpp + property_from_yaml.cpp ) find_package(PkgConfig REQUIRED) -pkg_check_modules(YAML yaml-0.1) -if (YAML_FOUND) - # Only cmake > 3.12 provides XXX_LINK_LIBRARIES. Find the absolute path manually - find_library(YAML_LIBRARIES ${YAML_LIBRARIES} PATHS ${YAML_LIBRARY_DIRS}) - list(APPEND SOURCES property_from_yaml.cpp) - add_definitions(-DHAVE_YAML) -endif() +pkg_check_modules(YAML REQUIRED yaml-0.1) +# Only cmake > 3.12 provides XXX_LINK_LIBRARIES. Find the absolute path manually +find_library(YAML_LIBRARIES ${YAML_LIBRARIES} PATHS ${YAML_LIBRARY_DIRS}) add_library(${MOVEIT_LIB_NAME} SHARED ${SOURCES}) diff --git a/visualization/motion_planning_tasks/properties/property_factory.cpp b/visualization/motion_planning_tasks/properties/property_factory.cpp index bc347391..f34f7cdd 100644 --- a/visualization/motion_planning_tasks/properties/property_factory.cpp +++ b/visualization/motion_planning_tasks/properties/property_factory.cpp @@ -147,21 +147,4 @@ void PropertyFactory::addRemainingProperties(rviz::Property* root, mtc::Property new rviz::Property("no properties", QVariant(), QString(), root); } -#ifndef HAVE_YAML -rviz::Property* PropertyFactory::createDefault(const std::string& name, const std::string& /*type*/, - const std::string& description, const std::string& value, - rviz::Property* old) { - if (old) { // reuse existing Property? - assert(old->getNameStd() == name); - old->setDescription(QString::fromStdString(description)); - old->setValue(QString::fromStdString(value)); - return old; - } else { // create new Property? - rviz::Property* result = new rviz::StringProperty(QString::fromStdString(name), QString::fromStdString(value), - QString::fromStdString(description)); - result->setReadOnly(true); - return result; - } -} -#endif } // namespace moveit_rviz_plugin diff --git a/visualization/package.xml b/visualization/package.xml index 3dfb1468..9bbf1ff4 100644 --- a/visualization/package.xml +++ b/visualization/package.xml @@ -18,6 +18,7 @@ moveit_ros_visualization roscpp rviz + yaml rosunit rostest