Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Functions | Variables
tesseract_urdf_mesh_material_unit.cpp File Reference
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <Eigen/Geometry>
#include <tesseract_urdf/mesh.h>
#include <tesseract_geometry/impl/mesh.h>
#include <tesseract_support/tesseract_support_resource_locator.h>
#include "tesseract_urdf_common_unit.h"
Include dependency graph for tesseract_urdf_mesh_material_unit.cpp:

Functions

 EXPECT_TRUE (runTest< std::vector< tesseract_geometry::Mesh::Ptr > >(meshes, &tesseract_urdf::parseMesh, str, "mesh", resource_locator, 2, true))
 
 EXPECT_TRUE (meshes.size()==4)
 
 EXPECT_EQ (mesh0->getFaceCount(), 34)
 
 EXPECT_EQ (mesh0->getVertexCount(), 68)
 
 EXPECT_EQ (mesh1->getFaceCount(), 15)
 
 EXPECT_EQ (mesh1->getVertexCount(), 17)
 
 EXPECT_EQ (mesh2->getFaceCount(), 15)
 
 EXPECT_EQ (mesh2->getVertexCount(), 17)
 
 EXPECT_EQ (mesh3->getFaceCount(), 2)
 
 EXPECT_EQ (mesh3->getVertexCount(), 4)
 
 ASSERT_TRUE (mesh0_normals !=nullptr)
 
 EXPECT_EQ (mesh0_normals->size(), 68)
 
 ASSERT_TRUE (mesh1_normals !=nullptr)
 
 EXPECT_EQ (mesh1_normals->size(), 17)
 
 ASSERT_TRUE (mesh2_normals !=nullptr)
 
 EXPECT_EQ (mesh2_normals->size(), 17)
 
 ASSERT_TRUE (mesh3_normals !=nullptr)
 
 EXPECT_EQ (mesh3_normals->size(), 4)
 
 EXPECT_TRUE (mesh0_material->getBaseColorFactor().isApprox(Eigen::Vector4d(0.7, 0.7, 0.7, 1), 0.01))
 
 EXPECT_NEAR (mesh0_material->getMetallicFactor(), 0.0, 0.01)
 
 EXPECT_TRUE (mesh0_material->getEmissiveFactor().isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01))
 
 EXPECT_TRUE (mesh1_material->getBaseColorFactor().isApprox(Eigen::Vector4d(0.8, 0, 0, 1), 0.01))
 
 EXPECT_NEAR (mesh1_material->getMetallicFactor(), 0.0, 0.01)
 
 EXPECT_TRUE (mesh1_material->getEmissiveFactor().isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01))
 
 EXPECT_TRUE (mesh2_material->getBaseColorFactor().isApprox(Eigen::Vector4d(0.05, 0.8, 0.05, 1), 0.01))
 
 EXPECT_NEAR (mesh2_material->getMetallicFactor(), 0.0, 0.01)
 
 EXPECT_TRUE (mesh2_material->getEmissiveFactor().isApprox(Eigen::Vector4d(0.1, 0.1, 0.5, 1), 0.01))
 
 EXPECT_TRUE (mesh3_material->getBaseColorFactor().isApprox(Eigen::Vector4d(1, 1, 1, 1), 0.01))
 
 EXPECT_NEAR (mesh3_material->getMetallicFactor(), 0, 0.01)
 
 EXPECT_NEAR (mesh3_material->getRoughnessFactor(), 0.5, 0.01)
 
 EXPECT_TRUE (mesh3_material->getEmissiveFactor().isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01))
 
 EXPECT_TRUE (mesh0->getTextures()==nullptr)
 
 EXPECT_TRUE (mesh1->getTextures()==nullptr)
 
 EXPECT_TRUE (mesh2->getTextures()==nullptr)
 
 ASSERT_TRUE (mesh3->getTextures() !=nullptr)
 
 ASSERT_EQ (mesh3->getTextures() ->size(), 1)
 
 EXPECT_EQ (texture->getTextureImage() ->getResourceContents().size(), 38212)
 
 EXPECT_EQ (texture->getUVs() ->size(), 4)
 

