From 1fd07b5bd8b7f1fb3f7f2c6f12e42eb522d7aa1b Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 14:50:22 -0500 Subject: [PATCH 01/33] Work on Python update Dec 2024 --- dependencies.rosinstall | 10 ++--- dependencies_with_ext.rosinstall | 10 ++--- tesseract_python/CMakeLists.txt | 38 ++++++++++++------- .../composite_instruction.i | 8 ++-- .../swig/tesseract_collision_python.i | 7 +++- .../swig/tesseract_command_language_python.i | 11 +++++- .../swig/tesseract_common_python.i | 8 +++- .../swig/tesseract_environment_python.i | 11 ++++++ .../swig/tesseract_kinematics_python.i | 11 +++--- ...sseract_motion_planners_descartes_python.i | 23 +++++++++++ .../tesseract_motion_planners_ompl_python.i | 28 ++++++++++++-- .../swig/tesseract_motion_planners_python.i | 14 +++++++ .../tesseract_motion_planners_simple_python.i | 20 ++++++++++ ...tesseract_motion_planners_trajopt_python.i | 35 ++++++++++++++--- .../swig/tesseract_task_composer_python.i | 11 ++---- tesseract_python/swig/tesseract_urdf_python.i | 1 + .../swig/tesseract_visualization_python.i | 9 +++++ .../swig/trajopt/problem_description.i | 29 +++++++------- .../test_iterative_spline.py | 20 +++++++--- .../test_ompl_planner.py | 2 +- .../test_time_optimal_trajectory.py | 10 +++-- .../test_trajopt_planner.py | 2 +- .../test_tesseract_scene_graph.py | 16 ++++---- 23 files changed, 247 insertions(+), 87 deletions(-) diff --git a/dependencies.rosinstall b/dependencies.rosinstall index da2bdbd0c..ac6fbfcc4 100644 --- a/dependencies.rosinstall +++ b/dependencies.rosinstall @@ -1,23 +1,23 @@ - git: local-name: ros_industrial_cmake_boilerplate uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: 0.5.4 + version: 0.6.2 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.21.5 + version: 0.26.0 - git: local-name: tesseract_planning uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.21.6 + version: 0.26.1 - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.7.0 + version: 0.26.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git - version: 0.4.2 + version: 0.4.3 - git: local-name: opw_kinematics uri: https://github.com/Jmeyer1292/opw_kinematics.git diff --git a/dependencies_with_ext.rosinstall b/dependencies_with_ext.rosinstall index 246e9414c..970b12fa2 100644 --- a/dependencies_with_ext.rosinstall +++ b/dependencies_with_ext.rosinstall @@ -1,23 +1,23 @@ - git: local-name: ros_industrial_cmake_boilerplate uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: 0.5.4 + version: 0.6.2 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.21.5 + version: 0.26.0 - git: local-name: tesseract_planning uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.21.6 + version: 0.26.1 - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.7.0 + version: 0.26.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git - version: 0.4.2 + version: 0.4.3 - git: local-name: opw_kinematics uri: https://github.com/Jmeyer1292/opw_kinematics.git diff --git a/tesseract_python/CMakeLists.txt b/tesseract_python/CMakeLists.txt index 9f664a734..0197969de 100644 --- a/tesseract_python/CMakeLists.txt +++ b/tesseract_python/CMakeLists.txt @@ -40,7 +40,7 @@ find_package(tesseract_kinematics REQUIRED) # find_package(TinyXML2 REQUIRED) # find_package(opw_kinematics REQUIRED) -find_package(tesseract_task_composer REQUIRED) +find_package(tesseract_task_composer REQUIRED COMPONENTS core planning taskflow) if(NOT TinyXML2_INCLUDE_DIRS AND TARGET tinyxml2::tinyxml2) get_target_property(TinyXML2_INCLUDE_DIRS tinyxml2::tinyxml2 INTERFACE_INCLUDE_DIRECTORIES) @@ -49,6 +49,8 @@ endif() tesseract_variables() +find_bullet() + include_directories( ${trajopt_INCLUDE_DIRS} ${tesseract_common_INCLUDE_DIRS} @@ -87,19 +89,29 @@ message(STATUS "Building Python Version: " ${PYTHON_VERSION_MAJOR}) # Find NumPy find_path(NUMPY_INCLUDE_NDARRAYOBJECT_DIR numpy/ndarrayobject.h PATHS ${PYTHON_INCLUDE_DIRS} NO_DEFAULT_PATH) -if (NUMPY_INCLUDE_NDARRAYOBJECT_DIR) -set(NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_NDARRAYOBJECT_DIR}) +if(NUMPY_INCLUDE_NDARRAYOBJECT_DIR) + set(NUMPY_INCLUDE_DIR ${NUMPY_INCLUDE_NDARRAYOBJECT_DIR}) else() -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; import os; print(os.path.dirname(numpy.__file__) + '/core/include')" RESULT_VARIABLE FIND_NUMPY_RESULT OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ) -string(STRIP "${NUMPY_INCLUDE_DIR}" NUMPY_INCLUDE_DIR) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; import os; print(os.path.dirname(numpy.__file__))" + RESULT_VARIABLE FIND_NUMPY_RESULT OUTPUT_VARIABLE NUMPY_INCLUDE_DIR1) + string(STRIP "${NUMPY_INCLUDE_DIR1}" NUMPY_INCLUDE_DIR1) + + if(${FIND_NUMPY_RESULT}) + message(FATAL_ERROR "Could not determine NumPy include directory") + endif() + + if(EXISTS "${NUMPY_INCLUDE_DIR1}/core/include/numpy/ndarrayobject.h") + set(NUMPY_INCLUDE_DIR "${NUMPY_INCLUDE_DIR1}/core/include") + else() + if(EXISTS "${NUMPY_INCLUDE_DIR1}/_core/include/numpy/ndarrayobject.h") + set(NUMPY_INCLUDE_DIR "${NUMPY_INCLUDE_DIR1}/_core/include") + endif() + endif() -if(${FIND_NUMPY_RESULT}) -message(FATAL_ERROR "Could not determine NumPy include directory") -endif() endif() -if (NOT EXISTS "${NUMPY_INCLUDE_DIR}/numpy/ndarrayobject.h") -message(FATAL_ERROR "Could not find numpy/ndarrayobject.h include file") +if(NOT EXISTS "${NUMPY_INCLUDE_DIR}/numpy/ndarrayobject.h") + message(FATAL_ERROR "Could not find numpy/ndarrayobject.h include file") endif() message(STATUS "NumPy Include Directory: ${NUMPY_INCLUDE_DIR}") @@ -122,12 +134,12 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/tesseract_python_module.cmake) tesseract_python_module(tesseract_common_python SWIG_SRCS swig/tesseract_common_python.i PACKAGE tesseract_common LIBS tesseract::tesseract_common ) tesseract_python_module(tesseract_geometry_python SWIG_SRCS swig/tesseract_geometry_python.i PACKAGE tesseract_geometry LIBS tesseract::tesseract_geometry ) -tesseract_python_module(tesseract_collision_python SWIG_SRCS swig/tesseract_collision_python.i PACKAGE tesseract_collision LIBS tesseract::tesseract_collision_core tesseract::tesseract_collision_bullet_factories tesseract::tesseract_collision_fcl_factories ) +tesseract_python_module(tesseract_collision_python SWIG_SRCS swig/tesseract_collision_python.i PACKAGE tesseract_collision LIBS tesseract::tesseract_collision_core Bullet3::Bullet ) # tesseract::tesseract_collision_bullet_factories tesseract::tesseract_collision_fcl_factories ) tesseract_python_module(tesseract_scene_graph_python SWIG_SRCS swig/tesseract_scene_graph_python.i PACKAGE tesseract_scene_graph LIBS tesseract::tesseract_scene_graph ) tesseract_python_module(tesseract_srdf_python SWIG_SRCS swig/tesseract_srdf_python.i PACKAGE tesseract_srdf LIBS tesseract::tesseract_srdf ) tesseract_python_module(tesseract_urdf_python SWIG_SRCS swig/tesseract_urdf_python.i PACKAGE tesseract_urdf LIBS tesseract::tesseract_urdf ) tesseract_python_module(tesseract_state_solver_python SWIG_SRCS swig/tesseract_state_solver_python.i PACKAGE tesseract_state_solver LIBS tesseract::tesseract_state_solver_core tesseract::tesseract_state_solver_ofkt tesseract::tesseract_state_solver_kdl) -tesseract_python_module(tesseract_kinematics_python SWIG_SRCS swig/tesseract_kinematics_python.i PACKAGE tesseract_kinematics LIBS tesseract::tesseract_kinematics_kdl_factories tesseract::tesseract_kinematics_ur_factory tesseract::tesseract_kinematics_opw_factory tesseract::tesseract_kinematics_core_factories tesseract::tesseract_kinematics_core ) +tesseract_python_module(tesseract_kinematics_python SWIG_SRCS swig/tesseract_kinematics_python.i PACKAGE tesseract_kinematics LIBS tesseract::tesseract_kinematics_core )# tesseract::tesseract_kinematics_kdl_factories tesseract::tesseract_kinematics_ur_factory tesseract::tesseract_kinematics_opw_factory tesseract::tesseract_kinematics_core_factories ) tesseract_python_module(tesseract_environment_python SWIG_SRCS swig/tesseract_environment_python.i PACKAGE tesseract_environment LIBS tesseract::tesseract_environment ) tesseract_python_module(tesseract_visualization_python SWIG_SRCS swig/tesseract_visualization_python.i PACKAGE tesseract_visualization LIBS tesseract::tesseract_visualization) tesseract_python_module(tesseract_command_language_python SWIG_SRCS swig/tesseract_command_language_python.i PACKAGE tesseract_command_language LIBS tesseract::tesseract_command_language) @@ -137,7 +149,7 @@ tesseract_python_module(tesseract_motion_planners_trajopt_python SWIG_SRCS swig/ tesseract_python_module(tesseract_motion_planners_ompl_python SWIG_SRCS swig/tesseract_motion_planners_ompl_python.i PACKAGE tesseract_motion_planners_ompl LIBS tesseract::tesseract_motion_planners_ompl ) tesseract_python_module(tesseract_motion_planners_descartes_python SWIG_SRCS swig/tesseract_motion_planners_descartes_python.i PACKAGE tesseract_motion_planners_descartes LIBS tesseract::tesseract_motion_planners_descartes ) tesseract_python_module(tesseract_time_parameterization_python SWIG_SRCS swig/tesseract_time_parameterization_python.i PACKAGE tesseract_time_parameterization LIBS tesseract::tesseract_time_parameterization_core tesseract::tesseract_time_parameterization_isp tesseract::tesseract_time_parameterization_totg tesseract::tesseract_time_parameterization_ruckig) -tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning tesseract::tesseract_task_composer_taskflow_factories ) +# tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow ) # tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning tesseract::tesseract_task_composer_taskflow_factories ) set(TESSERACT_PYTHON_MODULE_TARGETS _tesseract_common_python diff --git a/tesseract_python/swig/rework_include/tesseract_command_language/composite_instruction.i b/tesseract_python/swig/rework_include/tesseract_command_language/composite_instruction.i index 7da0598a3..b59cd5f1b 100644 --- a/tesseract_python/swig/rework_include/tesseract_command_language/composite_instruction.i +++ b/tesseract_python/swig/rework_include/tesseract_command_language/composite_instruction.i @@ -16,7 +16,7 @@ public: CompositeInstruction(std::string profile = DEFAULT_PROFILE_KEY, CompositeInstructionOrder order = CompositeInstructionOrder::ORDERED, - ManipulatorInfo manipulator_info = ManipulatorInfo()); + tesseract_common::ManipulatorInfo manipulator_info = tesseract_common::ManipulatorInfo()); CompositeInstructionOrder getOrder() const; @@ -36,9 +36,9 @@ public: void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides); ProfileDictionary::ConstPtr getProfileOverrides() const; - void setManipulatorInfo(ManipulatorInfo info); - const ManipulatorInfo& getManipulatorInfo() const; - ManipulatorInfo& getManipulatorInfo(); + void setManipulatorInfo(tesseract_common::ManipulatorInfo info); + const tesseract_common::ManipulatorInfo& getManipulatorInfo() const; + tesseract_common::ManipulatorInfo& getManipulatorInfo(); void setInstructions(std::vector instructions); std::vector& getInstructions(); diff --git a/tesseract_python/swig/tesseract_collision_python.i b/tesseract_python/swig/tesseract_collision_python.i index 9c348aa64..05142cddd 100644 --- a/tesseract_python/swig/tesseract_collision_python.i +++ b/tesseract_python/swig/tesseract_collision_python.i @@ -93,12 +93,15 @@ class ContactResult; // %ignore ContactResultMap; // tesseract_collision #define TESSERACT_COLLISION_CORE_PUBLIC +%ignore tesseract_collision::ContactTrajectoryResults::trajectoryCollisionResultsTable; +%ignore tesseract_collision::ContactTrajectoryResults::collisionFrequencyPerLink; %include "tesseract_collision/core/types.h" %include "tesseract_collision/core/discrete_contact_manager.h" %include "tesseract_collision/core/continuous_contact_manager.h" %include "tesseract_collision/core/contact_managers_plugin_factory.h" %init %{ -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_bullet::BulletFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_fcl::FCLFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); +// TODO: fix anchors +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_bullet::BulletFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_fcl::FCLFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); %} diff --git a/tesseract_python/swig/tesseract_command_language_python.i b/tesseract_python/swig/tesseract_command_language_python.i index 345cd1a65..264e81788 100644 --- a/tesseract_python/swig/tesseract_command_language_python.i +++ b/tesseract_python/swig/tesseract_command_language_python.i @@ -36,6 +36,9 @@ %{ +// tesseract_common +#include + // tesseract_command_language #include #include @@ -57,7 +60,7 @@ #include #include #include -#include +#include #include @@ -77,6 +80,10 @@ %include "tesseract_type_erasure_macros.i" +#define TESSERACT_CARTESIAN_WAYPOINT_EXPORT_KEY(a,b) +#define TESSERACT_STATE_WAYPOINT_EXPORT_KEY(a,b) +#define TESSERACT_INSTRUCTION_EXPORT_KEY(a,b) + %define %tesseract_erasure_ctor_planning(source_class_type,dest_class_type) %tesseract_erasure_ctor(source_class_type,tesseract_planning,dest_class_type,tesseract_planning); %enddef @@ -132,7 +139,7 @@ const tesseract_planning::TYPE as_const_ ## TYPE() {return $self->as #include #include +#include #include "tesseract_common_python_std_functions.h" @@ -166,6 +167,8 @@ namespace std #define BOOST_SERIALIZATION_ASSUME_ABSTRACT(a) #define BOOST_CONCEPT_ASSERT(a) +#define TESSERACT_ANY_EXPORT_KEY(a,b) + #define EIGEN_MAKE_ALIGNED_OPERATOR_NEW #define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #define TESSERACT_COMMON_IGNORE_WARNINGS_POP @@ -204,6 +207,7 @@ namespace std %include "tesseract_common/allowed_collision_matrix.h" %include "tesseract_common/kinematic_limits.h" %include "tesseract_common/timer.h" +%include "tesseract_common/filesystem.h" // TODO: ? @@ -250,8 +254,8 @@ namespace std %} } -%template(isWithinPositionLimits) tesseract_common::isWithinPositionLimits; -%template(satisfiesPositionLimits) tesseract_common::satisfiesPositionLimits; +%template(isWithinLimits) tesseract_common::isWithinLimits; +%template(satisfiesLimits) tesseract_common::satisfiesLimits; //%template(enforcePositionLimits) tesseract_common::enforcePositionLimits; %ignore tesseract_common::TypeErasureInterface::clone; diff --git a/tesseract_python/swig/tesseract_environment_python.i b/tesseract_python/swig/tesseract_environment_python.i index 4fd38a3cf..171b29d70 100644 --- a/tesseract_python/swig/tesseract_environment_python.i +++ b/tesseract_python/swig/tesseract_environment_python.i @@ -54,6 +54,15 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_collision +#include +#include +#include + // tesseract_environment #include #include @@ -162,6 +171,8 @@ %shared_ptr(tesseract_environment::Environment) %wrap_unique_ptr(EnvironmentUPtr,tesseract_environment::Environment) +%ignore tesseract_environment::Environment::Environment(std::unique_ptr impl); + %include "tesseract_environment/environment.h" %inline { diff --git a/tesseract_python/swig/tesseract_kinematics_python.i b/tesseract_python/swig/tesseract_kinematics_python.i index 927b735df..98d5be48a 100644 --- a/tesseract_python/swig/tesseract_kinematics_python.i +++ b/tesseract_python/swig/tesseract_kinematics_python.i @@ -131,11 +131,12 @@ struct KinGroupIKInput; %init %{ -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::REPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::ROPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::KDLFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::OPWFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::URFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +// TODO: fix anchors +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::REPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::ROPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::KDLFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::OPWFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::URFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); diff --git a/tesseract_python/swig/tesseract_motion_planners_descartes_python.i b/tesseract_python/swig/tesseract_motion_planners_descartes_python.i index 90302c7b4..e474742d3 100644 --- a/tesseract_python/swig/tesseract_motion_planners_descartes_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_descartes_python.i @@ -57,6 +57,28 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_command_language +#include +#include +#include +#include + +// tesseract_motion_planners +#include +#include + +// tesseract_visualization +#include + #include "tesseract_command_language_python_std_functions.h" #include "tesseract_command_language_python_profile_dictionary_functions.h" @@ -91,6 +113,7 @@ namespace tesseract_planning {using DescartesPlanProfileMapD = std::unordered_ma %pythondynamic tesseract_planning::DescartesMotionPlanner; %shared_ptr(tesseract_planning::DescartesMotionPlannerD); %shared_ptr(tesseract_planning::DescartesMotionPlanner); +%ignore tesseract_planning::DescartesMotionPlanner::clone; %include "tesseract_motion_planners/descartes/descartes_motion_planner.h" %template(DescartesMotionPlannerD) tesseract_planning::DescartesMotionPlanner; diff --git a/tesseract_python/swig/tesseract_motion_planners_ompl_python.i b/tesseract_python/swig/tesseract_motion_planners_ompl_python.i index 5458bed17..3b311d8b3 100644 --- a/tesseract_python/swig/tesseract_motion_planners_ompl_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_ompl_python.i @@ -43,6 +43,27 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_command_language +#include +#include +#include +#include + +// tesseract_motion_planners +#include +#include + +// tesseract_visualization +#include #include #include @@ -106,18 +127,19 @@ %shared_ptr(tesseract_planning::OMPLPlanProfile) %include "tesseract_motion_planners/ompl/profile/ompl_profile.h" -%template(OMPLPlanProfileMap) std::unordered_map>; +// %template(OMPLPlanProfileMap) std::unordered_map>; %tesseract_command_language_add_profile_type(OMPLPlanProfile); %shared_ptr(tesseract_planning::OMPLDefaultPlanProfile) %ignore tesseract_planning::OMPLDefaultPlanProfile::allocWeightedRealVectorStateSampler; %include "tesseract_motion_planners/ompl/profile/ompl_default_plan_profile.h" -%tesseract_std_function_base(OMPLProblemGeneratorFn,tesseract_planning,std::vector>,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::OMPLPlanProfileMap&,c); -%tesseract_std_function(OMPLProblemGeneratorFn,tesseract_planning,std::vector>,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::OMPLPlanProfileMap&,c); +// %tesseract_std_function_base(OMPLProblemGeneratorFn,tesseract_planning,std::vector>,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::OMPLPlanProfileMap&,c); +// %tesseract_std_function(OMPLProblemGeneratorFn,tesseract_planning,std::vector>,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::OMPLPlanProfileMap&,c); %pythondynamic tesseract_planning::OMPLMotionPlanner; %shared_ptr(tesseract_planning::OMPLMotionPlanner) +%ignore tesseract_planning::OMPLMotionPlanner::clone; %include "tesseract_motion_planners/ompl/ompl_motion_planner.h" %include "tesseract_motion_planners/ompl/serialize.h" %include "tesseract_motion_planners/ompl/deserialize.h" diff --git a/tesseract_python/swig/tesseract_motion_planners_python.i b/tesseract_python/swig/tesseract_motion_planners_python.i index c7d6e567a..36bcbfa71 100644 --- a/tesseract_python/swig/tesseract_motion_planners_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_python.i @@ -50,6 +50,19 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_command_language +#include +#include + #include "tesseract_environment_python_std_functions.h" %} @@ -64,6 +77,7 @@ %include "tesseract_motion_planners/core/types.h" %shared_ptr(tesseract_planning::MotionPlanner) +%wrap_unique_ptr(MotionPlannerUPtr,tesseract_planning::MotionPlanner) %include "tesseract_motion_planners/core/planner.h" %include "tesseract_motion_planners/core/utils.h" diff --git a/tesseract_python/swig/tesseract_motion_planners_simple_python.i b/tesseract_python/swig/tesseract_motion_planners_simple_python.i index 85e2ec721..c4059ca83 100644 --- a/tesseract_python/swig/tesseract_motion_planners_simple_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_simple_python.i @@ -54,6 +54,25 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_command_language +#include +#include +#include +#include + +// tesseract_motion_planners +#include +#include + #include "tesseract_environment_python_std_functions.h" #include "tesseract_command_language_python_profile_dictionary_functions.h" @@ -87,4 +106,5 @@ %pythondynamic tesseract_planning::SimpleMotionPlanner; %shared_ptr(tesseract_planning::SimpleMotionPlanner) +%ignore tesseract_planning::SimpleMotionPlanner::clone; %include "tesseract_motion_planners/simple/simple_motion_planner.h" diff --git a/tesseract_python/swig/tesseract_motion_planners_trajopt_python.i b/tesseract_python/swig/tesseract_motion_planners_trajopt_python.i index af1f2348f..d68e7b620 100644 --- a/tesseract_python/swig/tesseract_motion_planners_trajopt_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_trajopt_python.i @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,28 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_command_language +#include +#include +#include +#include + +// tesseract_motion_planners +#include +#include + +// tesseract_visualization +#include + #include "tesseract_command_language_python_std_functions.h" #include "tesseract_command_language_python_profile_dictionary_functions.h" @@ -72,21 +95,22 @@ // Including trajopt headers is too noisy, use *.i file instead %include "trajopt/problem_description.i" -%tesseract_std_function_base(TrajOptProblemGeneratorFn,tesseract_planning,std::shared_ptr,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::TrajOptPlanProfileMap&,c,const tesseract_planning::TrajOptCompositeProfileMap&,d,const tesseract_planning::TrajOptSolverProfileMap&,e); -%tesseract_std_function(TrajOptProblemGeneratorFn,tesseract_planning,std::shared_ptr,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::TrajOptPlanProfileMap&,c,const tesseract_planning::TrajOptCompositeProfileMap&,d,const tesseract_planning::TrajOptSolverProfileMap&,e); +// %tesseract_std_function_base(TrajOptProblemGeneratorFn,tesseract_planning,std::shared_ptr,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::TrajOptPlanProfileMap&,c,const tesseract_planning::TrajOptCompositeProfileMap&,d,const tesseract_planning::TrajOptSolverProfileMap&,e); +// %tesseract_std_function(TrajOptProblemGeneratorFn,tesseract_planning,std::shared_ptr,const std::string&,a,const tesseract_planning::PlannerRequest&,b,const tesseract_planning::TrajOptPlanProfileMap&,c,const tesseract_planning::TrajOptCompositeProfileMap&,d,const tesseract_planning::TrajOptSolverProfileMap&,e); // tesseract_motion_planners_trajopt #define TESSERACT_MOTION_PLANNERS_TRAJOPT_PUBLIC %include "tesseract_motion_planners/trajopt/trajopt_collision_config.h" +%include "tesseract_motion_planners/trajopt/trajopt_waypoint_config.h" %shared_ptr(tesseract_planning::TrajOptPlanProfile) %shared_ptr(tesseract_planning::TrajOptSolverProfile) %shared_ptr(tesseract_planning::TrajOptCompositeProfile) %include "tesseract_motion_planners/trajopt/profile/trajopt_profile.h" -%template(TrajOptSolverProfileMap) std::unordered_map>; -%template(TrajOptCompositeProfileMap) std::unordered_map>; -%template(TrajOptPlanProfileMap) std::unordered_map>; +// %template(TrajOptSolverProfileMap) std::unordered_map>; +// %template(TrajOptCompositeProfileMap) std::unordered_map>; +// %template(TrajOptPlanProfileMap) std::unordered_map>; %tesseract_command_language_add_profile_type(TrajOptSolverProfile); %tesseract_command_language_add_profile_type(TrajOptPlanProfile); %tesseract_command_language_add_profile_type(TrajOptCompositeProfile); @@ -106,6 +130,7 @@ %pythondynamic tesseract_planning::TrajOptMotionPlanner; %shared_ptr(tesseract_planning::TrajOptMotionPlanner) +%ignore tesseract_planning::TrajOptMotionPlanner::clone; %include "tesseract_motion_planners/trajopt/trajopt_motion_planner.h" %include "tesseract_motion_planners/trajopt/serialize.h" %include "tesseract_motion_planners/trajopt/deserialize.h" diff --git a/tesseract_python/swig/tesseract_task_composer_python.i b/tesseract_python/swig/tesseract_task_composer_python.i index 642c82cba..ba6c152f4 100644 --- a/tesseract_python/swig/tesseract_task_composer_python.i +++ b/tesseract_python/swig/tesseract_task_composer_python.i @@ -162,7 +162,7 @@ // task_composer_problem -%include "tesseract_task_composer/core/task_composer_problem.h" +// %include "tesseract_task_composer/core/task_composer_problem.h" // task_composer_context %s_u_ptr(TaskComposerContext) @@ -229,7 +229,7 @@ enum class future_status { %include "tesseract_task_composer/core/task_composer_server.h" // planning_task_composer_problem -%s_u_ptr(PlanningTaskComposerProblem) +/*%s_u_ptr(PlanningTaskComposerProblem) %include "tesseract_task_composer/planning/planning_task_composer_problem.h" %unique_ptr_as_planning(PlanningTaskComposerProblem, TaskComposerProblem); @@ -260,12 +260,7 @@ enum class future_status { %unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(tesseract_environment::Environment::ConstPtr env, tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, std::string name = "unset"), - %arg(env, profiles, name)); - -// check_input_profile -%shared_ptr(tesseract_planning::CheckInputProfile) -%include "tesseract_task_composer/planning/profiles/check_input_profile.h" -%tesseract_command_language_add_profile_type(CheckInputProfile); + %arg(env, profiles, name));*/ // contact_check_profile %shared_ptr(tesseract_planning::ContactCheckProfile) diff --git a/tesseract_python/swig/tesseract_urdf_python.i b/tesseract_python/swig/tesseract_urdf_python.i index 035cd5e69..4a33ee01b 100644 --- a/tesseract_python/swig/tesseract_urdf_python.i +++ b/tesseract_python/swig/tesseract_urdf_python.i @@ -45,6 +45,7 @@ #include #include +#include // tesseract_urdf #include diff --git a/tesseract_python/swig/tesseract_visualization_python.i b/tesseract_python/swig/tesseract_visualization_python.i index af70ccf86..a94f59af1 100644 --- a/tesseract_python/swig/tesseract_visualization_python.i +++ b/tesseract_python/swig/tesseract_visualization_python.i @@ -59,6 +59,15 @@ #include #include +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + #include "tesseract_environment_python_std_functions.h" %} diff --git a/tesseract_python/swig/trajopt/problem_description.i b/tesseract_python/swig/trajopt/problem_description.i index 395bceabc..00ebb0919 100644 --- a/tesseract_python/swig/trajopt/problem_description.i +++ b/tesseract_python/swig/trajopt/problem_description.i @@ -160,11 +160,12 @@ class TrajOptProb; struct ProblemConstructionInfo; struct TrajOptResult; -enum TermType +enum class TermType : char { - TT_COST = 0x1, - TT_CNT = 0x2, - TT_USE_TIME = 0x4, + TT_INVALID = 0, // 0000 0000 + TT_COST = 0x1, // 0000 0001 + TT_CNT = 0x2, // 0000 0010 + TT_USE_TIME = 0x4, // 0000 0100 }; class TrajOptProb @@ -182,8 +183,8 @@ public: // VarArray& GetVars(); int GetNumSteps(); int GetNumDOF(); - tesseract_kinematics::JointGroup::ConstPtr GetKin(); - tesseract_environment::Environment::ConstPtr GetEnv(); + std::shared_ptr GetKin(); + std::shared_ptr GetEnv(); void SetInitTraj(const TrajArray& x); TrajArray GetInitTraj(); bool GetHasTime(); @@ -214,12 +215,12 @@ struct BasicInfo struct InitInfo { - enum Type + enum Type : std::uint8_t { STATIONARY, JOINT_INTERPOLATED, GIVEN_TRAJ, - }; + }; Type type; TrajArray data; double dt; @@ -234,13 +235,13 @@ public: using Ptr = std::shared_ptr; std::string name; - int term_type; - int getSupportedTypes(); + TermType term_type; + TermType getSupportedTypes(); virtual void fromJson(ProblemConstructionInfo& pci, const Json::Value& v); virtual void hatch(TrajOptProb& prob); static TermInfo::Ptr fromName(const std::string& type); - typedef TermInfo::Ptr (*MakerFunc)(void); + //static void RegisterMaker(const std::string& type, MakerFunc); virtual ~TermInfo(); }; @@ -254,10 +255,10 @@ public: std::vector cnt_infos; InitInfo init_info; - tesseract_environment::Environment::ConstPtr env; - tesseract_kinematics::JointGroup::ConstPtr kin; + std::shared_ptr env; + std::shared_ptr kin; - ProblemConstructionInfo(tesseract_environment::Environment::ConstPtr env); + ProblemConstructionInfo(std::shared_ptr env); void fromJson(const Json::Value& v); }; diff --git a/tesseract_python/tests/tesseract_motion_planning/test_iterative_spline.py b/tesseract_python/tests/tesseract_motion_planning/test_iterative_spline.py index e74dc90f3..20e6bceb0 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_iterative_spline.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_iterative_spline.py @@ -37,9 +37,13 @@ def test_time_parameterization(): program = create_straight_trajectory() traj = InstructionsTrajectory(program) - max_velocity = np.array([2.088, 2.082, 3.27, 3.6, 3.3, 3.078],dtype=np.float64) - max_acceleration = np.array([ 1, 1, 1, 1, 1, 1],dtype=np.float64) - assert time_parameterization.compute(traj, max_velocity, max_acceleration) + max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) + max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) + max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) + max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) + assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) res_instr1 = InstructionPoly_as_MoveInstructionPoly(program[-1]) WaypointPoly_as_StateWaypointPoly(res_instr1.getWaypoint()).getTime() > 1.0 res_instr2 = InstructionPoly_as_MoveInstructionPoly(program[-1]) @@ -51,9 +55,13 @@ def test_time_parameterization_vec(): program = create_straight_trajectory() traj = InstructionsTrajectory(program) - max_velocity = np.array([2.088, 2.082, 3.27, 3.6, 3.3, 3.078],dtype=np.float64) - max_acceleration = np.array([ 1, 1, 1, 1, 1, 1],dtype=np.float64) - assert time_parameterization.compute(traj, max_velocity, max_acceleration) + max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) + max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) + max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) + max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) + assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) res_instr1 = InstructionPoly_as_MoveInstructionPoly(program[-1]) WaypointPoly_as_StateWaypointPoly(res_instr1.getWaypoint()).getTime() > 1.0 res_instr2 = InstructionPoly_as_MoveInstructionPoly(program[-1]) diff --git a/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py b/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py index d870674c2..4c8bb3a0c 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py @@ -16,7 +16,7 @@ MoveInstructionPoly_wrap_MoveInstruction from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse from tesseract_robotics.tesseract_motion_planners_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator, \ - OMPLProblemGeneratorFn, OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile + OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram from ..tesseract_support_resource_locator import TesseractSupportResourceLocator diff --git a/tesseract_python/tests/tesseract_motion_planning/test_time_optimal_trajectory.py b/tesseract_python/tests/tesseract_motion_planning/test_time_optimal_trajectory.py index 069013efd..92453a5b6 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_time_optimal_trajectory.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_time_optimal_trajectory.py @@ -36,9 +36,13 @@ def test_time_parameterization(): program = create_straight_trajectory() traj = InstructionsTrajectory(program) - max_velocity = np.array([2.088, 2.082, 3.27, 3.6, 3.3, 3.078],dtype=np.float64) - max_acceleration = np.array([ 1, 1, 1, 1, 1, 1],dtype=np.float64) - assert time_parameterization.computeTimeStamps(traj, max_velocity, max_acceleration) + max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) + max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) + max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) + max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) + max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) + assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) instr1 = program[-1] instr1_1 = InstructionPoly_as_MoveInstructionPoly(instr1) result_wp1 = instr1_1.getWaypoint() diff --git a/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py b/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py index 69e173a08..bd367f44e 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py @@ -16,7 +16,7 @@ MoveInstructionPoly_wrap_MoveInstruction from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse from tesseract_robotics.tesseract_motion_planners_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \ - TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ + TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ ProfileDictionary_addProfile_TrajOptCompositeProfile from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram diff --git a/tesseract_python/tests/tesseract_scene_graph/test_tesseract_scene_graph.py b/tesseract_python/tests/tesseract_scene_graph/test_tesseract_scene_graph.py index a593cb698..cef42d135 100644 --- a/tesseract_python/tests/tesseract_scene_graph/test_tesseract_scene_graph.py +++ b/tesseract_python/tests/tesseract_scene_graph/test_tesseract_scene_graph.py @@ -38,7 +38,7 @@ def test_tesseract_scene_graph(): joint_2.parent_link_name = "link_2" joint_2.child_link_name = "link_3" joint_2.type = sg.JointType_PLANAR - joint_2.limits = sg.JointLimits(-1,1,1,1,1) + joint_2.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_2) joint_3 = sg.Joint("joint_3") @@ -53,7 +53,7 @@ def test_tesseract_scene_graph(): joint_4.parent_link_name = "link_2" joint_4.child_link_name = "link_5" joint_4.type = sg.JointType_REVOLUTE - joint_4.limits = sg.JointLimits(-1,1,1,1,1) + joint_4.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_4) adjacent_links = g.getAdjacentLinkNames("link_3") @@ -165,7 +165,7 @@ def test_load_srdf_unit(): joint_2.parent_link_name = "link_1" joint_2.child_link_name = "link_2" joint_2.type = sg.JointType_REVOLUTE - joint_2.limits = sg.JointLimits(-1,1,1,1,1) + joint_2.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_2) joint_3 = sg.Joint("joint_a3") @@ -173,7 +173,7 @@ def test_load_srdf_unit(): joint_3.parent_link_name = "link_2" joint_3.child_link_name = "link_3" joint_3.type = sg.JointType_REVOLUTE - joint_3.limits = sg.JointLimits(-1,1,1,1,1) + joint_3.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_3) joint_4 = sg.Joint("joint_a4") @@ -181,7 +181,7 @@ def test_load_srdf_unit(): joint_4.parent_link_name = "link_3" joint_4.child_link_name = "link_4" joint_4.type = sg.JointType_REVOLUTE - joint_4.limits = sg.JointLimits(-1,1,1,1,1) + joint_4.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_4) joint_5 = sg.Joint("joint_a5") @@ -189,7 +189,7 @@ def test_load_srdf_unit(): joint_5.parent_link_name = "link_4" joint_5.child_link_name = "link_5" joint_5.type = sg.JointType_REVOLUTE - joint_5.limits = sg.JointLimits(-1,1,1,1,1) + joint_5.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_5) joint_6 = sg.Joint("joint_a6") @@ -197,7 +197,7 @@ def test_load_srdf_unit(): joint_6.parent_link_name = "link_5" joint_6.child_link_name = "link_6" joint_6.type = sg.JointType_REVOLUTE - joint_6.limits = sg.JointLimits(-1,1,1,1,1) + joint_6.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_6) joint_7 = sg.Joint("joint_a7") @@ -205,7 +205,7 @@ def test_load_srdf_unit(): joint_7.parent_link_name = "link_6" joint_7.child_link_name = "link_7" joint_7.type = sg.JointType_REVOLUTE - joint_7.limits = sg.JointLimits(-1,1,1,1,1) + joint_7.limits = sg.JointLimits(-1,1,1,1,1,1) assert g.addJoint(joint_7) joint_tool0 = sg.Joint("base_joint") From 2c3e93513807cd05b834be112bf1ff4c00066691 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 14:52:26 -0500 Subject: [PATCH 02/33] Use actions/upload-artifact@v4 --- .github/workflows/wheels.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c7cbc5b70..b6fd442bd 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -149,12 +149,12 @@ jobs: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ws/install/lib cmake --build . --config Release --target tesseract_python_doc - name: archive wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'python-wheels-${{ matrix.config.os }}-${{ matrix.config.python_version }}' path: ws/build/tesseract_python/python/* - name: archive docs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'python-docs-${{ matrix.config.os }}-${{ matrix.config.python_version }}' path: ws/build/tesseract_python/docs/* @@ -263,13 +263,13 @@ jobs: if %errorlevel% neq 0 exit /b %errorlevel% - name: archive wheels if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'python-wheels-win-${{matrix.config.python_version}}' path: ws/build/tesseract_python/python - name: archive logs if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'build-logs-win-${{ matrix.config.arch }}-python-${{ matrix.config.python_version }}' path: "**/*.log" @@ -347,13 +347,13 @@ jobs: pytest -s - name: archive wheels if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'python-macos-win-${{matrix.config.python_version}}' path: ws/build/tesseract_python/python - name: archive logs if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'build-logs-macos-${{ matrix.config.arch }}-python-${{ matrix.config.python_version }}' path: "**/*.log" @@ -373,7 +373,7 @@ jobs: with: path: artifacts/main - name: archive wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: 'python-wheels-all' path: artifacts/**/wheelhouse/*.whl From ebf0970eb0099855df785df98f01f94e7d82db73 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 15:22:43 -0500 Subject: [PATCH 03/33] Update dep links --- dependencies.rosinstall | 6 +++--- dependencies_with_ext.rosinstall | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies.rosinstall b/dependencies.rosinstall index ac6fbfcc4..fc940bea3 100644 --- a/dependencies.rosinstall +++ b/dependencies.rosinstall @@ -5,11 +5,11 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.26.0 + version: master - git: local-name: tesseract_planning - uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.26.1 + uri: https://github.com/johnwason/tesseract_planning.git + version: dev/win_build_failure - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git diff --git a/dependencies_with_ext.rosinstall b/dependencies_with_ext.rosinstall index 970b12fa2..0b0fd425b 100644 --- a/dependencies_with_ext.rosinstall +++ b/dependencies_with_ext.rosinstall @@ -5,11 +5,11 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.26.0 + version: master - git: local-name: tesseract_planning - uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.26.1 + uri: https://github.com/johnwason/tesseract_planning.git + version: dev/win_build_failure - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git From 2b2c6548ce81cbb61a8d450606e2100f538e2fe7 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 15:26:17 -0500 Subject: [PATCH 04/33] dev --- tesseract_python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tesseract_python/CMakeLists.txt b/tesseract_python/CMakeLists.txt index 0197969de..69f018391 100644 --- a/tesseract_python/CMakeLists.txt +++ b/tesseract_python/CMakeLists.txt @@ -169,7 +169,7 @@ set(TESSERACT_PYTHON_MODULE_TARGETS _tesseract_motion_planners_ompl_python _tesseract_motion_planners_descartes_python _tesseract_time_parameterization_python - _tesseract_task_composer_python + # _tesseract_task_composer_python ) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py" @ONLY) From cfae20110ebdcad2c1523726d9c5e0aa72dc0b60 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 15:46:58 -0500 Subject: [PATCH 05/33] apt-get libfcl-dev --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b6fd442bd..6bb2994ff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -93,7 +93,7 @@ jobs: liburdfdom-dev liboctomap-dev liborocos-kdl-dev libpcl-dev libflann-dev libjsoncpp-dev libyaml-cpp-dev git cmake ninja-build build-essential autoconf automake libtool bison libpcre2-dev libpcre3-dev - lcov libbullet-dev libbullet-extras-dev python3-venv curl -y -qq + lcov libbullet-dev libbullet-extras-dev python3-venv curl libfcl-dev -y -qq - name: build-swig uses: johnwason/swig-build-action@v1 with: From f899311993685a8011f6c124d2300b5d24cdaa16 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 15:48:09 -0500 Subject: [PATCH 06/33] vcpkg use latest release --- .github/workflows/wheels.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6bb2994ff..6537b815d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -206,7 +206,6 @@ jobs: extra-args: --clean-after-build token: ${{ github.token }} cache-key: win-${{ matrix.config.arch }}-python-${{ matrix.config.python_version }} - revision: master - name: pip3 run: | python -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool @@ -302,7 +301,6 @@ jobs: extra-args: --clean-after-build --overlay-triplets=${{ github.workspace }}/ws/src/tesseract_python/.github/workflows/vcpkg_triplets token: ${{ github.token }} cache-key: osx-x64-vcpkg - revision: master - name: pip3 run: | python3 -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool delocate From 6b05d61f591e4c93dc6c57c1a7b42f7637d3ce1b Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 16:19:27 -0500 Subject: [PATCH 07/33] Fix mesh geometry constructors --- tesseract_python/swig/tesseract_common_python.i | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tesseract_python/swig/tesseract_common_python.i b/tesseract_python/swig/tesseract_common_python.i index 2578fff39..c51f76186 100644 --- a/tesseract_python/swig/tesseract_common_python.i +++ b/tesseract_python/swig/tesseract_common_python.i @@ -106,6 +106,8 @@ %template(name) std::unordered_map,std::equal_to,Eigen::aligned_allocator>>; %enddef +using VectorVector3d = std::vector; + %tesseract_aligned_vector(VectorIsometry3d, Eigen::Isometry3d); %template(VectorVector3d) std::vector; %template(VectorVectorXd) std::vector; From ff77b99b88021a88ffc2c05c5c29cbffa7d842b2 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 16:28:14 -0500 Subject: [PATCH 08/33] Use ubuntu 22.04 and windows-2022 --- .github/workflows/wheels.yml | 62 +++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6537b815d..782c5d980 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -30,48 +30,48 @@ jobs: fail-fast: false matrix: config: - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 - python_version: "3.7" - docs: false - docs_cmake: OFF - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 python_version: "3.8" docs: true docs_cmake: ON - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 python_version: "3.9" docs: true docs_cmake: ON - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 python_version: "3.10" docs: true docs_cmake: ON - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 python_version: "3.11.0" docs: true docs_cmake: ON - - os: ubuntu-20.04 - runs_on: ubuntu-20.04 - container: ubuntu:20.04 - py_platform: manylinux_2_31_x86_64 + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 python_version: "3.12.0" docs: true docs_cmake: ON + - os: ubuntu-22.04 + runs_on: ubuntu-22.04 + container: ubuntu:22.04 + py_platform: manylinux_2_35_x86_64 + python_version: "3.13.0" + docs: true + docs_cmake: ON env: DEBIAN_FRONTEND: noninteractive steps: @@ -159,7 +159,7 @@ jobs: name: 'python-docs-${{ matrix.config.os }}-${{ matrix.config.python_version }}' path: ws/build/tesseract_python/docs/* build-win: - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: @@ -188,6 +188,10 @@ jobs: vcpkg_triplet: x64-windows-release cmake_arch: x64 python_version: "3.12.0" + - arch: x64 + vcpkg_triplet: x64-windows-release + cmake_arch: x64 + python_version: "3.13.0" steps: - uses: actions/checkout@v2 with: @@ -361,7 +365,7 @@ jobs: - build-win - build-ubuntu - build-macos - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: From 3f2f818c02bf9e76e96aeb54ccab77023ed79a5c Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 19:24:57 -0500 Subject: [PATCH 09/33] Update tesseract_task_composer module --- tesseract_python/CMakeLists.txt | 4 +- .../swig/tesseract_command_language_python.i | 4 +- .../swig/tesseract_environment_python.i | 4 +- .../swig/tesseract_task_composer_python.i | 60 +++++++++++++++---- .../swig/tesseract_type_erasure_macros.i | 49 +++++++++++++++ .../test_tesseract_task_composer.py | 34 +++++++---- 6 files changed, 128 insertions(+), 27 deletions(-) diff --git a/tesseract_python/CMakeLists.txt b/tesseract_python/CMakeLists.txt index 69f018391..ab959e3e7 100644 --- a/tesseract_python/CMakeLists.txt +++ b/tesseract_python/CMakeLists.txt @@ -149,7 +149,7 @@ tesseract_python_module(tesseract_motion_planners_trajopt_python SWIG_SRCS swig/ tesseract_python_module(tesseract_motion_planners_ompl_python SWIG_SRCS swig/tesseract_motion_planners_ompl_python.i PACKAGE tesseract_motion_planners_ompl LIBS tesseract::tesseract_motion_planners_ompl ) tesseract_python_module(tesseract_motion_planners_descartes_python SWIG_SRCS swig/tesseract_motion_planners_descartes_python.i PACKAGE tesseract_motion_planners_descartes LIBS tesseract::tesseract_motion_planners_descartes ) tesseract_python_module(tesseract_time_parameterization_python SWIG_SRCS swig/tesseract_time_parameterization_python.i PACKAGE tesseract_time_parameterization LIBS tesseract::tesseract_time_parameterization_core tesseract::tesseract_time_parameterization_isp tesseract::tesseract_time_parameterization_totg tesseract::tesseract_time_parameterization_ruckig) -# tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow ) # tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning tesseract::tesseract_task_composer_taskflow_factories ) +tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow tesseract::tesseract_collision_core ) # tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning tesseract::tesseract_task_composer_taskflow_factories ) set(TESSERACT_PYTHON_MODULE_TARGETS _tesseract_common_python @@ -169,7 +169,7 @@ set(TESSERACT_PYTHON_MODULE_TARGETS _tesseract_motion_planners_ompl_python _tesseract_motion_planners_descartes_python _tesseract_time_parameterization_python - # _tesseract_task_composer_python + _tesseract_task_composer_python ) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup.py.in" "${CMAKE_CURRENT_BINARY_DIR}/python/setup.py" @ONLY) diff --git a/tesseract_python/swig/tesseract_command_language_python.i b/tesseract_python/swig/tesseract_command_language_python.i index 264e81788..ee37986ec 100644 --- a/tesseract_python/swig/tesseract_command_language_python.i +++ b/tesseract_python/swig/tesseract_command_language_python.i @@ -227,4 +227,6 @@ const tesseract_planning::TYPE as_const_ ## TYPE() {return $self->as; %enddef -%include "tesseract_command_language/constants.h" \ No newline at end of file +%include "tesseract_command_language/constants.h" + +%tesseract_any_poly_type_shared_ptr(ProfileDictionary,tesseract_planning); diff --git a/tesseract_python/swig/tesseract_environment_python.i b/tesseract_python/swig/tesseract_environment_python.i index 171b29d70..aaf7e29bc 100644 --- a/tesseract_python/swig/tesseract_environment_python.i +++ b/tesseract_python/swig/tesseract_environment_python.i @@ -191,4 +191,6 @@ { return dynamic_cast(a); } -} \ No newline at end of file +} + +%tesseract_any_poly_type_shared_ptr(Environment, tesseract_environment) diff --git a/tesseract_python/swig/tesseract_task_composer_python.i b/tesseract_python/swig/tesseract_task_composer_python.i index ba6c152f4..1f7599847 100644 --- a/tesseract_python/swig/tesseract_task_composer_python.i +++ b/tesseract_python/swig/tesseract_task_composer_python.i @@ -38,6 +38,29 @@ %{ +// tesseract_common +#include + +// tesseract_kinematics +#include +#include + +// tesseract_environment +#include +#include +#include + +// tesseract_collision +#include +#include +#include + +// tesseract_command_language +#include +#include +#include +#include + // tesseract_motion_planners_simple #include #include @@ -84,7 +107,7 @@ // tesseract_task_composer #include #include -#include +//#include #include #include #include @@ -92,8 +115,10 @@ #include #include #include +#include +#include -#include +// #include #include #include @@ -104,7 +129,7 @@ // tesseract_task_composer profiles -#include +// #include #include #include #include @@ -116,7 +141,6 @@ #include - #include #include #include @@ -144,14 +168,22 @@ %unique_ptr_as(source_class_type, tesseract_planning, dest_class_type, tesseract_planning) %enddef +%include "tesseract_task_composer/core/fwd.h" + +// task_composer_keys +%include "tesseract_task_composer/core/task_composer_keys.h" +%template(get) tesseract_planning::TaskComposerKeys::get; + // task_composer_node_info %s_u_ptr(TaskComposerNodeInfo) %s_u_ptr(TaskComposerNodeInfoContainer) -%s_u_ptr(TaskComposerProblem) +// %s_u_ptr(TaskComposerProblem) // TODO: Handle maps containing unique_ptr // %template(MapUuidTaskComposerNodeInfoUPtr) std::map >; %ignore tesseract_planning::TaskComposerNodeInfoContainer::getInfoMap; +%ignore tesseract_planning::TaskComposerNodeInfo::find; +%ignore tesseract_planning::TaskComposerNodeInfoContainer::find; %include "tesseract_task_composer/core/task_composer_node_info.h" // task_composer_data_storage @@ -160,6 +192,8 @@ // TODO: Handle tesseract_common::AnyPoly %include "tesseract_task_composer/core/task_composer_data_storage.h" +%unique_ptr_constructor(tesseract_planning::TaskComposerDataStorage, %arg(), %arg()); + // task_composer_problem // %include "tesseract_task_composer/core/task_composer_problem.h" @@ -222,6 +256,8 @@ enum class future_status { %shared_ptr(tesseract_planning::TaskComposerNodeFactory) %shared_ptr(tesseract_planning::TaskComposerExecutorFactory) +%shared_ptr(tesseract_planning::TaskComposerPluginFactory) + %include "tesseract_task_composer/core/task_composer_plugin_factory.h" // task_composer_server @@ -263,9 +299,10 @@ enum class future_status { %arg(env, profiles, name));*/ // contact_check_profile -%shared_ptr(tesseract_planning::ContactCheckProfile) -%include "tesseract_task_composer/planning/profiles/contact_check_profile.h" -%tesseract_command_language_add_profile_type(ContactCheckProfile); +// TODO: Fix library linking +// %shared_ptr(tesseract_planning::ContactCheckProfile) +// %include "tesseract_task_composer/planning/profiles/contact_check_profile.h" +// %tesseract_command_language_add_profile_type(ContactCheckProfile); // fix_state_bounds_profile %shared_ptr(tesseract_planning::FixStateBoundsProfile) @@ -310,9 +347,10 @@ enum class future_status { %tesseract_command_language_add_profile_type(UpsampleTrajectoryProfile); %init %{ -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerPlanningFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskflowFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); -tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskFactoryAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +// TODO: fix anchors +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerPlanningFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskflowFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskFactoryAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); %} diff --git a/tesseract_python/swig/tesseract_type_erasure_macros.i b/tesseract_python/swig/tesseract_type_erasure_macros.i index 5e1a33714..e22b418cc 100644 --- a/tesseract_python/swig/tesseract_type_erasure_macros.i +++ b/tesseract_python/swig/tesseract_type_erasure_macros.i @@ -7,6 +7,20 @@ } %enddef +%define %tesseract_erasure_ctor_shared_ptr(class_type,class_namespace,inner_type,inner_namespace) +%inline { + class_namespace::class_type class_type ## _wrap_ ## inner_type (std::shared_ptr inner_waypoint) + { + return class_namespace::class_type (inner_waypoint); + } + + class_namespace::class_type class_type ## _wrap_ ## inner_type ## Const (std::shared_ptr inner_waypoint) + { + return class_namespace::class_type (inner_waypoint); + } +} +%enddef + %define %tesseract_erasure_ctor2(class_type,class_namespace,inner_type) %inline { class_namespace::class_type class_type ## _wrap_ ## inner_type (inner_type inner_waypoint) @@ -26,6 +40,21 @@ } %enddef +%define %tesseract_erasure_as_shared_ptr(source_class_type,source_class_namespace,dest_class_type,dest_class_namespace) + +%inline { + std::shared_ptr source_class_type ## _as_ ## dest_class_type (source_class_namespace::source_class_type& self) + { + return self.as>(); + } + + std::shared_ptr source_class_type ## _as_ ## dest_class_type ## Const (source_class_namespace::source_class_type& self) + { + return self.as>(); + } +} +%enddef + %define %tesseract_erasure_as2(source_class_type,source_class_namespace,dest_class_type) %inline { @@ -45,6 +74,20 @@ } %enddef +%define %tesseract_erasure_is_shared_ptr(source_class_type,source_class_namespace,dest_class_type,dest_class_namespace) +%inline { + bool source_class_type ## _is_ ## dest_class_type (const source_class_namespace::source_class_type& self) + { + return self.getType() == typeid(std::shared_ptr); + } + + bool source_class_type ## _is_ ## dest_class_type ## Const (const source_class_namespace::source_class_type& self) + { + return self.getType() == typeid(std::shared_ptr); + } +} +%enddef + %define %tesseract_erasure_is2(source_class_type,source_class_namespace,dest_class_type) %inline { bool source_class_type ## _is_ ## dest_class_type (const source_class_namespace::source_class_type& self) @@ -60,6 +103,12 @@ %tesseract_erasure_is(AnyPoly,tesseract_common,TYPE,NAMESPACE) %enddef +%define %tesseract_any_poly_type_shared_ptr(TYPE,NAMESPACE) +%tesseract_erasure_ctor_shared_ptr(AnyPoly,tesseract_common,TYPE,NAMESPACE) +%tesseract_erasure_as_shared_ptr(AnyPoly,tesseract_common,TYPE,NAMESPACE) +%tesseract_erasure_is_shared_ptr(AnyPoly,tesseract_common,TYPE,NAMESPACE) +%enddef + %define %tesseract_any_poly_type2(TYPE) %tesseract_erasure_ctor2(AnyPoly,tesseract_common,TYPE) %tesseract_erasure_as2(AnyPoly,tesseract_common,TYPE) diff --git a/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py b/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py index 226825cd2..673ebe05e 100644 --- a/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py +++ b/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py @@ -5,7 +5,7 @@ import numpy.testing as nptest from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource -from tesseract_robotics.tesseract_environment import Environment +from tesseract_robotics.tesseract_environment import Environment, AnyPoly_wrap_EnvironmentConst from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ ManipulatorInfo, AnyPoly, AnyPoly_wrap_double from tesseract_robotics.tesseract_command_language import CartesianWaypoint, WaypointPoly, \ @@ -15,7 +15,8 @@ AnyPoly_wrap_CompositeInstruction, DEFAULT_PROFILE_KEY, JointWaypoint, JointWaypointPoly, \ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint, \ - CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint + CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint, \ + AnyPoly_wrap_ProfileDictionary # from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse, generateInterpolatedProgram # from tesseract_robotics.tesseract_motion_planners_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator, \ @@ -26,7 +27,7 @@ # TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ # ProfileDictionary_addProfile_TrajOptCompositeProfile from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, \ - TaskComposerDataStorage, TaskComposerContext, PlanningTaskComposerProblem + TaskComposerDataStorage, TaskComposerContext, TaskComposerDataStorageUPtr from ..tesseract_support_resource_locator import TesseractSupportResourceLocator @@ -90,22 +91,27 @@ def test_task_composer_trajopt_example(): task = factory.createTaskComposerNode("TrajOptPipeline") print("trajopt task name: " + task.getName()) - output_key = task.getOutputKeys()[0] + output_key = task.getOutputKeys().get("program") + input_key = task.getInputKeys().get("planning_input") profiles = ProfileDictionary() program = freespace_example_progam_iiwa(manip_info) - problem_input = AnyPoly_wrap_CompositeInstruction(program) - - planning_task_problem = PlanningTaskComposerProblem(env, profiles) - planning_task_problem.input = problem_input + problem_anypoly = AnyPoly_wrap_CompositeInstruction(program) + environment_anypoly = AnyPoly_wrap_EnvironmentConst(env) + profiles_anypoly = AnyPoly_wrap_ProfileDictionary(profiles) + task_data = TaskComposerDataStorage() + task_data.setData(input_key, problem_anypoly) + task_data.setData("environment", environment_anypoly) + task_data.setData("profiles", profiles_anypoly) + task_executor = factory.createTaskComposerExecutor("TaskflowExecutor") output_program = None try: - future = task_executor.run(task.get(), planning_task_problem) + future = task_executor.run(task.get(), task_data) future.wait() output_program = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) @@ -124,11 +130,15 @@ def test_task_composer_trajopt_example(): print("Done") finally: - # Cleanup memory to prevent segfault on exit - del planning_task_problem - del output_program + # del planning_task_problem + # del output_program + del task_data + del problem_anypoly + del environment_anypoly + del profiles_anypoly del future del task_executor del task + From 475e99b1074cd620ab99a21f1bc997fe714c551f Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 20:07:37 -0500 Subject: [PATCH 10/33] Fix library anchors on Windows --- tesseract_python/CMakeLists.txt | 45 +++++++++++++++++-- .../swig/tesseract_collision_python.i | 4 +- .../swig/tesseract_kinematics_python.i | 10 ++--- .../swig/tesseract_task_composer_python.i | 13 +++--- 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/tesseract_python/CMakeLists.txt b/tesseract_python/CMakeLists.txt index ab959e3e7..d2e500112 100644 --- a/tesseract_python/CMakeLists.txt +++ b/tesseract_python/CMakeLists.txt @@ -130,16 +130,55 @@ include(FindSWIG) find_package(SWIG 4.1.1 REQUIRED) include(UseSWIG) +macro(tesseract_python_find_target lib_name search_target) + # Find install directory of search_target + + get_target_property(search_target_location ${search_target} LOCATION) + if (NOT WIN32) + get_filename_component(search_target_location_dir ${search_target_location} DIRECTORY) + else() + get_filename_component(search_target_location_dir1 ${search_target_location} DIRECTORY) + get_filename_component(search_target_location_dir2 ${search_target_location_dir1} DIRECTORY) + set(search_target_location_dir "${search_target_location_dir2}/lib") + endif() + # Find library lib_name + unset(lib_name_location) + find_library(lib_name_location ${lib_name} HINTS ${search_target_location_dir} NO_CACHE) + if (NOT lib_name_location) + message(FATAL_ERROR "Could not find library ${lib_name}") + endif() + # Create import target + add_library(tesseract::${lib_name} SHARED IMPORTED) + if (WIN32) + set_target_properties(tesseract::${lib_name} PROPERTIES IMPORTED_IMPLIB_RELWITHDEBINFO ${lib_name_location}) + set_target_properties(tesseract::${lib_name} PROPERTIES IMPORTED_IMPLIB ${lib_name_location}) + set_target_properties(tesseract::${lib_name} PROPERTIES IMPORTED_LOCATION ${lib_name_location}) + else() + set_target_properties(tesseract::${lib_name} PROPERTIES IMPORTED_LOCATION ${lib_name_location}) + endif() +endmacro() + +tesseract_python_find_target(tesseract_collision_fcl_factories tesseract::tesseract_collision_core) +tesseract_python_find_target(tesseract_collision_bullet_factories tesseract::tesseract_collision_core) +tesseract_python_find_target(tesseract_kinematics_kdl_factories tesseract::tesseract_kinematics_core) +tesseract_python_find_target(tesseract_kinematics_ur_factory tesseract::tesseract_kinematics_core) +tesseract_python_find_target(tesseract_kinematics_opw_factory tesseract::tesseract_kinematics_core) +#tesseract_python_find_target(tesseract_kinematics_core_factories tesseract::tesseract_kinematics_core) +tesseract_python_find_target(tesseract_task_composer_factories tesseract::tesseract_task_composer) +tesseract_python_find_target(tesseract_task_composer_planning_factories tesseract::tesseract_task_composer) +# tesseract_python_find_target(tesseract_task_composer_planning_nodes tesseract::tesseract_task_composer) +tesseract_python_find_target(tesseract_task_composer_taskflow_factories tesseract::tesseract_task_composer) + include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/tesseract_python_module.cmake) tesseract_python_module(tesseract_common_python SWIG_SRCS swig/tesseract_common_python.i PACKAGE tesseract_common LIBS tesseract::tesseract_common ) tesseract_python_module(tesseract_geometry_python SWIG_SRCS swig/tesseract_geometry_python.i PACKAGE tesseract_geometry LIBS tesseract::tesseract_geometry ) -tesseract_python_module(tesseract_collision_python SWIG_SRCS swig/tesseract_collision_python.i PACKAGE tesseract_collision LIBS tesseract::tesseract_collision_core Bullet3::Bullet ) # tesseract::tesseract_collision_bullet_factories tesseract::tesseract_collision_fcl_factories ) +tesseract_python_module(tesseract_collision_python SWIG_SRCS swig/tesseract_collision_python.i PACKAGE tesseract_collision LIBS tesseract::tesseract_collision_core Bullet3::Bullet tesseract::tesseract_collision_bullet_factories tesseract::tesseract_collision_fcl_factories ) tesseract_python_module(tesseract_scene_graph_python SWIG_SRCS swig/tesseract_scene_graph_python.i PACKAGE tesseract_scene_graph LIBS tesseract::tesseract_scene_graph ) tesseract_python_module(tesseract_srdf_python SWIG_SRCS swig/tesseract_srdf_python.i PACKAGE tesseract_srdf LIBS tesseract::tesseract_srdf ) tesseract_python_module(tesseract_urdf_python SWIG_SRCS swig/tesseract_urdf_python.i PACKAGE tesseract_urdf LIBS tesseract::tesseract_urdf ) tesseract_python_module(tesseract_state_solver_python SWIG_SRCS swig/tesseract_state_solver_python.i PACKAGE tesseract_state_solver LIBS tesseract::tesseract_state_solver_core tesseract::tesseract_state_solver_ofkt tesseract::tesseract_state_solver_kdl) -tesseract_python_module(tesseract_kinematics_python SWIG_SRCS swig/tesseract_kinematics_python.i PACKAGE tesseract_kinematics LIBS tesseract::tesseract_kinematics_core )# tesseract::tesseract_kinematics_kdl_factories tesseract::tesseract_kinematics_ur_factory tesseract::tesseract_kinematics_opw_factory tesseract::tesseract_kinematics_core_factories ) +tesseract_python_module(tesseract_kinematics_python SWIG_SRCS swig/tesseract_kinematics_python.i PACKAGE tesseract_kinematics LIBS tesseract::tesseract_kinematics_core tesseract::tesseract_kinematics_kdl_factories tesseract::tesseract_kinematics_ur_factory tesseract::tesseract_kinematics_opw_factory tesseract::tesseract_kinematics_core_factories ) tesseract_python_module(tesseract_environment_python SWIG_SRCS swig/tesseract_environment_python.i PACKAGE tesseract_environment LIBS tesseract::tesseract_environment ) tesseract_python_module(tesseract_visualization_python SWIG_SRCS swig/tesseract_visualization_python.i PACKAGE tesseract_visualization LIBS tesseract::tesseract_visualization) tesseract_python_module(tesseract_command_language_python SWIG_SRCS swig/tesseract_command_language_python.i PACKAGE tesseract_command_language LIBS tesseract::tesseract_command_language) @@ -149,7 +188,7 @@ tesseract_python_module(tesseract_motion_planners_trajopt_python SWIG_SRCS swig/ tesseract_python_module(tesseract_motion_planners_ompl_python SWIG_SRCS swig/tesseract_motion_planners_ompl_python.i PACKAGE tesseract_motion_planners_ompl LIBS tesseract::tesseract_motion_planners_ompl ) tesseract_python_module(tesseract_motion_planners_descartes_python SWIG_SRCS swig/tesseract_motion_planners_descartes_python.i PACKAGE tesseract_motion_planners_descartes LIBS tesseract::tesseract_motion_planners_descartes ) tesseract_python_module(tesseract_time_parameterization_python SWIG_SRCS swig/tesseract_time_parameterization_python.i PACKAGE tesseract_time_parameterization LIBS tesseract::tesseract_time_parameterization_core tesseract::tesseract_time_parameterization_isp tesseract::tesseract_time_parameterization_totg tesseract::tesseract_time_parameterization_ruckig) -tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow tesseract::tesseract_collision_core ) # tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning tesseract::tesseract_task_composer_taskflow_factories ) +tesseract_python_module(tesseract_task_composer_python SWIG_SRCS swig/tesseract_task_composer_python.i PACKAGE tesseract_task_composer LIBS tesseract::tesseract_task_composer tesseract::tesseract_task_composer_nodes tesseract::tesseract_task_composer_taskflow tesseract::tesseract_collision_core tesseract::tesseract_task_composer_factories tesseract::tesseract_task_composer_planning_factories tesseract::tesseract_task_composer_planning_nodes tesseract::tesseract_task_composer_taskflow_factories ) set(TESSERACT_PYTHON_MODULE_TARGETS _tesseract_common_python diff --git a/tesseract_python/swig/tesseract_collision_python.i b/tesseract_python/swig/tesseract_collision_python.i index 05142cddd..5f468fddb 100644 --- a/tesseract_python/swig/tesseract_collision_python.i +++ b/tesseract_python/swig/tesseract_collision_python.i @@ -102,6 +102,6 @@ class ContactResult; %init %{ // TODO: fix anchors -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_bullet::BulletFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_fcl::FCLFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_bullet::BulletFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_collision::tesseract_collision_fcl::FCLFactoriesAnchor(), "TESSERACT_CONTACT_MANAGERS_PLUGINS"); %} diff --git a/tesseract_python/swig/tesseract_kinematics_python.i b/tesseract_python/swig/tesseract_kinematics_python.i index 98d5be48a..ad0a7e381 100644 --- a/tesseract_python/swig/tesseract_kinematics_python.i +++ b/tesseract_python/swig/tesseract_kinematics_python.i @@ -132,11 +132,11 @@ struct KinGroupIKInput; %init %{ // TODO: fix anchors -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::REPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::ROPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::KDLFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::OPWFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::URFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::REPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::ROPInvKinFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::KDLFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::OPWFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_kinematics::URFactoriesAnchor(), "TESSERACT_KINEMATICS_PLUGINS"); diff --git a/tesseract_python/swig/tesseract_task_composer_python.i b/tesseract_python/swig/tesseract_task_composer_python.i index 1f7599847..2f162ad21 100644 --- a/tesseract_python/swig/tesseract_task_composer_python.i +++ b/tesseract_python/swig/tesseract_task_composer_python.i @@ -299,10 +299,9 @@ enum class future_status { %arg(env, profiles, name));*/ // contact_check_profile -// TODO: Fix library linking -// %shared_ptr(tesseract_planning::ContactCheckProfile) -// %include "tesseract_task_composer/planning/profiles/contact_check_profile.h" -// %tesseract_command_language_add_profile_type(ContactCheckProfile); +%shared_ptr(tesseract_planning::ContactCheckProfile) +%include "tesseract_task_composer/planning/profiles/contact_check_profile.h" +%tesseract_command_language_add_profile_type(ContactCheckProfile); // fix_state_bounds_profile %shared_ptr(tesseract_planning::FixStateBoundsProfile) @@ -348,9 +347,9 @@ enum class future_status { %init %{ // TODO: fix anchors -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerPlanningFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskflowFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); -// tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskFactoryAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerPlanningFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskflowFactoriesAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); +tesseract_common::PluginLoader::addSymbolLibraryToSearchLibrariesEnv(tesseract_planning::TaskComposerTaskFactoryAnchor(), "TESSERACT_TASK_COMPOSER_PLUGINS"); %} From b95d467c4e493606f09b916f6f8a4d12a0297b34 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 20:10:51 -0500 Subject: [PATCH 11/33] Bump version to 0.5.0 --- tesseract_python/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tesseract_python/package.xml b/tesseract_python/package.xml index a7de48773..f56f55fad 100644 --- a/tesseract_python/package.xml +++ b/tesseract_python/package.xml @@ -1,7 +1,7 @@ tesseract_python - 0.4.0 + 0.5.0 The tesseract_python package John Wason Apache 2.0 From 49f3d4f621bd2e41ce445df7fb5a46e67c217fd8 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 20:19:04 -0500 Subject: [PATCH 12/33] Use macos-13 to build x64 wheel --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 782c5d980..fa4106d87 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -278,7 +278,7 @@ jobs: path: "**/*.log" retention-days: 2 build-macos: - runs-on: macos-latest + runs-on: macos-13 strategy: fail-fast: false matrix: From 70a1a8362a6041f5be74cd7ed3a5271ef368220b Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 20:21:43 -0500 Subject: [PATCH 13/33] Use MSVC 2022 vsdevcmd --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index fa4106d87..6eaf96320 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -223,7 +223,7 @@ jobs: working-directory: ws shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 + call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1 set CMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }} set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}\bin From f4093f325a40c515768d53a66611e3d3ba958c2d Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 20:44:55 -0500 Subject: [PATCH 14/33] Use MSVC 2022 vsdevcmd --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6eaf96320..0aa551cba 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -223,7 +223,7 @@ jobs: working-directory: ws shell: cmd run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 set CXXFLAGS=%CXXFLAGS% -DEIGEN_DONT_ALIGN=1 -DEIGEN_DONT_VECTORIZE=1 set CMAKE_PREFIX_PATH=%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }} set PATH=%PATH%;%GITHUB_WORKSPACE%\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}\bin From b8ca775bd3175017a0d061d595066c80b88b2521 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 21:23:07 -0500 Subject: [PATCH 15/33] Include boost-stacktrace vcpkg package --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0aa551cba..bb4658020 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -14,6 +14,7 @@ env: VCPKG_PKGS: >- boost-dll boost-program-options boost-serialization boost-filesystem + boost-stacktrace tinyxml2 console-bridge assimp urdfdom octomap orocos-kdl pcl gtest benchmark flann jsoncpp From 2c43395bb4ceaa6a52063be659733e1016bc78d5 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 21:53:54 -0500 Subject: [PATCH 16/33] Fix CompoundMesh --- .../swig/tesseract_geometry_python.i | 6 +- .../test_mesh_material_loading.py | 55 ++++++++++--------- .../test_tesseract_task_composer.py | 1 - 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/tesseract_python/swig/tesseract_geometry_python.i b/tesseract_python/swig/tesseract_geometry_python.i index a8bed139d..4c5876971 100644 --- a/tesseract_python/swig/tesseract_geometry_python.i +++ b/tesseract_python/swig/tesseract_geometry_python.i @@ -145,7 +145,8 @@ $1 = is_array($input); tesseract_geometry::PolygonMesh, tesseract_geometry::Mesh, tesseract_geometry::SDFMesh, - tesseract_geometry::Sphere + tesseract_geometry::Sphere, + tesseract_geometry::CompoundMesh ) @@ -194,6 +195,9 @@ class OcTree {}; %shared_ptr(tesseract_geometry::Sphere) %include +%shared_ptr(tesseract_geometry::CompoundMesh) +%include + %include "tesseract_geometry/geometries.h" %include "tesseract_geometry/utils.h" diff --git a/tesseract_python/tests/tesseract_environment/test_mesh_material_loading.py b/tesseract_python/tests/tesseract_environment/test_mesh_material_loading.py index a57f99d85..44aa93f55 100644 --- a/tesseract_python/tests/tesseract_environment/test_mesh_material_loading.py +++ b/tesseract_python/tests/tesseract_environment/test_mesh_material_loading.py @@ -41,66 +41,71 @@ def get_scene_graph(): def test_mesh_material_loading(): scene = get_scene_graph() visual = scene.getLink("mesh_dae_link").visual - assert len(visual) == 4 + assert len(visual) == 1 - mesh0 = visual[1].geometry - mesh1 = visual[2].geometry - mesh2 = visual[3].geometry - mesh3 = visual[0].geometry + print("Geometry type") + print(visual[0].geometry.getType()) - assert mesh0.getFaceCount() == 34 - assert mesh0.getVertexCount() == 68 - assert mesh1.getFaceCount() == 15 - assert mesh1.getVertexCount() == 17 + meshes = visual[0].geometry.getMeshes() + + mesh0 = meshes[0] + mesh1 = meshes[1] + mesh2 = meshes[2] + mesh3 = meshes[3] + + assert mesh0.getFaceCount() == 2 + assert mesh0.getVertexCount() == 4 + assert mesh1.getFaceCount() == 34 + assert mesh1.getVertexCount() == 68 assert mesh2.getFaceCount() == 15 assert mesh2.getVertexCount() == 17 - assert mesh3.getFaceCount() == 2 - assert mesh3.getVertexCount() == 4 + assert mesh3.getFaceCount() == 15 + assert mesh3.getVertexCount() == 17 mesh0_normals = mesh0.getNormals() assert mesh0_normals is not None - assert len(mesh0_normals) == 68 + assert len(mesh0_normals) == 4 mesh1_normals = mesh1.getNormals() assert mesh1_normals is not None - assert len(mesh1_normals) == 17 + assert len(mesh1_normals) == 68 mesh2_normals = mesh2.getNormals() assert mesh2_normals is not None assert len(mesh2_normals) == 17 mesh3_normals = mesh3.getNormals() assert mesh3_normals is not None - assert len(mesh3_normals) == 4 + assert len(mesh3_normals) == 17 mesh0_material = mesh0.getMaterial() - nptest.assert_allclose(mesh0_material.getBaseColorFactor().flatten(),[0.7,0.7,0.7,1], atol=0.01) + nptest.assert_allclose(mesh0_material.getBaseColorFactor().flatten(),[1,1,1,1], atol=0.01) nptest.assert_almost_equal(mesh0_material.getMetallicFactor(), 0.0) nptest.assert_almost_equal(mesh0_material.getRoughnessFactor(), 0.5) nptest.assert_allclose(mesh0_material.getEmissiveFactor().flatten(), [0,0,0,1], atol = 0.01) mesh1_material = mesh1.getMaterial() - nptest.assert_allclose(mesh1_material.getBaseColorFactor().flatten(),[0.8,0.0,0.0,1], atol=0.01) + nptest.assert_allclose(mesh1_material.getBaseColorFactor().flatten(),[0.7,0.7,0.7,1], atol=0.01) nptest.assert_almost_equal(mesh1_material.getMetallicFactor(), 0.0) nptest.assert_almost_equal(mesh1_material.getRoughnessFactor(), 0.5) nptest.assert_allclose(mesh1_material.getEmissiveFactor().flatten(), [0,0,0,1], atol = 0.01) mesh2_material = mesh2.getMaterial() - nptest.assert_allclose(mesh2_material.getBaseColorFactor().flatten(),[0.05,0.8,0.05,1], atol=0.01) + nptest.assert_allclose(mesh2_material.getBaseColorFactor().flatten(),[0.8,0 ,0, 1], atol=0.01) nptest.assert_almost_equal(mesh2_material.getMetallicFactor(), 0.0) nptest.assert_almost_equal(mesh2_material.getRoughnessFactor(), 0.5) - nptest.assert_allclose(mesh2_material.getEmissiveFactor().flatten(), [0.1,0.1,0.5,1], atol = 0.01) + nptest.assert_allclose(mesh2_material.getEmissiveFactor().flatten(), [0,0,0,1], atol = 0.01) mesh3_material = mesh3.getMaterial() - nptest.assert_allclose(mesh3_material.getBaseColorFactor().flatten(),[1,1,1,1], atol=0.01) + nptest.assert_allclose(mesh3_material.getBaseColorFactor().flatten(),[0.05,0.8,0.05,1], atol=0.01) nptest.assert_almost_equal(mesh3_material.getMetallicFactor(), 0.0) nptest.assert_almost_equal(mesh3_material.getRoughnessFactor(), 0.5) - nptest.assert_allclose(mesh3_material.getEmissiveFactor().flatten(), [0,0,0,1], atol = 0.01) + nptest.assert_allclose(mesh3_material.getEmissiveFactor().flatten(), [0.1,0.1,0.5,1], atol = 0.01) - assert mesh0.getTextures() is None assert mesh1.getTextures() is None - assert mesh2.getTextures() is None + assert mesh2.getTextures() is None + assert mesh3.getTextures() is None - assert mesh3.getTextures() is not None - assert len(mesh3.getTextures()) == 1 + assert mesh0.getTextures() is not None + assert len(mesh0.getTextures()) == 1 - texture = mesh3.getTextures()[0] + texture = mesh0.getTextures()[0] assert len(texture.getTextureImage().getResourceContents()) == 38212 assert len(texture.getUVs()) == 4 diff --git a/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py b/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py index 673ebe05e..708c1a786 100644 --- a/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py +++ b/tesseract_python/tests/tesseract_task_composer/test_tesseract_task_composer.py @@ -77,7 +77,6 @@ def freespace_example_progam_iiwa(manipulator_info, goal = None, composite_profi def test_task_composer_trajopt_example(): - planning_task_problem = None output_program = None future = None task_executor = None From a6fd2d56f9a2b3c50076c1c8c1237be9b7193873 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 22:24:47 -0500 Subject: [PATCH 17/33] Add support for CompoundMesh to tesseract_viewer_python --- .../tesseract_env_to_gltf.py | 246 ++++++++++-------- 1 file changed, 139 insertions(+), 107 deletions(-) diff --git a/tesseract_viewer_python/tesseract_robotics_viewer/tesseract_env_to_gltf.py b/tesseract_viewer_python/tesseract_robotics_viewer/tesseract_env_to_gltf.py index 8b6cb572b..d46d53c82 100644 --- a/tesseract_viewer_python/tesseract_robotics_viewer/tesseract_env_to_gltf.py +++ b/tesseract_viewer_python/tesseract_robotics_viewer/tesseract_env_to_gltf.py @@ -164,7 +164,7 @@ def _append_link_recursive(gltf_dict, gltf_buf_io, link_map, joint_map, link_nam for visual in link.visual: visual_i += 1 _, visual_ind = _append_link_visual(gltf_dict, gltf_buf_io, link_name, visual, visual_i, shapes_mesh_inds) - child_inds.append(visual_ind) + child_inds.extend(visual_ind) child_joints = _find_child_joints(joint_map, link_name) for j in child_joints: @@ -182,121 +182,100 @@ def _append_link_recursive(gltf_dict, gltf_buf_io, link_map, joint_map, link_nam return link_node, link_ind -def _append_link_visual(gltf_dict, gltf_buf_io, link_name, visual, visual_i, shapes_mesh_inds): - - visual_u_name = visual.name + str(visual_i) - visual_name = "link_" + link_name + "_visual_" + visual_u_name - visual_node, visual_ind = _append_node(gltf_dict, visual.origin, visual_name) - +def _convert_mesh(gltf_dict, gltf_buf_io, visual_node, visual_name, mesh): tf_material = None - - visual_geom = visual.geometry - if (isinstance(visual_geom,tesseract_geometry.PolygonMesh)): + vertices = mesh.getVertices() + positions = np.zeros((len(vertices),3),dtype=np.float32) + for i in range(len(vertices)): + positions[i,:] = vertices[i].flatten() - mesh=visual_geom - vertices = mesh.getVertices() - positions = np.zeros((len(vertices),3),dtype=np.float32) - for i in range(len(vertices)): - positions[i,:] = vertices[i].flatten() - - indices = mesh.getFaces().flatten().astype(np.uint32).reshape((-1,4))[:,1:4].flatten() - - _, positions_ind = _append_accessor(gltf_dict, gltf_buf_io, positions) - _, indices_ind = _append_accessor(gltf_dict, gltf_buf_io, indices) - - normals_ind = None - normals = mesh.getNormals() - if normals is not None: - normals2 = np.zeros((len(normals),3),dtype=np.float32) - for i in range(len(normals)): - normals2[i,:] = normals[i].flatten() - _, normals_ind = _append_accessor(gltf_dict, gltf_buf_io, normals2) - - mesh_dict, mesh_ind = _append_dict_list(gltf_dict, "meshes", { - "primitives": [ - { - "attributes": { - "POSITION": positions_ind - }, - "indices": indices_ind - } - ], - "name": visual_name + "_mesh" - }) + indices = mesh.getFaces().flatten().astype(np.uint32).reshape((-1,4))[:,1:4].flatten() + + _, positions_ind = _append_accessor(gltf_dict, gltf_buf_io, positions) + _, indices_ind = _append_accessor(gltf_dict, gltf_buf_io, indices) + + normals_ind = None + normals = mesh.getNormals() + if normals is not None: + normals2 = np.zeros((len(normals),3),dtype=np.float32) + for i in range(len(normals)): + normals2[i,:] = normals[i].flatten() + _, normals_ind = _append_accessor(gltf_dict, gltf_buf_io, normals2) + + mesh_dict, mesh_ind = _append_dict_list(gltf_dict, "meshes", { + "primitives": [ + { + "attributes": { + "POSITION": positions_ind + }, + "indices": indices_ind + } + ], + "name": visual_name + "_mesh" + }) - # if normals_ind is not None: - # mesh_dict["primitives"][0]["attributes"]["NORMAL"] = normals_ind + # if normals_ind is not None: + # mesh_dict["primitives"][0]["attributes"]["NORMAL"] = normals_ind - visual_node["scale"] = list(mesh.getScale().flatten()) + visual_node["scale"] = list(mesh.getScale().flatten()) - if not mesh.getResource().getUrl().lower().endswith('.stl'): - mesh_material = mesh.getMaterial() - if mesh_material is not None: + if not mesh.getResource().getUrl().lower().endswith('.stl'): + mesh_material = mesh.getMaterial() + if mesh_material is not None: + + tf_material = { + "name": "material_" + visual_name, + "alphaMode": "MASK", + "alphaCutoff": 0.4 + } + + base_color_factor = mesh_material.getBaseColorFactor().flatten().tolist() - tf_material = { - "name": "material_" + visual_name, - "alphaMode": "MASK", - "alphaCutoff": 0.4 - } - - base_color_factor = mesh_material.getBaseColorFactor().flatten().tolist() - - tf_material["pbrMetallicRoughness"] = { - "baseColorFactor": base_color_factor, - "roughnessFactor": mesh_material.getRoughnessFactor(), - "metallicFactor": mesh_material.getMetallicFactor(), + tf_material["pbrMetallicRoughness"] = { + "baseColorFactor": base_color_factor, + "roughnessFactor": mesh_material.getRoughnessFactor(), + "metallicFactor": mesh_material.getMetallicFactor(), + } + + mesh_textures = mesh.getTextures() + if mesh_textures is not None and len(mesh_textures) > 0: + mesh_tex = mesh_textures[0] + mesh_tex_image = mesh_tex.getTextureImage() + tex_name = mesh_tex_image.getUrl() + tex_mimetype = "image/jpg" + if tex_name.endswith('png'): + tex_mimetype = "image/png" + + mesh_tex_image_bytes = bytearray(mesh_tex_image.getResourceContents()) + tex_img = cv2.imdecode(np.frombuffer(mesh_tex_image_bytes,dtype=np.uint8),flags=1) + img_h, img_w, _ = tex_img.shape + _, image_bufview_ind = _append_bufview(gltf_dict, gltf_buf_io, mesh_tex_image_bytes) + _, image_ind = _append_dict_list(gltf_dict, "images", { + "mimeType": tex_mimetype, + "bufferView": image_bufview_ind + }) + + _, tex_ind = _append_dict_list(gltf_dict, "textures", { + "source": image_ind + }) + + tf_material["pbrMetallicRoughness"]["baseColorTexture"] = { + "index": tex_ind, + "texCoord": 0 } - mesh_textures = mesh.getTextures() - if mesh_textures is not None and len(mesh_textures) > 0: - mesh_tex = mesh_textures[0] - mesh_tex_image = mesh_tex.getTextureImage() - tex_name = mesh_tex_image.getUrl() - tex_mimetype = "image/jpg" - if tex_name.endswith('png'): - tex_mimetype = "image/png" - - mesh_tex_image_bytes = bytearray(mesh_tex_image.getResourceContents()) - tex_img = cv2.imdecode(np.frombuffer(mesh_tex_image_bytes,dtype=np.uint8),flags=1) - img_h, img_w, _ = tex_img.shape - _, image_bufview_ind = _append_bufview(gltf_dict, gltf_buf_io, mesh_tex_image_bytes) - _, image_ind = _append_dict_list(gltf_dict, "images", { - "mimeType": tex_mimetype, - "bufferView": image_bufview_ind - }) - - _, tex_ind = _append_dict_list(gltf_dict, "textures", { - "source": image_ind - }) - - tf_material["pbrMetallicRoughness"]["baseColorTexture"] = { - "index": tex_ind, - "texCoord": 0 - } - - mesh_uvs = mesh_tex.getUVs() - tf_uvs = np.zeros((len(mesh_uvs),2),dtype=np.float32) - for i in range(len(mesh_uvs)): - tf_uvs1 = mesh_uvs[i].flatten() - tf_uvs[i,:] = [tf_uvs1[0], 1.0-tf_uvs1[1]] - _, tex_ind = _append_accessor(gltf_dict, gltf_buf_io, tf_uvs) - - mesh_dict["primitives"][0]["attributes"]["TEXCOORD_0"] = tex_ind + mesh_uvs = mesh_tex.getUVs() + tf_uvs = np.zeros((len(mesh_uvs),2),dtype=np.float32) + for i in range(len(mesh_uvs)): + tf_uvs1 = mesh_uvs[i].flatten() + tf_uvs[i,:] = [tf_uvs1[0], 1.0-tf_uvs1[1]] + _, tex_ind = _append_accessor(gltf_dict, gltf_buf_io, tf_uvs) - elif (isinstance(visual_geom,tesseract_geometry.Box)): - box=visual_geom - mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "cube_geometry", visual_name, shapes_mesh_inds) - visual_node["scale"] = [0.5*box.getX(), 0.5*box.getY(), 0.5*box.getZ()] + mesh_dict["primitives"][0]["attributes"]["TEXCOORD_0"] = tex_ind - elif (isinstance(visual_geom,tesseract_geometry.Sphere)): - sphere=visual_geom - mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "sphere_geometry", visual_name, shapes_mesh_inds) - visual_node["scale"] = [sphere.getRadius(), sphere.getRadius(), sphere.getRadius()] + return mesh_dict, mesh_ind, tf_material - elif (isinstance(visual_geom,tesseract_geometry.Cylinder)): - cylinder=visual_geom - mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "cylinder_geometry", visual_name, shapes_mesh_inds) - visual_node["scale"] = [cylinder.getRadius(), cylinder.getRadius(), 0.5*cylinder.getLength()] +def _apply_material(gltf_dict, gltf_buf_io, mesh_dict, visual_name, tf_material, visual_material): if tf_material is None: tf_material = { @@ -305,7 +284,7 @@ def _append_link_visual(gltf_dict, gltf_buf_io, link_name, visual, visual_i, sha "alphaCutoff": 0.4 } - material = visual.material + material = visual_material if material is None: tf_color = [0.5,0.5,0.5,1] @@ -322,10 +301,63 @@ def _append_link_visual(gltf_dict, gltf_buf_io, link_name, visual, visual_i, sha mesh_dict["primitives"][0]["material"] = material_ind +def _append_link_visual(gltf_dict, gltf_buf_io, link_name, visual, visual_i, shapes_mesh_inds): + + visual_geom = visual.geometry + + visual_u_name = visual.name + str(visual_i) + visual_name = "link_" + link_name + "_visual_" + visual_u_name + + if (isinstance(visual_geom,tesseract_geometry.CompoundMesh)): + meshes = visual_geom.getMeshes() + mesh_count = 0 + visual_nodes = [] + visual_inds = [] + for m in meshes: + visual_name1 = visual_name + "_mesh_" + str(mesh_count) + visual_node1, visual_ind1 = _append_node(gltf_dict, visual.origin, visual_name1) + mesh_dict1, mesh_ind1, tf_material1 = _convert_mesh(gltf_dict, gltf_buf_io, visual_node1, visual_name1, m) + _apply_material(gltf_dict, gltf_buf_io, mesh_dict1, visual_name1, tf_material1, visual.material) + visual_node1["mesh"] = mesh_ind1 + visual_nodes.append(visual_node1) + visual_inds.append(visual_ind1) + print(mesh_dict1) + mesh_count += 1 + + return visual_nodes, visual_inds + + visual_node, visual_ind = _append_node(gltf_dict, visual.origin, visual_name) + + tf_material = None + + if (isinstance(visual_geom,tesseract_geometry.PolygonMesh)): + + mesh=visual_geom + + mesh_dict, mesh_ind, tf_material = _convert_mesh(gltf_dict, gltf_buf_io, visual_node, visual_name, mesh) + + + elif (isinstance(visual_geom,tesseract_geometry.Box)): + box=visual_geom + mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "cube_geometry", visual_name, shapes_mesh_inds) + visual_node["scale"] = [0.5*box.getX(), 0.5*box.getY(), 0.5*box.getZ()] + + elif (isinstance(visual_geom,tesseract_geometry.Sphere)): + sphere=visual_geom + mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "sphere_geometry", visual_name, shapes_mesh_inds) + visual_node["scale"] = [sphere.getRadius(), sphere.getRadius(), sphere.getRadius()] + + elif (isinstance(visual_geom,tesseract_geometry.Cylinder)): + cylinder=visual_geom + mesh_dict, mesh_ind = _append_shape_mesh(gltf_dict, gltf_buf_io, "cylinder_geometry", visual_name, shapes_mesh_inds) + visual_node["scale"] = [cylinder.getRadius(), cylinder.getRadius(), 0.5*cylinder.getLength()] + + _apply_material(gltf_dict, gltf_buf_io, mesh_dict, visual_name, tf_material, visual.material) + visual_node["mesh"] = mesh_ind - return visual_node, visual_ind + return [visual_node], [visual_ind] _COMPONENT_TYPE_INT8 = 5120 _COMPONENT_TYPE_UINT8 = 5121 From e449158dc39383277868ab64a7270a8437611fc4 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 22:24:57 -0500 Subject: [PATCH 18/33] Update examples --- .../tesseract_planning_example_composer.py | 26 +++++++++++----- .../tesseract_planning_example_no_composer.py | 14 +++++---- .../examples/abb_irb2400_viewer.py | 17 +++++++---- .../tesseract_material_mesh_viewer.py | 30 ++----------------- 4 files changed, 40 insertions(+), 47 deletions(-) diff --git a/examples/tesseract_planning_example_composer.py b/examples/tesseract_planning_example_composer.py index 9eb327392..be9775f58 100644 --- a/examples/tesseract_planning_example_composer.py +++ b/examples/tesseract_planning_example_composer.py @@ -5,7 +5,7 @@ import numpy.testing as nptest from tesseract_robotics.tesseract_common import GeneralResourceLocator -from tesseract_robotics.tesseract_environment import Environment +from tesseract_robotics.tesseract_environment import Environment, AnyPoly_wrap_EnvironmentConst from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ ManipulatorInfo, AnyPoly, AnyPoly_wrap_double from tesseract_robotics.tesseract_command_language import CartesianWaypoint, WaypointPoly, \ @@ -15,9 +15,10 @@ AnyPoly_wrap_CompositeInstruction, DEFAULT_PROFILE_KEY, JointWaypoint, JointWaypointPoly, \ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint, \ - CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint + CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint, \ + AnyPoly_wrap_ProfileDictionary -from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblem, \ +from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, \ TaskComposerDataStorage, TaskComposerContext from tesseract_robotics_viewer import TesseractViewer @@ -134,7 +135,8 @@ task = factory.createTaskComposerNode("FreespacePipeline") # Get the output keys for the task -output_key = task.getOutputKeys()[0] +output_key = task.getOutputKeys().get("program") +input_key = task.getInputKeys().get("planning_input") # Create a profile dictionary. Profiles can be customized by adding to this dictionary and setting the profiles # in the instructions. @@ -143,18 +145,26 @@ # Create an AnyPoly containing the program. This explicit step is required because the Python bindings do not # support implicit conversion from the CompositeInstruction to the AnyPoly. program_anypoly = AnyPoly_wrap_CompositeInstruction(program) +environment_anypoly = AnyPoly_wrap_EnvironmentConst(t_env) +profiles_anypoly = AnyPoly_wrap_ProfileDictionary(profiles) -# Create the task problem and input -task_planning_problem = PlanningTaskComposerProblem(t_env, profiles) -task_planning_problem.input = program_anypoly +# Create the task data +task_data = TaskComposerDataStorage() +task_data.setData(input_key, program_anypoly) +task_data.setData("environment", environment_anypoly) +task_data.setData("profiles", profiles_anypoly) # Create an executor to run the task task_executor = factory.createTaskComposerExecutor("TaskflowExecutor") # Run the task and wait for completion -future = task_executor.run(task.get(), task_planning_problem) +future = task_executor.run(task.get(), task_data) future.wait() +if not future.context.isSuccessful(): + print("Planning task failed") + exit(1) + # Retrieve the output, converting the AnyPoly back to a CompositeInstruction results = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) diff --git a/examples/tesseract_planning_example_no_composer.py b/examples/tesseract_planning_example_no_composer.py index 76c3c9cb4..ad61003e1 100644 --- a/examples/tesseract_planning_example_no_composer.py +++ b/examples/tesseract_planning_example_no_composer.py @@ -11,11 +11,11 @@ from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram from tesseract_robotics.tesseract_motion_planners_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator, \ - OMPLProblemGeneratorFn, OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile + OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile from tesseract_robotics.tesseract_time_parameterization import TimeOptimalTrajectoryGeneration, \ InstructionsTrajectory from tesseract_robotics.tesseract_motion_planners_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \ - TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ + TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ ProfileDictionary_addProfile_TrajOptCompositeProfile import os @@ -167,9 +167,13 @@ # output program since the input is modified. time_parameterization = TimeOptimalTrajectoryGeneration() instructions_trajectory = InstructionsTrajectory(trajopt_results_instruction) -max_velocity = np.array([2.088, 2.082, 3.27, 3.6, 3.3, 3.078],dtype=np.float64) -max_acceleration = np.array([ 1, 1, 1, 1, 1, 1],dtype=np.float64) -assert time_parameterization.computeTimeStamps(instructions_trajectory, max_velocity, max_acceleration) +max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) +max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) +max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) +max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) +max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) +max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) +assert time_parameterization.compute(instructions_trajectory, max_velocity, max_acceleration, max_jerk) # Flatten the results into a single list of instructions trajopt_results = trajopt_results_instruction.flatten() diff --git a/tesseract_viewer_python/examples/abb_irb2400_viewer.py b/tesseract_viewer_python/examples/abb_irb2400_viewer.py index eb31a60d6..e6e583fc5 100644 --- a/tesseract_viewer_python/examples/abb_irb2400_viewer.py +++ b/tesseract_viewer_python/examples/abb_irb2400_viewer.py @@ -7,13 +7,14 @@ CompositeInstruction, MoveInstructionPoly, CartesianWaypointPoly, ProfileDictionary, \ CartesianWaypointPoly_wrap_CartesianWaypoint, MoveInstructionPoly_wrap_MoveInstruction -from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse, generateInterpolatedProgram +from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse +from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram from tesseract_robotics.tesseract_motion_planners_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator, \ - OMPLProblemGeneratorFn, OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile + OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile from tesseract_robotics.tesseract_time_parameterization import TimeOptimalTrajectoryGeneration, \ InstructionsTrajectory from tesseract_robotics.tesseract_motion_planners_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \ - TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ + TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ ProfileDictionary_addProfile_TrajOptCompositeProfile import os @@ -115,9 +116,13 @@ time_parameterization = TimeOptimalTrajectoryGeneration() instructions_trajectory = InstructionsTrajectory(trajopt_results_instruction) -max_velocity = np.array([2.088, 2.082, 3.27, 3.6, 3.3, 3.078],dtype=np.float64) -max_acceleration = np.array([ 1, 1, 1, 1, 1, 1],dtype=np.float64) -assert time_parameterization.computeTimeStamps(instructions_trajectory, max_velocity, max_acceleration) +max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) +max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) +max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) +max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) +max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) +max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) +assert time_parameterization.compute(instructions_trajectory, max_velocity, max_acceleration, max_jerk) trajopt_results = trajopt_results_instruction.flatten() viewer.update_trajectory(trajopt_results) diff --git a/tesseract_viewer_python/examples/tesseract_material_mesh_viewer.py b/tesseract_viewer_python/examples/tesseract_material_mesh_viewer.py index fe48bccac..04e9d6058 100644 --- a/tesseract_viewer_python/examples/tesseract_material_mesh_viewer.py +++ b/tesseract_viewer_python/examples/tesseract_material_mesh_viewer.py @@ -1,5 +1,5 @@ from tesseract_robotics.tesseract_environment import Environment -from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource +from tesseract_robotics.tesseract_common import GeneralResourceLocator import os import re import traceback @@ -47,36 +47,10 @@ """ -TESSERACT_SUPPORT_DIR = os.environ["TESSERACT_SUPPORT_DIR"] - -class TesseractSupportResourceLocator(ResourceLocator): - def __init__(self): - super().__init__() - - def locateResource(self, url): - try: - try: - if os.path.exists(url): - return SimpleLocatedResource(url, url, self) - except: - pass - url_match = re.match(r"^package:\/\/tesseract_support\/(.*)$",url) - if (url_match is None): - print("url_match failed") - return None - if not "TESSERACT_SUPPORT_DIR" in os.environ: - return None - tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] - filename = os.path.join(tesseract_support, os.path.normpath(url_match.group(1))) - ret = SimpleLocatedResource(url, filename, self) - return ret - except: - traceback.print_exc() - t_env = Environment() # locator_fn must be kept alive by maintaining a reference -locator=TesseractSupportResourceLocator() +locator=GeneralResourceLocator() t_env.init(shapes_urdf, locator) viewer = TesseractViewer() From 38148279ed5c93280eb0fb436f5b8a310fb0bffe Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 22:25:45 -0500 Subject: [PATCH 19/33] Bump tesseract_viewer_python version to 0.3.0 --- tesseract_viewer_python/package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tesseract_viewer_python/package.xml b/tesseract_viewer_python/package.xml index e6888570b..eb431ae5c 100644 --- a/tesseract_viewer_python/package.xml +++ b/tesseract_viewer_python/package.xml @@ -1,7 +1,7 @@ tesseract_viewer_python - 0.2.5 + 0.3.0 The tesseract_viewer_python package John Wason Apache 2.0 From cb7ff0ce9f2931aaed81ee37ab9f1cd932d5382f Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 22:44:48 -0500 Subject: [PATCH 20/33] Update readme --- README.md | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 976f42eca..15dbf8838 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # Tesseract Python -[![Python](https://img.shields.io/badge/python-3.7+-blue.svg)](https://github.com/tesseract-robotics/tesseract_python) +[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://github.com/tesseract-robotics/tesseract_python) ![PyPI](https://img.shields.io/pypi/v/tesseract-robotics) Platform | CI Status ---------------------|:--------- -Linux (Focal) | [![Build Status](https://github.com/tesseract-robotics/tesseract_python/workflows/Focal-Build/badge.svg)](https://github.com/tesseract-robotics/tesseract_python/actions) -Windows | [![Build Status](https://github.com/tesseract-robotics/tesseract_python/workflows/Windows-Noetic-Build/badge.svg)](https://github.com/tesseract-robotics/tesseract_python/actions) Wheels | [![Build Status](https://github.com/tesseract-robotics/tesseract_python/actions/workflows/wheels.yml/badge.svg)](https://github.com/tesseract-robotics/tesseract_python/actions) [![Github Issues](https://img.shields.io/github/issues/tesseract-robotics/tesseract_python.svg)](http://github.com/tesseract-robotics/tesseract_python/issues) @@ -23,7 +21,7 @@ checking (Bullet, FCL), kinematics (KDL, OPW, UR), planning (OMPL, Descartes, Tr (tesseract_viewer_python) Standalone packages are provided on PyPi (pip install) for Windows and Linux, containing all the native dependencies -for Python 3.7+. +for Python 3.8+. The Tesseract Python package is developed and maintained by Wason Technology, LLC. @@ -39,18 +37,17 @@ See https://tesseract-robotics.github.io/tesseract_python/ for documentation. Standalone packages are provided on PyPi (pip install) for Windows and Linux, containing Tesseract, Tesseract Planning, andall the native dependencies -for Python 3.7+. These packages have been tested on Windows 10, Ubuntu 20.04, and Ubuntu 22.04, but should work -on any relatively recent x64 Windows or Linux operating system. Packages are available for Python 3.7 - 3.11. +for Python 3.8+. These packages have been tested on Windows 10, and Ubuntu 22.04, but should work +on any relatively recent x64 Windows or Linux operating system. Packages are available for Python 3.8 - 3.13 To install on Windows: ``` python -m pip install tesseract-robotics tesseract-robotics-viewer ``` -To install on Ubuntu 20.04 and Ubuntu 22.04: +To install on Ubuntu 24.04 and Ubuntu 22.04: ``` sudo apt install python3-pip python3-numpy -# The supplied version of pip on Ubuntu 20.04 is too old for manylinux_2_31, upgrade pip python3 -m pip install -U pip python3 -m pip install --user tesseract_robotics tesseract_robotics_viewer ``` @@ -115,7 +112,7 @@ import numpy as np import numpy.testing as nptest from tesseract_robotics.tesseract_common import GeneralResourceLocator -from tesseract_robotics.tesseract_environment import Environment +from tesseract_robotics.tesseract_environment import Environment, AnyPoly_wrap_EnvironmentConst from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ ManipulatorInfo, AnyPoly, AnyPoly_wrap_double from tesseract_robotics.tesseract_command_language import CartesianWaypoint, WaypointPoly, \ @@ -125,9 +122,10 @@ from tesseract_robotics.tesseract_command_language import CartesianWaypoint, Way AnyPoly_wrap_CompositeInstruction, DEFAULT_PROFILE_KEY, JointWaypoint, JointWaypointPoly, \ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint, \ - CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint + CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint, \ + AnyPoly_wrap_ProfileDictionary -from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblem, \ +from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, \ TaskComposerDataStorage, TaskComposerContext from tesseract_robotics_viewer import TesseractViewer @@ -200,7 +198,8 @@ factory = TaskComposerPluginFactory(config_path) task = factory.createTaskComposerNode("FreespacePipeline") # Get the output keys for the task -output_key = task.getOutputKeys()[0] +output_key = task.getOutputKeys().get("program") +input_key = task.getInputKeys().get("planning_input") # Create a profile dictionary. Profiles can be customized by adding to this dictionary and setting the profiles # in the instructions. @@ -209,18 +208,26 @@ profiles = ProfileDictionary() # Create an AnyPoly containing the program. This explicit step is required because the Python bindings do not # support implicit conversion from the CompositeInstruction to the AnyPoly. program_anypoly = AnyPoly_wrap_CompositeInstruction(program) +environment_anypoly = AnyPoly_wrap_EnvironmentConst(t_env) +profiles_anypoly = AnyPoly_wrap_ProfileDictionary(profiles) -# Create the task problem and input -task_planning_problem = PlanningTaskComposerProblem(t_env, profiles) -task_planning_problem.input = program_anypoly +# Create the task data +task_data = TaskComposerDataStorage() +task_data.setData(input_key, program_anypoly) +task_data.setData("environment", environment_anypoly) +task_data.setData("profiles", profiles_anypoly) # Create an executor to run the task task_executor = factory.createTaskComposerExecutor("TaskflowExecutor") # Run the task and wait for completion -future = task_executor.run(task.get(), task_planning_problem) +future = task_executor.run(task.get(), task_data) future.wait() +if not future.context.isSuccessful(): + print("Planning task failed") + exit(1) + # Retrieve the output, converting the AnyPoly back to a CompositeInstruction results = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) From e7388c2d6e0acf816cc40eaa9899cca3885aaca8 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 23:27:09 -0500 Subject: [PATCH 21/33] Include boost-format boost-algorithm vcpkg package --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index bb4658020..468764470 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -14,7 +14,8 @@ env: VCPKG_PKGS: >- boost-dll boost-program-options boost-serialization boost-filesystem - boost-stacktrace + boost-stacktrace boost-algorithm + boost-format tinyxml2 console-bridge assimp urdfdom octomap orocos-kdl pcl gtest benchmark flann jsoncpp From b2b697c8eabe258b872bfcbaf1885a830e1cc6fc Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 29 Nov 2024 23:28:58 -0500 Subject: [PATCH 22/33] Use vcpkg-action github-binarycache --- .github/workflows/wheels.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 468764470..b20e484a5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -204,7 +204,7 @@ jobs: python-version: '${{ matrix.config.python_version }}' architecture: ${{ matrix.config.arch }} - name: vcpkg build - uses: johnwason/vcpkg-action@v5 + uses: johnwason/vcpkg-action@v6 with: pkgs: >- ${{ env.VCPKG_PKGS }} @@ -212,6 +212,7 @@ jobs: extra-args: --clean-after-build token: ${{ github.token }} cache-key: win-${{ matrix.config.arch }}-python-${{ matrix.config.python_version }} + github-binarycache: true - name: pip3 run: | python -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool @@ -299,7 +300,7 @@ jobs: run: | brew install libomp cmake automake autoconf libtool gcc ninja - name: vcpkg build - uses: johnwason/vcpkg-action@v5 + uses: johnwason/vcpkg-action@v6 with: pkgs: >- ${{ env.VCPKG_PKGS }} @@ -307,6 +308,7 @@ jobs: extra-args: --clean-after-build --overlay-triplets=${{ github.workspace }}/ws/src/tesseract_python/.github/workflows/vcpkg_triplets token: ${{ github.token }} cache-key: osx-x64-vcpkg + github-binarycache: true - name: pip3 run: | python3 -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool delocate From 8f7ab4ffcfc47948b6709558ac283c0935eef3b2 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 00:51:54 -0500 Subject: [PATCH 23/33] brew install swig on macos --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b20e484a5..9b94e758d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -298,7 +298,7 @@ jobs: python-version: '${{ matrix.config.python_version }}' - name: brew run: | - brew install libomp cmake automake autoconf libtool gcc ninja + brew install libomp cmake automake autoconf libtool gcc ninja swig - name: vcpkg build uses: johnwason/vcpkg-action@v6 with: From 8441add3efcfbbdd35610241853a50878d605e67 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 07:37:57 -0500 Subject: [PATCH 24/33] Use actions/download-artifact@v4 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9b94e758d..ebbe594e2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -375,7 +375,7 @@ jobs: with: path: robotraconteur - name: Download CI artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: path: artifacts/main - name: archive wheels From 031919c5e4a09d25899337c6d25ed372320f5eed Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 13:13:15 -0500 Subject: [PATCH 25/33] Add macos builds --- .github/workflows/wheels.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ebbe594e2..f5a36c63f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -281,13 +281,28 @@ jobs: path: "**/*.log" retention-days: 2 build-macos: - runs-on: macos-13 + runs-on: ${{ matrix.config.runner }} strategy: fail-fast: false matrix: config: - - py_platform: macosx-10.9-x86_64 + - py_platform: macosx-12.0-x86_64 python_version: "3.12" + arch: x64 + runner: macos-13 + - py_platform: macosx-12.0-x86_64 + python_version: "3.13" + arch: x64 + runner: macos-13 + - py_platform: macosx-12.0-arm64 + python_version: "3.12" + arch: arm64 + runner: macos-14 + - py_platform: macosx-12.0-arm64 + python_version: "3.13" + arch: arm64 + runner: macos-14 + steps: - uses: actions/checkout@v2 with: @@ -304,10 +319,10 @@ jobs: with: pkgs: >- ${{ env.VCPKG_PKGS }} - triplet: x64-osx-dynamic-release + triplet: ${{ matrix.config.arch }}-osx-dynamic-release extra-args: --clean-after-build --overlay-triplets=${{ github.workspace }}/ws/src/tesseract_python/.github/workflows/vcpkg_triplets token: ${{ github.token }} - cache-key: osx-x64-vcpkg + cache-key: osx-${{ matrix.config.arch }}-vcpkg github-binarycache: true - name: pip3 run: | @@ -318,8 +333,8 @@ jobs: - name: colcon build working-directory: ws run: | - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/x64-osx-dynamic-release/lib:$GITHUB_WORKSPACE/ws/install/lib - export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/x64-osx-dynamic-release + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.arch }}-osx-dynamic-release/lib:$GITHUB_WORKSPACE/ws/install/lib + export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.arch }}-osx-dynamic-release colcon build --merge-install \ --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp ifopt vhacd \ From 58baa258fbee92ce9a205cdc1174ad02808fa0b2 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 13:57:53 -0500 Subject: [PATCH 26/33] Use tesseract commit sha --- dependencies.rosinstall | 2 +- dependencies_with_ext.rosinstall | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.rosinstall b/dependencies.rosinstall index fc940bea3..e914de3e5 100644 --- a/dependencies.rosinstall +++ b/dependencies.rosinstall @@ -5,7 +5,7 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: master + version: 8f4ca8db143ec8790ccddf5d15ea80e04d980e0b - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git diff --git a/dependencies_with_ext.rosinstall b/dependencies_with_ext.rosinstall index 0b0fd425b..0bd9e6371 100644 --- a/dependencies_with_ext.rosinstall +++ b/dependencies_with_ext.rosinstall @@ -5,7 +5,7 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: master + version: 8f4ca8db143ec8790ccddf5d15ea80e04d980e0b - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git From f2ae09d7f098f5bc4dabcf82e1216a27fddaa5d5 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 14:25:18 -0500 Subject: [PATCH 27/33] Add macos builds --- .../vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake diff --git a/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake b/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake new file mode 100644 index 000000000..abb8d556c --- /dev/null +++ b/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_OSX_ARCHITECTURES arm64) + +set(VCPKG_BUILD_TYPE release) +set(VCPKG_OSX_DEPLOYMENT_TARGET 12.0) From e78c5831097d9589c980a47fe3088da1cc31e714 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 14:29:45 -0500 Subject: [PATCH 28/33] Add macos builds --- ...dynamic-release-copy.cmake => arm64-osx-dynamic-release.cmake} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/vcpkg_triplets/{arm64-osx-dynamic-release-copy.cmake => arm64-osx-dynamic-release.cmake} (100%) diff --git a/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake b/.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake similarity index 100% rename from .github/workflows/vcpkg_triplets/arm64-osx-dynamic-release-copy.cmake rename to .github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake From 74441d64f58d78e218253846c09326ed6001353a Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 15:16:12 -0500 Subject: [PATCH 29/33] Add macos builds --- .github/workflows/wheels.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f5a36c63f..ce91b3b5c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -290,18 +290,22 @@ jobs: python_version: "3.12" arch: x64 runner: macos-13 + brew_prefix: /usr/local - py_platform: macosx-12.0-x86_64 python_version: "3.13" arch: x64 runner: macos-13 + brew_prefix: /usr/local - py_platform: macosx-12.0-arm64 python_version: "3.12" arch: arm64 runner: macos-14 + brew_prefix: /opt/homebrew - py_platform: macosx-12.0-arm64 python_version: "3.13" arch: arm64 runner: macos-14 + brew_prefix: /opt/homebrew steps: - uses: actions/checkout@v2 @@ -345,11 +349,11 @@ jobs: -DBUILD_SHARED_LIBS=ON -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \ -DVCPKG_APPLOCAL_DEPS=OFF -DTESSERACT_ENABLE_TESTING=ON \ -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ - -DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include \ - -DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include \ + -DOpenMP_CXX_INCLUDE_DIR=${{ matrix.config.brew_prefix }}/opt/libomp/include \ + -DOpenMP_C_INCLUDE_DIR=${{ matrix.config.brew_prefix }}/opt/libomp/include \ -DOpenMP_CXX_LIB_NAMES=libomp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \ -DOpenMP_C_LIB_NAMES=libomp -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \ - -DOpenMP_libomp_LIBRARY=/usr/local/opt/libomp/lib/libomp.dylib \ + -DOpenMP_libomp_LIBRARY=${{ matrix.config.brew_prefix }}/opt/libomp/lib/libomp.dylib \ -Dtcmalloc_minimal_LIBRARY=${{ github.workspace }}/vcpkg/installed/x64-osx-dynamic-release/lib/libtcmalloc_minimal.dylib \ -DPYTHON_EXECUTABLE="${{ steps.setup-python.outputs.python-path }}" \ -DTESSERACT_PYTHON_WHEEL_PLATFORM=${{ matrix.config.py_platform }} \ From 280fc8ab067f9314ad2651761db0b39f5810d90e Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 15:28:35 -0500 Subject: [PATCH 30/33] Add macos builds --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ce91b3b5c..7219dc3a1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -354,7 +354,7 @@ jobs: -DOpenMP_CXX_LIB_NAMES=libomp -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp" \ -DOpenMP_C_LIB_NAMES=libomp -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp" \ -DOpenMP_libomp_LIBRARY=${{ matrix.config.brew_prefix }}/opt/libomp/lib/libomp.dylib \ - -Dtcmalloc_minimal_LIBRARY=${{ github.workspace }}/vcpkg/installed/x64-osx-dynamic-release/lib/libtcmalloc_minimal.dylib \ + -Dtcmalloc_minimal_LIBRARY=${{ github.workspace }}/vcpkg/installed/${{ matrix.config.arch }}-osx-dynamic-release/lib/libtcmalloc_minimal.dylib \ -DPYTHON_EXECUTABLE="${{ steps.setup-python.outputs.python-path }}" \ -DTESSERACT_PYTHON_WHEEL_PLATFORM=${{ matrix.config.py_platform }} \ -DTESSERACT_PYTHON_BUILD_WHEEL=ON From ec42a59e8973cd0a61727d5048a0cf67816571a5 Mon Sep 17 00:00:00 2001 From: John Wason Date: Sat, 30 Nov 2024 16:19:21 -0500 Subject: [PATCH 31/33] Add macos builds --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7219dc3a1..432df9eb5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -374,7 +374,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: 'python-macos-win-${{matrix.config.python_version}}' + name: 'python-macos-${{ matrix.config.arch }}-python-${{matrix.config.python_version}}' path: ws/build/tesseract_python/python - name: archive logs if: failure() From a0d35fe177c3e9e6acbdce0107c18bff070b6ccd Mon Sep 17 00:00:00 2001 From: John Wason Date: Mon, 2 Dec 2024 13:23:22 -0500 Subject: [PATCH 32/33] Use tesseract master branch --- dependencies.rosinstall | 2 +- dependencies_with_ext.rosinstall | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies.rosinstall b/dependencies.rosinstall index e914de3e5..fc940bea3 100644 --- a/dependencies.rosinstall +++ b/dependencies.rosinstall @@ -5,7 +5,7 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 8f4ca8db143ec8790ccddf5d15ea80e04d980e0b + version: master - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git diff --git a/dependencies_with_ext.rosinstall b/dependencies_with_ext.rosinstall index 0bd9e6371..0b0fd425b 100644 --- a/dependencies_with_ext.rosinstall +++ b/dependencies_with_ext.rosinstall @@ -5,7 +5,7 @@ - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 8f4ca8db143ec8790ccddf5d15ea80e04d980e0b + version: master - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git From 16096fa5d0e9b8f17d56428318b366d211a46dce Mon Sep 17 00:00:00 2001 From: John Wason Date: Thu, 5 Dec 2024 16:56:29 -0500 Subject: [PATCH 33/33] Update dependencies --- dependencies.rosinstall | 6 +++--- dependencies_with_ext.rosinstall | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies.rosinstall b/dependencies.rosinstall index fc940bea3..266850994 100644 --- a/dependencies.rosinstall +++ b/dependencies.rosinstall @@ -1,11 +1,11 @@ - git: local-name: ros_industrial_cmake_boilerplate uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: 0.6.2 + version: 0.6.3 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: master + version: 0.27.1 - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git @@ -13,7 +13,7 @@ - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.26.0 + version: 0.27.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git diff --git a/dependencies_with_ext.rosinstall b/dependencies_with_ext.rosinstall index 0b0fd425b..7d71e49a1 100644 --- a/dependencies_with_ext.rosinstall +++ b/dependencies_with_ext.rosinstall @@ -1,11 +1,11 @@ - git: local-name: ros_industrial_cmake_boilerplate uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git - version: 0.6.2 + version: 0.6.3 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: master + version: 0.27.1 - git: local-name: tesseract_planning uri: https://github.com/johnwason/tesseract_planning.git @@ -13,7 +13,7 @@ - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.26.0 + version: 0.27.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git