Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest tesseract #124

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -269,22 +269,8 @@ void TesseractPlanningServer::onMotionPlanningCallback(

// 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;
RCLCPP_ERROR_STREAM(node_->get_logger(), oss.str());
}
}
result->response.dotgraph = planning_server_->getTask(plan_future->context->name)
.getDotgraph(plan_future->context->task_infos.getInfoMap());

try
{
Expand Down
7 changes: 3 additions & 4 deletions tesseract_rosutils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
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)
add_gtest_discover_tests(${PROJECT_NAME}_geometry_msg_conversions)
add_gtest_discover_tests(${PROJECT_NAME}_geometry_msg_conversions)
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/msg/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 @@ -39,8 +39,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
Loading