Variables

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP
 
std::vector< tesseract_geometry::Mesh::Ptrmeshes
 
automesh0 = meshes[1]
 
automesh1 = meshes[2]
 
automesh2 = meshes[3]
 
automesh3 = meshes[0]
 
auto mesh0_normals = mesh0->getNormals()
 
auto mesh1_normals = mesh1->getNormals()
 
auto mesh2_normals = mesh2->getNormals()
 
auto mesh3_normals = mesh3->getNormals()
 
auto mesh0_material = mesh0->getMaterial()
 
auto mesh1_material = mesh1->getMaterial()
 
auto mesh2_material = mesh2->getMaterial()
 
auto mesh3_material = mesh3->getMaterial()
 
auto texture = mesh3->getTextures()->at(0)
 

Function Documentation

◆ ASSERT_EQ()

ASSERT_EQ ( mesh3->  getTextures) ->size(,
 
)

◆ ASSERT_TRUE() [1/5]

ASSERT_TRUE ( mesh0_normals = nullptr)

◆ ASSERT_TRUE() [2/5]

ASSERT_TRUE ( mesh1_normals = nullptr)

◆ ASSERT_TRUE() [3/5]

ASSERT_TRUE ( mesh2_normals = nullptr)

◆ ASSERT_TRUE() [4/5]

ASSERT_TRUE ( mesh3->getTextures() !  = nullptr)

◆ ASSERT_TRUE() [5/5]

ASSERT_TRUE ( mesh3_normals = nullptr)

◆ EXPECT_EQ() [1/14]

EXPECT_EQ ( mesh0->  getFaceCount(),
34   
)

◆ EXPECT_EQ() [2/14]

EXPECT_EQ ( mesh0->  getVertexCount(),
68   
)

◆ EXPECT_EQ() [3/14]

EXPECT_EQ ( mesh0_normals->  size(),
68   
)

◆ EXPECT_EQ() [4/14]

EXPECT_EQ ( mesh1->  getFaceCount(),
15   
)

◆ EXPECT_EQ() [5/14]

EXPECT_EQ ( mesh1->  getVertexCount(),
17   
)

◆ EXPECT_EQ() [6/14]

EXPECT_EQ ( mesh1_normals->  size(),
17   
)

◆ EXPECT_EQ() [7/14]

EXPECT_EQ ( mesh2->  getFaceCount(),
15   
)

◆ EXPECT_EQ() [8/14]

EXPECT_EQ ( mesh2->  getVertexCount(),
17   
)

◆ EXPECT_EQ() [9/14]

EXPECT_EQ ( mesh2_normals->  size(),
17   
)

◆ EXPECT_EQ() [10/14]

EXPECT_EQ ( mesh3->  getFaceCount(),
 
)

◆ EXPECT_EQ() [11/14]

EXPECT_EQ ( mesh3->  getVertexCount(),
 
)

◆ EXPECT_EQ() [12/14]

EXPECT_EQ ( mesh3_normals->  size(),
 
)

◆ EXPECT_EQ() [13/14]

EXPECT_EQ ( texture->  getTextureImage) ->getResourceContents().size(,
38212   
)

◆ EXPECT_EQ() [14/14]

EXPECT_EQ ( texture->  getUVs) ->size(,
 
)

◆ EXPECT_NEAR() [1/5]

EXPECT_NEAR ( mesh0_material->  getMetallicFactor(),
0.  0,
0.  01 
)

◆ EXPECT_NEAR() [2/5]

EXPECT_NEAR ( mesh1_material->  getMetallicFactor(),
0.  0,
0.  01 
)

◆ EXPECT_NEAR() [3/5]

EXPECT_NEAR ( mesh2_material->  getMetallicFactor(),
0.  0,
0.  01 
)

◆ EXPECT_NEAR() [4/5]

EXPECT_NEAR ( mesh3_material->  getMetallicFactor(),
,
0.  01 
)

