Go to the documentation of this file.
3 #include <gtest/gtest.h>
27 std::string path =
"package://tesseract_support/urdf/boxbot.urdf";
33 std::string path =
"package://tesseract_support/urdf/boxbot.srdf";
35 auto srdf = std::make_shared<SRDFModel>();
36 srdf->initFile(scene_graph, locator.
locateResource(path)->getFilePath(), locator);
43 auto visual = std::make_shared<Visual>();
44 visual->geometry = std::make_shared<tesseract_geometry::Box>(1, 1, 1);
45 auto collision = std::make_shared<Collision>();
46 collision->geometry = std::make_shared<tesseract_geometry::Box>(1, 1, 1);
48 Link link_1(
"link_n1");
49 link_1.
visual.push_back(visual);
52 auto cmd = std::make_shared<AddLinkCommand>(link_1);
54 EXPECT_EQ(cmd->getType(), CommandType::ADD_LINK);
60 TEST(TesseractEnvironmentCache, defaultEnvironmentCacheTest)
69 auto env = std::make_shared<Environment>();
70 bool success = env->init(*scene_graph, srdf);
79 for (
int i = 0; i < 20; ++i)
90 for (
int i = 0; i < 10; ++i)
100 int main(
int argc,
char** argv)
102 testing::InitGoogleTest(&argc, argv);
104 return RUN_ALL_TESTS();
std::shared_ptr< SRDFModel > Ptr
std::vector< Visual::Ptr > visual
void addLink(Environment &env)
long getCacheSize() const override final
Get the cache size used to hold tesseract objects for motion planning.
bool applyCommand(std::shared_ptr< const Command > command)
Apply command to the environment.
virtual std::shared_ptr< Resource > locateResource(const std::string &url) const=0
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
std::vector< Collision::Ptr > collision
#define EXPECT_TRUE(args)
void refreshCache() const override final
If the environment has changed it will rebuild the cache of tesseract objects.
std::unique_ptr< tesseract_scene_graph::SceneGraph > parseURDFFile(const std::string &path, const tesseract_common::ResourceLocator &locator)
SceneGraph::Ptr getSceneGraph(const tesseract_common::ResourceLocator &locator)
Used to add link and joint to environment.
std::unique_ptr< Environment > UPtr
SRDFModel::Ptr getSRDFModel(const SceneGraph &scene_graph, const tesseract_common::ResourceLocator &locator)
std::unique_ptr< Environment > getCachedEnvironment() const override final
This will pop an Environment object from the queue.
int main(int argc, char **argv)
TEST(TesseractEnvironmentCache, defaultEnvironmentCacheTest)
std::shared_ptr< SceneGraph > Ptr
void setCacheSize(long size) override final
Set the cache size used to hold tesseract objects for motion planning.