Tesseract
Motion Planning Environment
|
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <Eigen/Geometry>
#include <tesseract_common/utils.h>
#include <tesseract_urdf/urdf_parser.h>
#include <tesseract_support/tesseract_support_resource_locator.h>
#include "tesseract_urdf_common_unit.h"
Variables | |
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH | TESSERACT_COMMON_IGNORE_WARNINGS_POP |
tesseract_scene_graph::SceneGraph::Ptr | sg = tesseract_urdf::parseURDFString(str, resource_locator) |
std::string | urdf_file = std::string(TESSERACT_SUPPORT_DIR) + "/urdf/lbr_iiwa_14_r820.urdf" |
tesseract_common::TesseractSupportResourceLocator | locator |
auto | g = tesseract_urdf::parseURDFFile(urdf_file, locator) |
auto | path = g->getShortestPath("link_1", "link_4") |
tesseract_scene_graph::Link::Ptr | link_0 = std::make_shared<tesseract_scene_graph::Link>("link_0") |
tesseract_scene_graph::Link::Ptr | link_1 = std::make_shared<tesseract_scene_graph::Link>("link_1") |
tesseract_scene_graph::Joint::Ptr | joint_0 = std::make_shared<tesseract_scene_graph::Joint>("joint_0") |
joint_0 | type = tesseract_scene_graph::JointType::FIXED |
joint_0 | parent_link_name = link_0->getName() |
joint_0 | child_link_name = link_1->getName() |
bool | success = true |
try | |
catch | ( | ... | ) |
EXPECT_ANY_THROW | ( | tesseract_urdf::parseURDFString(str, resource_locator) | ) |
EXPECT_EQ | ( | sg-> | getLink("l1") ->visual->material->getName()[0], |
"test_material" | |||
) |
EXPECT_TRUE | ( | g-> | getJoints).size( = =9 | ) |
EXPECT_TRUE | ( | g-> | isTree() | ) |
EXPECT_TRUE | ( | sg ! | = nullptr | ) |
EXPECT_TRUE | ( | sg-> | getJoints).size( = =1 | ) |
EXPECT_TRUE | ( | sg-> | getName() = ="test" | ) |
EXPECT_TRUE | ( | success | ) |
g saveDOT | ( | tesseract_common::getTempPath()+"tesseract_urdf_import.dot" | ) |
std::cout<< path<< std::endl;EXPECT_TRUE(path.links.size()==4);EXPECT_TRUE(std::find(path.links.begin(), path.links.end(), "link_1") !=path.links.end());EXPECT_TRUE(std::find(path.links.begin(), path.links.end(), "link_2") !=path.links.end());EXPECT_TRUE(std::find(path.links.begin(), path.links.end(), "link_3") !=path.links.end());EXPECT_TRUE(std::find(path.links.begin(), path.links.end(), "link_4") !=path.links.end());EXPECT_TRUE(path.joints.size()==3);EXPECT_TRUE(std::find(path.joints.begin(), path.joints.end(), "joint_a2") !=path.joints.end());EXPECT_TRUE(std::find(path.joints.begin(), path.joints.end(), "joint_a3") !=path.joints.end());EXPECT_TRUE(std::find(path.joints.begin(), path.joints.end(), "joint_a4") !=path.joints.end());} { { tesseract_scene_graph::SceneGraph::Ptr sg=nullptr;bool success=true;try { tesseract_urdf::writeURDFFile(sg, "/tmp/", "urdf0.urdf");} catch(...) { success=false;} EXPECT_FALSE(success);} { tesseract_scene_graph::SceneGraph::Ptr sg=std::make_shared< tesseract_scene_graph::SceneGraph > | ( | ) |
sg addJoint * joint_0 = std::make_shared<tesseract_scene_graph::Joint>("joint_0") |
sg addLink * link_0 = std::make_shared<tesseract_scene_graph::Link>("link_0") |
sg addLink * link_1 = std::make_shared<tesseract_scene_graph::Link>("link_1") |
tesseract_scene_graph::SceneGraph::Ptr sg = tesseract_urdf::parseURDFString(str, resource_locator) |
bool success = true |
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP |
try |
std::string urdf_file = std::string(TESSERACT_SUPPORT_DIR) + "/urdf/lbr_iiwa_14_r820.urdf" |