Tesseract 0.28.4
Loading...
Searching...
No Matches
contact_managers_schema_unit.cpp File Reference

Tests for ContactManagersPluginInfo schema validation with derived type support. More...

#include <tesseract/common/macros.h>
#include <algorithm>
#include <gtest/gtest.h>
#include <yaml-cpp/yaml.h>
#include <tesseract/common/yaml_extensions.h>
#include <tesseract/common/property_tree.h>
#include <tesseract/collision/bullet/bullet_factories.h>
#include <tesseract/collision/fcl/fcl_factories.h>
#include <boost_plugin_loader/utils.h>

Functions

schema mergeConfig (config)
 
 EXPECT_TRUE (errors.empty())<<[&]
 
 EXPECT_FALSE (errors.empty())
 
 for (const auto &e :errors)
 
 EXPECT_TRUE (found_derive_error)<< "Expected a derived-type or schema-not-found error"
 
 EXPECT_TRUE (found_class_error)<< "Expected an error about missing 'class' field"
 
YAML::Node discrete_plugins (YAML::NodeType::Map)
 
YAML::Node plugins (YAML::NodeType::Map)
 
YAML::Node plugin_info (YAML::NodeType::Map)
 
 EXPECT_TRUE (found_plugins_error)<< "Expected an error about 'plugins' having the wrong type"
 
 EXPECT_TRUE (std::any_of(errors.begin(), errors.end(), [](const auto &error) { return error.find("discrete_plugins.plugins") !=std::string::npos &&error.find("required") !=std::string::npos;}))
 
 EXPECT_TRUE (schema.validate().empty())
 
std::filesystem::path file_path (__FILE__)
 
int main (int argc, char **argv)
 

Variables

YAML::Node config
 
auto errors = schema.validate()
 
bool found_derive_error = false
 
bool found_class_error = false
 
 discrete_plugins ["default"] = "BulletDiscreteSimpleManager"
 
 plugin_info ["class"] = "BulletDiscreteSimpleManagerFactory"
 
 plugins ["BulletDiscreteSimpleManager"] = plugin_info
 
bool found_plugins_error = false
 
std::filesystem::path config_path = file_path.parent_path() / "contact_manager_plugins.yaml"
 
YAML::Node full_config = YAML::LoadFile(config_path.string())
 

Detailed Description

Tests for ContactManagersPluginInfo schema validation with derived type support.

Author
Levi Armstrong
Date
April 4, 2026
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ file_path()

std::filesystem::path file_path ( __FILE__  )
Initial value:
{
using namespace tesseract::common
Namespace owning boost's hash_is_avalanching, and defined iff boost has the trait at all.
Definition allowed_collision_matrix.h:15

Variable Documentation

◆ config

YAML::Node config
Initial value:
= YAML::Load(R"(
search_paths:
- /usr/local/lib
search_libraries:
- tesseract_collision_bullet_factories
discrete_plugins:
default: BulletDiscreteBVHManager
plugins:
BulletDiscreteBVHManager:
class: BulletDiscreteBVHManagerFactory
config:
share_pool_allocators: false
BulletDiscreteSimpleManager:
class: BulletDiscreteSimpleManagerFactory
FCLDiscreteBVHManager:
class: FCLDiscreteBVHManagerFactory
continuous_plugins:
default: BulletCastBVHManager
plugins:
BulletCastBVHManager:
class: BulletCastBVHManagerFactory
BulletCastSimpleManager:
class: BulletCastSimpleManagerFactory
)")