◆ EXPECT_NEAR() [5/5]

EXPECT_NEAR ( mesh3_material->  getRoughnessFactor(),
0.  5,
0.  01 
)

◆ EXPECT_TRUE() [1/13]

EXPECT_TRUE ( mesh0->  getTextures() = =nullptr)

◆ EXPECT_TRUE() [2/13]

EXPECT_TRUE ( mesh0_material->  getBaseColorFactor).isApprox(Eigen::Vector4d(0.7, 0.7, 0.7, 1), 0.01)

◆ EXPECT_TRUE() [3/13]

EXPECT_TRUE ( mesh0_material->  getEmissiveFactor).isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01)

◆ EXPECT_TRUE() [4/13]

EXPECT_TRUE ( mesh1->  getTextures() = =nullptr)

◆ EXPECT_TRUE() [5/13]

EXPECT_TRUE ( mesh1_material->  getBaseColorFactor).isApprox(Eigen::Vector4d(0.8, 0, 0, 1), 0.01)

◆ EXPECT_TRUE() [6/13]

EXPECT_TRUE ( mesh1_material->  getEmissiveFactor).isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01)

◆ EXPECT_TRUE() [7/13]

EXPECT_TRUE ( mesh2->  getTextures() = =nullptr)

◆ EXPECT_TRUE() [8/13]

EXPECT_TRUE ( mesh2_material->  getBaseColorFactor).isApprox(Eigen::Vector4d(0.05, 0.8, 0.05, 1), 0.01)

◆ EXPECT_TRUE() [9/13]

EXPECT_TRUE ( mesh2_material->  getEmissiveFactor).isApprox(Eigen::Vector4d(0.1, 0.1, 0.5, 1), 0.01)

◆ EXPECT_TRUE() [10/13]

EXPECT_TRUE ( mesh3_material->  getBaseColorFactor).isApprox(Eigen::Vector4d(1, 1, 1, 1), 0.01)

◆ EXPECT_TRUE() [11/13]

EXPECT_TRUE ( mesh3_material->  getEmissiveFactor).isApprox(Eigen::Vector4d(0, 0, 0, 1), 0.01)

◆ EXPECT_TRUE() [12/13]

EXPECT_TRUE ( meshes.  size() = =4)

◆ EXPECT_TRUE() [13/13]

EXPECT_TRUE ( runTest< std::vector< tesseract_geometry::Mesh::Ptr > >  meshes, &tesseract_urdf::parseMesh, str, "mesh", resource_locator, 2, true)

Variable Documentation

◆ mesh0

auto& mesh0 = meshes[1]

◆ mesh0_material

auto mesh0_material = mesh0->getMaterial()

◆ mesh0_normals

auto mesh0_normals = mesh0->getNormals()

◆ mesh1

auto& mesh1 = meshes[2]

◆ mesh1_material

auto mesh1_material = mesh1->getMaterial()

◆ mesh1_normals

auto mesh1_normals = mesh1->getNormals()

◆ mesh2

auto& mesh2 = meshes[3]

◆ mesh2_material

auto mesh2_material = mesh2->getMaterial()

◆ mesh2_normals

auto mesh2_normals = mesh2->getNormals()

◆ mesh3

auto& mesh3 = meshes[0]

◆ mesh3_material

auto mesh3_material = mesh3->getMaterial()

◆ mesh3_normals

auto mesh3_normals = mesh3->getNormals()

◆ meshes

std::vector<tesseract_geometry::Mesh::Ptr> meshes
Initial value:
{
std::string str = R"(<mesh filename="package://tesseract_support/meshes/tesseract_material_mesh.dae"/>)"
std::string str
Definition: tesseract_srdf_unit.cpp:925

◆ TESSERACT_COMMON_IGNORE_WARNINGS_POP

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP
Initial value:
{
Abstract class for resource loaders.
Definition: tesseract_support_resource_locator.h:42

◆ texture

auto texture = mesh3->getTextures()->at(0)