Skip to content

Commit

Permalink
Update to latest tesseract
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 15, 2024
1 parent 1314b45 commit 1f916ba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 30 deletions.
18 changes: 2 additions & 16 deletions tesseract_planning_server/src/tesseract_planning_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,22 +317,8 @@ struct TesseractPlanningServer::Implementation

// Generate DOT Graph if requested
if (goal->request.dotgraph)
{
try
{
// Save dot graph
const tesseract_planning::TaskComposerNode& task = planning_server->getTask(plan_future->context->name);
std::stringstream dotgraph;
task.dump(dotgraph, nullptr, plan_future->context->task_infos.getInfoMap());
result.response.dotgraph = dotgraph.str();
}
catch (const std::exception& e)
{
std::ostringstream oss;
oss << "Failed to generated DOT Graph: '" << e.what() << "'!" << std::endl;
ROS_ERROR_STREAM(oss.str());
}
}
result.response.dotgraph = planning_server->getTask(plan_future->context->name)
.getDotgraph(plan_future->context->task_infos.getInfoMap());

try
{
Expand Down
5 changes: 2 additions & 3 deletions tesseract_rosutils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
find_gtest()
find_package(tesseract_support REQUIRED)

add_executable(${PROJECT_NAME}_unit tesseract_rosutils_unit.cpp)
target_link_libraries(${PROJECT_NAME}_unit GTest::GTest GTest::Main Eigen3::Eigen tesseract::tesseract_support tesseract::tesseract_scene_graph tesseract::tesseract_geometry tesseract::tesseract_collision_core tesseract::tesseract_visualization tesseract::tesseract_common tesseract::tesseract_motion_planners_core ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_unit GTest::GTest GTest::Main Eigen3::Eigen tesseract::tesseract_scene_graph tesseract::tesseract_geometry tesseract::tesseract_collision_core tesseract::tesseract_visualization tesseract::tesseract_common tesseract::tesseract_motion_planners_core ${PROJECT_NAME})
target_compile_options(${PROJECT_NAME}_unit PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_clang_tidy(${PROJECT_NAME}_unit ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_unit PUBLIC VERSION 17)
add_gtest_discover_tests(${PROJECT_NAME}_unit)

add_executable(${PROJECT_NAME}_geometry_msg_conversions tesseract_rosutils_geometry_msg_conversions.cpp)
target_link_libraries(${PROJECT_NAME}_geometry_msg_conversions GTest::GTest GTest::Main Eigen3::Eigen tesseract::tesseract_support tesseract::tesseract_scene_graph tesseract::tesseract_geometry tesseract::tesseract_collision_core tesseract::tesseract_visualization tesseract::tesseract_common tesseract::tesseract_motion_planners_core ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}_geometry_msg_conversions GTest::GTest GTest::Main Eigen3::Eigen tesseract::tesseract_scene_graph tesseract::tesseract_geometry tesseract::tesseract_collision_core tesseract::tesseract_visualization tesseract::tesseract_common tesseract::tesseract_motion_planners_core ${PROJECT_NAME})
target_compile_options(${PROJECT_NAME}_geometry_msg_conversions PRIVATE ${TESSERACT_COMPILE_OPTIONS})
target_clang_tidy(${PROJECT_NAME}_geometry_msg_conversions ARGUMENTS ${TESSERACT_CLANG_TIDY_ARGS} ENABLE ${TESSERACT_ENABLE_CLANG_TIDY})
target_cxx_version(${PROJECT_NAME}_geometry_msg_conversions PUBLIC VERSION 17)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <gtest/gtest.h>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_common/resource_locator.h>
#include <tesseract_common/unit_test_utils.h>
#include <tesseract_common/utils.h>
#include <tesseract_geometry/geometries.h>
#include <tesseract_geometry/impl/octree_utils.h>
#include <tesseract_geometry/mesh_parser.h>
#include <tesseract_support/tesseract_support_resource_locator.h>

#include <tesseract_msgs/Geometry.h>
#include <tesseract_rosutils/utils.h>
Expand Down Expand Up @@ -78,8 +78,8 @@ TEST(TesseractRosutilsGeometryMsgConversions, Cone) // NOLINT

TEST(TesseractRosutilsGeometryMsgConversions, ConvexMesh) // NOLINT
{
std::string path = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl";
tesseract_common::TesseractSupportResourceLocator locator;
tesseract_common::GeneralResourceLocator locator;
std::string path = locator.locateResource("package://tesseract_support/meshes/sphere_p25m.stl")->getFilePath();
auto object = tesseract_geometry::createMeshFromResource<tesseract_geometry::ConvexMesh>(
locator.locateResource(path), Eigen::Vector3d(.1, .2, .3), true, true, true, true, true);
testToMsgFromMsg(*object.back());
Expand All @@ -93,8 +93,8 @@ TEST(TesseractRosutilsGeometryMsgConversions, Cylinder) // NOLINT

TEST(TesseractRosutilsGeometryMsgConversions, Mesh) // NOLINT
{
std::string path = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl";
tesseract_common::TesseractSupportResourceLocator locator;
tesseract_common::GeneralResourceLocator locator;
std::string path = locator.locateResource("package://tesseract_support/meshes/sphere_p25m.stl")->getFilePath();
auto object = tesseract_geometry::createMeshFromResource<tesseract_geometry::Mesh>(
locator.locateResource(path), Eigen::Vector3d(.1, .2, .3), true, true, true, true, true);
testToMsgFromMsg(*object.back());
Expand Down Expand Up @@ -141,17 +141,17 @@ TEST(TesseractRosutilsGeometryMsgConversions, Plane) // NOLINT

TEST(TesseractRosutilsGeometryMsgConversions, PolygonMesh) // NOLINT
{
std::string path = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl";
tesseract_common::TesseractSupportResourceLocator locator;
tesseract_common::GeneralResourceLocator locator;
std::string path = locator.locateResource("package://tesseract_support/meshes/sphere_p25m.stl")->getFilePath();
auto object = tesseract_geometry::createMeshFromResource<tesseract_geometry::PolygonMesh>(
locator.locateResource(path), Eigen::Vector3d(.1, .2, .3), true, true, true, true, true);
testToMsgFromMsg(*object.back());
}

TEST(TesseractRosutilsGeometryMsgConversions, SDFMesh) // NOLINT
{
std::string path = std::string(TESSERACT_SUPPORT_DIR) + "/meshes/sphere_p25m.stl";
tesseract_common::TesseractSupportResourceLocator locator;
tesseract_common::GeneralResourceLocator locator;
std::string path = locator.locateResource("package://tesseract_support/meshes/sphere_p25m.stl")->getFilePath();
auto object = tesseract_geometry::createMeshFromResource<tesseract_geometry::SDFMesh>(
locator.locateResource(path), Eigen::Vector3d(.1, .2, .3), true, true, true, true, true);
testToMsgFromMsg(*object.back());
Expand Down
6 changes: 4 additions & 2 deletions tesseract_rosutils/test/tesseract_rosutils_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class TesseractROSUtilsUnit : public ::testing::Test
{
auto locator = std::make_shared<ROSResourceLocator>();
env_ = std::make_shared<Environment>();
boost::filesystem::path urdf_path(std::string(TESSERACT_SUPPORT_DIR) + "/urdf/abb_irb2400.urdf");
boost::filesystem::path srdf_path(std::string(TESSERACT_SUPPORT_DIR) + "/urdf/abb_irb2400.srdf");
boost::filesystem::path urdf_path(
locator->locateResource("package://tesseract_support/urdf/abb_irb2400.urdf")->getFilePath());
boost::filesystem::path srdf_path(
locator->locateResource("package://tesseract_support/urdf/abb_irb2400.srdf")->getFilePath());
EXPECT_TRUE(env_->init(urdf_path, srdf_path, locator));
}
};
Expand Down

0 comments on commit 1f916ba

Please sign in to comment.