Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
tesseract_geometry_unit.cpp File Reference
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <algorithm>
#include <memory>
#include <octomap/octomap.h>
#include <tesseract_geometry/geometries.h>
#include <tesseract_geometry/mesh_parser.h>
Include dependency graph for tesseract_geometry_unit.cpp:

Classes

struct  TestPointCloud
 
struct  TestPointCloud::point
 

Typedefs

using T = tesseract_geometry::PolygonMesh
 

Functions

 EXPECT_NEAR (geom->getX(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getX(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getY(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getZ(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getRadius(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getLength(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getA(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getB(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getC(), 1, 1e-5)
 
 EXPECT_NEAR (std::static_pointer_cast< T >(geom_clone) ->getD(), 1, 1e-5)
 
vertices emplace_back (1, 1, 0)
 
vertices emplace_back (1, -1, 0)
 
vertices emplace_back (-1, -1, 0)
 
faces resize (5)
 
 EXPECT_TRUE (geom->getVertices() !=nullptr)
 
 EXPECT_TRUE (geom->getFaces() !=nullptr)
 
 EXPECT_TRUE (geom->getVertexCount()==4)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getVertices() !=nullptr)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getFaces() !=nullptr)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getVertexCount()==4)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getFaceCount()==1)
 
faces resize (8)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getMaterial()==nullptr)
 
 EXPECT_TRUE (geom->getMaterial() !=nullptr)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getMaterial() !=nullptr)
 
 EXPECT_TRUE (geom->getOctree() !=nullptr)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getOctree() !=nullptr)
 
 EXPECT_TRUE (std::static_pointer_cast< T >(geom_clone) ->getSubType()==tesseract_geometry::Octree::SubType::BOX)
 
 EXPECT_TRUE (meshes.size()==1)
 
 EXPECT_TRUE (meshes[0]->getFaceCount()==80)
 
 EXPECT_TRUE (meshes[1]->getFaceCount()==80)
 
 EXPECT_TRUE (convex_meshes.size()==1)
 
 EXPECT_TRUE (convex_meshes[0]->getFaceCount()==6)
 
int main (int argc, char **argv)
 

Variables

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP
 
std::shared_ptr< const Eigen::VectorXi > faces = std::make_shared<const Eigen::VectorXi>()
 
auto box = std::make_shared<tesseract_geometry::Box>(1, 1, 1)
 
auto cone = std::make_shared<tesseract_geometry::Cone>(1, 1)
 
auto cylinder = std::make_shared<tesseract_geometry::Cylinder>(1, 1)
 
auto capsule = std::make_shared<tesseract_geometry::Capsule>(1, 1)
 
auto plane = std::make_shared<tesseract_geometry::Plane>(1, 1, 1, 1)
 
auto sphere = std::make_shared<tesseract_geometry::Sphere>(1)
 
auto convex_mesh = std::make_shared<tesseract_geometry::ConvexMesh>(vertices, faces)
 
auto mesh = std::make_shared<tesseract_geometry::Mesh>(vertices, faces)
 
auto sdf_mesh = std::make_shared<tesseract_geometry::SDFMesh>(vertices, faces)
 
auto octree = std::make_shared<tesseract_geometry::Octree>(nullptr, tesseract_geometry::Octree::SubType::BOX)
 
TestPointCloud pc
 
auto octree_pc
 
auto geom = std::make_shared<T>(1, 1, 1)
 
auto geom_clone = geom->clone()
 
std::string mesh_file = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl"
 
std::vector< Mesh::Ptr > meshes = createMeshFromPath<Mesh>(mesh_file)
 
std::vector< ConvexMesh::Ptr > convex_meshes
 

Typedef Documentation

◆ T

Function Documentation

◆ emplace_back() [1/3]

vertices emplace_back ( 1,
1,
 
)

◆ emplace_back() [2/3]

vertices emplace_back ( ,
1,
 
)

◆ emplace_back() [3/3]

vertices emplace_back ( ,
,
 
)
Initial value:
{
auto vertices = std::make_shared<tesseract_common::VectorVector3d>()

◆ EXPECT_NEAR() [1/10]

EXPECT_NEAR ( geom->  getX(),
,
1e-  5 
)

◆ EXPECT_NEAR() [2/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getA(,
,
1e-  5 
)

◆ EXPECT_NEAR() [3/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getB(,
,
1e-  5 
)

◆ EXPECT_NEAR() [4/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getC(,
,
1e-  5 
)

◆ EXPECT_NEAR() [5/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getD(,
,
1e-  5 
)

◆ EXPECT_NEAR() [6/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getLength(,
,
1e-  5 
)

◆ EXPECT_NEAR() [7/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getRadius(,
,
1e-  5 
)

◆ EXPECT_NEAR() [8/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getX(,
,
1e-  5 
)

◆ EXPECT_NEAR() [9/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getY(,
,
1e-  5 
)

◆ EXPECT_NEAR() [10/10]

EXPECT_NEAR ( std::static_pointer_cast< T geom_clone) ->getZ(,
,
1e-  5 
)

◆ EXPECT_TRUE() [1/18]

EXPECT_TRUE ( convex_meshes.  size() = =1)

◆ EXPECT_TRUE() [2/18]

EXPECT_TRUE ( convex_meshes->  getFaceCount()[0] = =6)

◆ EXPECT_TRUE() [3/18]

EXPECT_TRUE ( geom->getFaces() !  = nullptr)

◆ EXPECT_TRUE() [4/18]

EXPECT_TRUE ( geom->getMaterial() !  = nullptr)

◆ EXPECT_TRUE() [5/18]

EXPECT_TRUE ( geom->getOctree() !  = nullptr)

◆ EXPECT_TRUE() [6/18]

EXPECT_TRUE ( geom->  getVertexCount() = =4)

◆ EXPECT_TRUE() [7/18]

EXPECT_TRUE ( geom->getVertices() !  = nullptr)
Initial value:
{
auto geom = std::make_shared<T>(vertices, faces)
std::shared_ptr< const Eigen::VectorXi > faces
Definition: tesseract_geometry_unit.cpp:16
auto geom
Definition: tesseract_geometry_unit.cpp:51

◆ EXPECT_TRUE() [8/18]

EXPECT_TRUE ( meshes.  size() = =1)

◆ EXPECT_TRUE() [9/18]

EXPECT_TRUE ( meshes->  getFaceCount()[0] = =80)

◆ EXPECT_TRUE() [10/18]

EXPECT_TRUE ( meshes->  getFaceCount()[1] = =80)

◆ EXPECT_TRUE() [11/18]

EXPECT_TRUE ( std::static_pointer_cast< T geom_clone) ->getFaceCount( = =1)

◆ EXPECT_TRUE() [12/18]

EXPECT_TRUE ( std::static_pointer_cast< T >(geom_clone) ->getFaces() !  = nullptr)

◆ EXPECT_TRUE() [13/18]

EXPECT_TRUE ( std::static_pointer_cast< T >(geom_clone) ->getMaterial() !  = nullptr)

◆ EXPECT_TRUE() [14/18]

EXPECT_TRUE ( std::static_pointer_cast< T geom_clone) ->getMaterial( = =nullptr)

◆ EXPECT_TRUE() [15/18]

EXPECT_TRUE ( std::static_pointer_cast< T >(geom_clone) ->getOctree() !  = nullptr)

◆ EXPECT_TRUE() [16/18]

EXPECT_TRUE ( std::static_pointer_cast< T geom_clone) ->getSubType( = =tesseract_geometry::Octree::SubType::BOX)

◆ EXPECT_TRUE() [17/18]

EXPECT_TRUE ( std::static_pointer_cast< T geom_clone) ->getVertexCount( = =4)

◆ EXPECT_TRUE() [18/18]

EXPECT_TRUE ( std::static_pointer_cast< T >(geom_clone) ->getVertices() !  = nullptr)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ resize() [1/2]

faces resize ( )

◆ resize() [2/2]

faces resize ( )

Variable Documentation

◆ box

auto box = std::make_shared<tesseract_geometry::Box>(1, 1, 1)

◆ capsule

auto capsule = std::make_shared<tesseract_geometry::Capsule>(1, 1)

◆ cone

auto cone = std::make_shared<tesseract_geometry::Cone>(1, 1)

◆ convex_mesh

auto convex_mesh = std::make_shared<tesseract_geometry::ConvexMesh>(vertices, faces)

◆ convex_meshes

std::vector<ConvexMesh::Ptr> convex_meshes
Initial value:
=
createMeshFromPath<ConvexMesh>(mesh_file, Eigen::Vector3d(1, 1, 1), false, false)
std::string mesh_file
Definition: tesseract_geometry_unit.cpp:305

◆ cylinder

auto cylinder = std::make_shared<tesseract_geometry::Cylinder>(1, 1)

◆ faces

(* faces)(7) = std::make_shared<const Eigen::VectorXi>()

◆ geom

std::vector< tesseract_geometry::SDFMesh::Ptr > geom = std::make_shared<T>(1, 1, 1)

◆ geom_clone

auto geom_clone = geom->clone()

◆ mesh

auto mesh = std::make_shared<tesseract_geometry::Mesh>(vertices, faces)

◆ mesh_file

mesh_file = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl"

◆ meshes

meshes = createMeshFromPath<Mesh>(mesh_file)

◆ octree

◆ octree_pc

auto octree_pc
Initial value:
=
std::make_shared<tesseract_geometry::Octree>(pc, 0.01, tesseract_geometry::Octree::SubType::BOX, false)
@ BOX
Definition: octree.h:50
TestPointCloud pc
Definition: tesseract_geometry_unit.cpp:43

◆ pc

◆ plane

auto plane = std::make_shared<tesseract_geometry::Plane>(1, 1, 1, 1)

◆ sdf_mesh

auto sdf_mesh = std::make_shared<tesseract_geometry::SDFMesh>(vertices, faces)

◆ sphere

auto sphere = std::make_shared<tesseract_geometry::Sphere>(1)

◆ TESSERACT_COMMON_IGNORE_WARNINGS_POP

TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP
Initial value:
{
std::shared_ptr<const tesseract_common::VectorVector3d> vertices =
std::make_shared<const tesseract_common::VectorVector3d>()