Tesseract
Motion Planning Environment
|
Tesseract collision contact managers factory test. More...
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <fstream>
#include <tesseract_collision/core/contact_managers_plugin_factory.h>
Functions | |
void | runContactManagersFactoryTest (const tesseract_common::fs::path &config_path) |
runContactManagersFactoryTest (config_path) | |
runContactManagersFactoryTest (export_config_path) | |
EXPECT_EQ (sp.size(), 2) | |
for (auto it=search_paths.begin();it !=search_paths.end();++it) | |
EXPECT_EQ (sl.size(), 2) | |
EXPECT_EQ (discrete_plugins.size(), 3) | |
EXPECT_EQ (continuous_plugins.size(), 2) | |
EXPECT_FALSE (factory.getSearchPaths().empty()) | |
EXPECT_EQ (factory.getSearchPaths().size(), 1) | |
EXPECT_EQ (factory.getSearchLibraries().size(), 2) | |
EXPECT_EQ (factory.getDiscreteContactManagerPlugins().size(), 0) | |
EXPECT_ANY_THROW (factory.getDefaultDiscreteContactManagerPlugin()) | |
EXPECT_FALSE (factory.hasDiscreteContactManagerPlugins()) | |
factory | addSearchPath ("/usr/local/lib") |
factory | addSearchLibrary ("tesseract_collision") |
EXPECT_EQ (factory.getSearchLibraries().size(), 3) | |
EXPECT_TRUE (map.find("NotFound")==map.end()) | |
factory | addDiscreteContactManagerPlugin ("TestDiscreteManager", pi) |
EXPECT_TRUE (factory.hasDiscreteContactManagerPlugins()) | |
EXPECT_TRUE (map.find("TestDiscreteManager") !=map.end()) | |
EXPECT_EQ (factory.getDefaultDiscreteContactManagerPlugin(), "TestDiscreteManager") | |
factory | addDiscreteContactManagerPlugin ("Test2DiscreteManager", pi2) |
EXPECT_TRUE (map.find("Test2DiscreteManager") !=map.end()) | |
EXPECT_EQ (factory.getDefaultDiscreteContactManagerPlugin(), "Test2DiscreteManager") | |
factory | setDefaultDiscreteContactManagerPlugin ("TestDiscreteManager") |
factory | removeDiscreteContactManagerPlugin ("TestDiscreteManager") |
EXPECT_ANY_THROW (factory.removeDiscreteContactManagerPlugin("DoesNotExist")) | |
factory | addContinuousContactManagerPlugin ("TestContinuousManager", pi) |
EXPECT_TRUE (map.find("TestContinuousManager") !=map.end()) | |
EXPECT_EQ (factory.getDefaultContinuousContactManagerPlugin(), "TestContinuousManager") | |
factory | addContinuousContactManagerPlugin ("Test2ContinuousManager", pi2) |
EXPECT_TRUE (map.find("Test2ContinuousManager") !=map.end()) | |
EXPECT_EQ (factory.getDefaultContinuousContactManagerPlugin(), "Test2ContinuousManager") | |
factory | setDefaultContinuousContactManagerPlugin ("TestContinuousManager") |
factory | removeContinuousContactManagerPlugin ("TestContinuousManager") |
int | main (int argc, char **argv) |
Variables | |
tesseract_common::fs::path | config_path = file_path.parent_path() / "contact_manager_plugins.yaml" |
tesseract_common::fs::path | export_config_path |
ContactManagersPluginFactory | factory (config) |
YAML::Node | plugin_config = YAML::Load(config) |
const YAML::Node & | plugin_info = plugin_config["contact_manager_plugins"] |
const YAML::Node & | search_paths = plugin_info["search_paths"] |
const YAML::Node & | search_libraries = plugin_info["search_libraries"] |
const YAML::Node & | discrete_plugins = plugin_info["discrete_plugins"]["plugins"] |
const YAML::Node & | continuous_plugins = plugin_info["continuous_plugins"]["plugins"] |
tesseract_common::PluginInfo | pi |
pi | class_name = "TestDiscreteManagerFactory" |
map = factory.getDiscreteContactManagerPlugins() | |
tesseract_common::PluginInfo | pi2 |
Tesseract collision contact managers factory test.
factory addSearchLibrary | ( | "tesseract_collision" | ) |
factory addSearchPath | ( | "/usr/local/lib" | ) |
EXPECT_ANY_THROW | ( | factory. | getDefaultDiscreteContactManagerPlugin() | ) |
EXPECT_ANY_THROW | ( | factory. | removeDiscreteContactManagerPlugin"DoesNotExist" | ) |
EXPECT_EQ | ( | continuous_plugins. | size(), |
2 | |||
) |
EXPECT_EQ | ( | discrete_plugins. | size(), |
3 | |||
) |
EXPECT_EQ | ( | factory. | getDefaultContinuousContactManagerPlugin(), |
"Test2ContinuousManager" | |||
) |
EXPECT_EQ | ( | factory. | getDefaultContinuousContactManagerPlugin(), |
"TestContinuousManager" | |||
) |
EXPECT_EQ | ( | factory. | getDefaultDiscreteContactManagerPlugin(), |
"Test2DiscreteManager" | |||
) |
EXPECT_EQ | ( | factory. | getDefaultDiscreteContactManagerPlugin(), |
"TestDiscreteManager" | |||
) |
EXPECT_EQ | ( | factory. | getDiscreteContactManagerPlugins).size(, |
0 | |||
) |
EXPECT_EQ | ( | factory. | getSearchLibraries).size(, |
2 | |||
) |
EXPECT_EQ | ( | factory. | getSearchLibraries).size(, |
3 | |||
) |
EXPECT_EQ | ( | factory. | getSearchPaths).size(, |
1 | |||
) |
EXPECT_EQ | ( | sl. | size(), |
2 | |||
) |
EXPECT_EQ | ( | sp. | size(), |
2 | |||
) |
EXPECT_FALSE | ( | factory. | getSearchPaths).empty( | ) |
EXPECT_FALSE | ( | factory. | hasDiscreteContactManagerPlugins() | ) |
EXPECT_TRUE | ( | factory. | hasDiscreteContactManagerPlugins() | ) |
EXPECT_TRUE | ( | map. | find"NotFound" = =map.end() | ) |
EXPECT_TRUE | ( | map.find("Test2ContinuousManager") ! | = map.end() | ) |
EXPECT_TRUE | ( | map.find("Test2DiscreteManager") ! | = map.end() | ) |
EXPECT_TRUE | ( | map.find("TestContinuousManager") ! | = map.end() | ) |
EXPECT_TRUE | ( | map.find("TestDiscreteManager") ! | = map.end() | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
factory removeContinuousContactManagerPlugin | ( | "TestContinuousManager" | ) |
factory removeDiscreteContactManagerPlugin | ( | "TestDiscreteManager" | ) |
runContactManagersFactoryTest | ( | config_path | ) |
void runContactManagersFactoryTest | ( | const tesseract_common::fs::path & | config_path | ) |
runContactManagersFactoryTest | ( | export_config_path | ) |
factory setDefaultContinuousContactManagerPlugin | ( | "TestContinuousManager" | ) |
factory setDefaultDiscreteContactManagerPlugin | ( | "TestDiscreteManager" | ) |
pi2 class_name = "TestDiscreteManagerFactory" |
tesseract_common::fs::path config_path = file_path.parent_path() / "contact_manager_plugins.yaml" |
const YAML::Node & continuous_plugins = plugin_info["continuous_plugins"]["plugins"] |
const YAML::Node & discrete_plugins = plugin_info["discrete_plugins"]["plugins"] |
tesseract_common::fs::path export_config_path |
ContactManagersPluginFactory factory(config) | ( | config | ) |
map = factory.getDiscreteContactManagerPlugins() |
YAML::Node plugin_config = YAML::Load(config) |
const YAML::Node & plugin_info = plugin_config["contact_manager_plugins"] |
const YAML::Node & search_libraries = plugin_info["search_libraries"] |
const YAML::Node & search_paths = plugin_info["search_paths"] |