diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e9f97eec9..8c3f7c684 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -35,26 +35,43 @@ jobs: 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 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 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 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 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 + python_version: "3.12.0" + docs: true + docs_cmake: ON env: DEBIAN_FRONTEND: noninteractive steps: @@ -91,6 +108,9 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install auditwheel wheel numpy setuptools colcon-common-extensions vcstool patchelf + - name: pip + if: matrix.config.docs == true + run: | python -m pip install -r ws/src/tesseract_python/docs/requirements.txt - name: vcs import working-directory: ws/src @@ -108,7 +128,7 @@ jobs: -DTESSERACT_PYTHON_BUILD_WHEEL=ON -DTESSERACT_PYTHON_WHEEL_PLATFORM=${{ matrix.config.py_platform }} -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_PLUGIN_FACTORY_CALLBACKS=ON - -DTESSERACT_PYTHON_BUILD_DOCUMENTATION=ON + -DTESSERACT_PYTHON_BUILD_DOCUMENTATION=${{ matrix.config.docs_cmake }} - name: test shell: bash run: | @@ -122,9 +142,11 @@ jobs: cd ws/src/tesseract_python/tesseract_python pytest -s - name: build docs + if: matrix.config.docs == true shell: bash working-directory: ws/build/tesseract_python run: | + 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 @@ -162,6 +184,10 @@ jobs: vcpkg_triplet: x64-windows-release cmake_arch: x64 python_version: "3.11.0" + - arch: x64 + vcpkg_triplet: x64-windows-release + cmake_arch: x64 + python_version: "3.12.0" steps: - uses: actions/checkout@v2 with: diff --git a/README.md b/README.md index a0973bda4..976f42eca 100644 --- a/README.md +++ b/README.md @@ -127,8 +127,8 @@ from tesseract_robotics.tesseract_command_language import CartesianWaypoint, Way MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint, \ CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint -from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblemUPtr, \ - TaskComposerDataStorage, TaskComposerInput, TaskComposerProblemUPtr, PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr +from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblem, \ + TaskComposerDataStorage, TaskComposerContext from tesseract_robotics_viewer import TesseractViewer @@ -199,8 +199,7 @@ factory = TaskComposerPluginFactory(config_path) # Create the task composer node. In this case the FreespacePipeline is used. Many other are available. task = factory.createTaskComposerNode("FreespacePipeline") -# Get the input and output keys for the task -input_key = task.getInputKeys()[0] +# Get the output keys for the task output_key = task.getOutputKeys()[0] # Create a profile dictionary. Profiles can be customized by adding to this dictionary and setting the profiles @@ -211,24 +210,19 @@ profiles = ProfileDictionary() # support implicit conversion from the CompositeInstruction to the AnyPoly. program_anypoly = AnyPoly_wrap_CompositeInstruction(program) -# Create the task data storage and set the data -task_data = TaskComposerDataStorage() -task_data.setData(input_key, program_anypoly) - # Create the task problem and input -task_planning_problem = PlanningTaskComposerProblemUPtr.make_unique(t_env, task_data, profiles) -task_problem = PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr(task_planning_problem) -task_input = TaskComposerInput(task_problem) +task_planning_problem = PlanningTaskComposerProblem(t_env, profiles) +task_planning_problem.input = program_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_input) +future = task_executor.run(task.get(), task_planning_problem) future.wait() # Retrieve the output, converting the AnyPoly back to a CompositeInstruction -results = AnyPoly_as_CompositeInstruction(task_input.data_storage.getData(output_key)) +results = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) # Display the output # Print out the resulting waypoints diff --git a/dependencies.rosinstall b/dependencies.rosinstall index c5e0f7405..656ca4ad6 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.4.5 + version: 0.5.4 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.18.1 + version: 0.21.4 - git: local-name: tesseract_planning uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.18.2 + version: 0.21.4 - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.6.0 + version: 0.7.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git - version: 0.3.1 + version: 0.4.2 - 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 7e56e887e..7cb031042 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.4.5 + version: 0.5.4 - git: local-name: tesseract uri: https://github.com/tesseract-robotics/tesseract.git - version: 0.18.1 + version: 0.21.4 - git: local-name: tesseract_planning uri: https://github.com/tesseract-robotics/tesseract_planning.git - version: 0.18.2 + version: 0.21.4 - git: local-name: trajopt uri: https://github.com/tesseract-robotics/trajopt.git - version: 0.6.0 + version: 0.7.0 - git: local-name: descartes_light uri: https://github.com/swri-robotics/descartes_light.git - version: 0.3.1 + version: 0.4.2 - git: local-name: opw_kinematics uri: https://github.com/Jmeyer1292/opw_kinematics.git diff --git a/docs/_source/modules/tesseract_motion_planners/api_docs_generated.rst b/docs/_source/modules/tesseract_motion_planners/api_docs_generated.rst index 1ae7e21ea..02c016dec 100644 --- a/docs/_source/modules/tesseract_motion_planners/api_docs_generated.rst +++ b/docs/_source/modules/tesseract_motion_planners/api_docs_generated.rst @@ -3,20 +3,6 @@ Classes ******* -JointGroupInstructionInfo Class -=================================================================================================== -.. autoclass:: tesseract_robotics.tesseract_motion_planners.JointGroupInstructionInfo - :noindex: - :exclude-members: thisown - :members: - -KinematicGroupInstructionInfo Class -=================================================================================================== -.. autoclass:: tesseract_robotics.tesseract_motion_planners.KinematicGroupInstructionInfo - :noindex: - :exclude-members: thisown - :members: - MotionPlanner Class =================================================================================================== .. autoclass:: tesseract_robotics.tesseract_motion_planners.MotionPlanner @@ -64,21 +50,6 @@ formatProgram Function .. autofunction:: tesseract_robotics.tesseract_motion_planners.formatProgram :noindex: -generateInterpolatedProgram Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.generateInterpolatedProgram - :noindex: - -getClosestJointSolution Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.getClosestJointSolution - :noindex: - -getInterpolatedInstructions Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.getInterpolatedInstructions - :noindex: - getJointTurns Function =================================================================================================== .. autofunction:: tesseract_robotics.tesseract_motion_planners.getJointTurns @@ -89,36 +60,6 @@ getRobotConfig Function .. autofunction:: tesseract_robotics.tesseract_motion_planners.getRobotConfig :noindex: -interpolate Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolate - :noindex: - -interpolateCartCartWaypoint Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolateCartCartWaypoint - :noindex: - -interpolateCartJointWaypoint Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolateCartJointWaypoint - :noindex: - -interpolateJointCartWaypoint Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolateJointCartWaypoint - :noindex: - -interpolateJointJointWaypoint Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolateJointJointWaypoint - :noindex: - -interpolate_waypoint Function -=================================================================================================== -.. autofunction:: tesseract_robotics.tesseract_motion_planners.interpolate_waypoint - :noindex: - toToolpath Function =================================================================================================== .. autofunction:: tesseract_robotics.tesseract_motion_planners.toToolpath diff --git a/docs/_source/modules/tesseract_motion_planners_simple/api_docs_generated.rst b/docs/_source/modules/tesseract_motion_planners_simple/api_docs_generated.rst index ee942bf58..3195c662f 100644 --- a/docs/_source/modules/tesseract_motion_planners_simple/api_docs_generated.rst +++ b/docs/_source/modules/tesseract_motion_planners_simple/api_docs_generated.rst @@ -3,6 +3,20 @@ Classes ******* +JointGroupInstructionInfo Class +=================================================================================================== +.. autoclass:: tesseract_robotics.tesseract_motion_planners_simple.JointGroupInstructionInfo + :noindex: + :exclude-members: thisown + :members: + +KinematicGroupInstructionInfo Class +=================================================================================================== +.. autoclass:: tesseract_robotics.tesseract_motion_planners_simple.KinematicGroupInstructionInfo + :noindex: + :exclude-members: thisown + :members: + SimpleMotionPlanner Class =================================================================================================== .. autoclass:: tesseract_robotics.tesseract_motion_planners_simple.SimpleMotionPlanner @@ -126,6 +140,51 @@ ProfileDictionary_removeProfile_SimplePlannerPlanProfile Function .. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.ProfileDictionary_removeProfile_SimplePlannerPlanProfile :noindex: +generateInterpolatedProgram Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.generateInterpolatedProgram + :noindex: + +getClosestJointSolution Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.getClosestJointSolution + :noindex: + +getInterpolatedInstructions Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.getInterpolatedInstructions + :noindex: + +interpolate Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolate + :noindex: + +interpolateCartCartWaypoint Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolateCartCartWaypoint + :noindex: + +interpolateCartJointWaypoint Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolateCartJointWaypoint + :noindex: + +interpolateJointCartWaypoint Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolateJointCartWaypoint + :noindex: + +interpolateJointJointWaypoint Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolateJointJointWaypoint + :noindex: + +interpolate_waypoint Function +=================================================================================================== +.. autofunction:: tesseract_robotics.tesseract_motion_planners_simple.interpolate_waypoint + :noindex: + Container Templates ******************* diff --git a/docs/_source/modules/tesseract_task_composer/api_docs_generated.rst b/docs/_source/modules/tesseract_task_composer/api_docs_generated.rst index f790c196a..47e4a9586 100644 --- a/docs/_source/modules/tesseract_task_composer/api_docs_generated.rst +++ b/docs/_source/modules/tesseract_task_composer/api_docs_generated.rst @@ -80,6 +80,20 @@ RuckigTrajectorySmoothingMoveProfile Class :exclude-members: thisown :members: +TaskComposerContext Class +=================================================================================================== +.. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerContext + :noindex: + :exclude-members: thisown + :members: + +TaskComposerContextUPtr Class +=================================================================================================== +.. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerContextUPtr + :noindex: + :exclude-members: thisown + :members: + TaskComposerDataStorage Class =================================================================================================== .. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerDataStorage @@ -143,20 +157,6 @@ TaskComposerGraphUPtr Class :exclude-members: thisown :members: -TaskComposerInput Class -=================================================================================================== -.. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerInput - :noindex: - :exclude-members: thisown - :members: - -TaskComposerInputUPtr Class -=================================================================================================== -.. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerInputUPtr - :noindex: - :exclude-members: thisown - :members: - TaskComposerNode Class =================================================================================================== .. autoclass:: tesseract_robotics.tesseract_task_composer.TaskComposerNode diff --git a/docs/requirements.txt b/docs/requirements.txt index 88b9656d0..328468426 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,5 @@ -sphinx +sphinx==6.2.1 sphinx_rtd_theme gitpython recommonmark +opencv-python diff --git a/examples/tesseract_planning_example_composer.py b/examples/tesseract_planning_example_composer.py index 8a5db6219..9eb327392 100644 --- a/examples/tesseract_planning_example_composer.py +++ b/examples/tesseract_planning_example_composer.py @@ -17,8 +17,8 @@ MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint, \ CartesianWaypointPoly_wrap_CartesianWaypoint, JointWaypointPoly_wrap_JointWaypoint -from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblemUPtr, \ - TaskComposerDataStorage, TaskComposerInput, TaskComposerProblemUPtr, PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr +from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, PlanningTaskComposerProblem, \ + TaskComposerDataStorage, TaskComposerContext from tesseract_robotics_viewer import TesseractViewer @@ -133,8 +133,7 @@ # Create the task composer node. In this case the FreespacePipeline is used. Many other are available. task = factory.createTaskComposerNode("FreespacePipeline") -# Get the input and output keys for the task -input_key = task.getInputKeys()[0] +# Get the output keys for the task output_key = task.getOutputKeys()[0] # Create a profile dictionary. Profiles can be customized by adding to this dictionary and setting the profiles @@ -145,24 +144,19 @@ # support implicit conversion from the CompositeInstruction to the AnyPoly. program_anypoly = AnyPoly_wrap_CompositeInstruction(program) -# Create the task data storage and set the data -task_data = TaskComposerDataStorage() -task_data.setData(input_key, program_anypoly) - # Create the task problem and input -task_planning_problem = PlanningTaskComposerProblemUPtr.make_unique(t_env, task_data, profiles) -task_problem = PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr(task_planning_problem) -task_input = TaskComposerInput(task_problem) +task_planning_problem = PlanningTaskComposerProblem(t_env, profiles) +task_planning_problem.input = program_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_input) +future = task_executor.run(task.get(), task_planning_problem) future.wait() # Retrieve the output, converting the AnyPoly back to a CompositeInstruction -results = AnyPoly_as_CompositeInstruction(task_input.data_storage.getData(output_key)) +results = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) # Display the output # Print out the resulting waypoints diff --git a/examples/tesseract_planning_example_no_composer.py b/examples/tesseract_planning_example_no_composer.py index c9b0f8db8..76c3c9cb4 100644 --- a/examples/tesseract_planning_example_no_composer.py +++ b/examples/tesseract_planning_example_no_composer.py @@ -8,7 +8,8 @@ CartesianWaypointPoly_wrap_CartesianWaypoint, MoveInstructionPoly_wrap_MoveInstruction, \ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly -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 from tesseract_robotics.tesseract_time_parameterization import TimeOptimalTrajectoryGeneration, \ diff --git a/tesseract_python/CMakeLists.txt b/tesseract_python/CMakeLists.txt index 900e787ef..9f664a734 100644 --- a/tesseract_python/CMakeLists.txt +++ b/tesseract_python/CMakeLists.txt @@ -27,10 +27,10 @@ endif() # find_package(tesseract_common REQUIRED) # find_package(tesseract_geometry REQUIRED) # find_package(tesseract_visualization REQUIRED) -# find_package(tesseract_collision REQUIRED) +find_package(tesseract_collision REQUIRED) # find_package(tesseract_urdf REQUIRED) # find_package(tesseract_srdf REQUIRED) -# find_package(tesseract_kinematics REQUIRED) +find_package(tesseract_kinematics REQUIRED) # find_package(tesseract_environment REQUIRED) # find_package(tesseract_scene_graph REQUIRED) # find_package(tesseract_command_language REQUIRED) diff --git a/tesseract_python/package.xml b/tesseract_python/package.xml index e55f983d7..26e2efbd3 100644 --- a/tesseract_python/package.xml +++ b/tesseract_python/package.xml @@ -1,7 +1,7 @@ tesseract_python - 0.2.0 + 0.3.0 The tesseract_python package John Wason Apache 2.0 diff --git a/tesseract_python/swig/tesseract_motion_planners_python.i b/tesseract_python/swig/tesseract_motion_planners_python.i index f7584838e..c7d6e567a 100644 --- a/tesseract_python/swig/tesseract_motion_planners_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_python.i @@ -37,10 +37,8 @@ // tesseract_motion_planners #include #include -#include #include #include -#include #include #include @@ -70,13 +68,6 @@ %include "tesseract_motion_planners/core/utils.h" -%ignore tesseract_planning::JointGroupInstructionInfo::getWorkingFrame; -%include "tesseract_motion_planners/core/interpolation.h" - %include "tesseract_motion_planners/robot_config.h" %template(getRobotConfig) tesseract_planning::getRobotConfig; %template(getJointTurns) tesseract_planning::getJointTurns; - -%include "tesseract_motion_planners/interface_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 dabf9139e..85e2ec721 100644 --- a/tesseract_python/swig/tesseract_motion_planners_simple_python.i +++ b/tesseract_python/swig/tesseract_motion_planners_simple_python.i @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -61,6 +62,9 @@ // tesseract_motion_planners_simple #define TESSERACT_MOTION_PLANNERS_SIMPLE_PUBLIC +%ignore tesseract_planning::JointGroupInstructionInfo::getWorkingFrame; +%include "tesseract_motion_planners/simple/interpolation.h" + %shared_ptr(tesseract_planning::SimplePlannerPlanProfile) %shared_ptr(tesseract_planning::SimplePlannerPlanCompositeProfile) %include "tesseract_motion_planners/simple/profile/simple_planner_profile.h" diff --git a/tesseract_python/swig/tesseract_task_composer_python.i b/tesseract_python/swig/tesseract_task_composer_python.i index 97a37bba8..642c82cba 100644 --- a/tesseract_python/swig/tesseract_task_composer_python.i +++ b/tesseract_python/swig/tesseract_task_composer_python.i @@ -85,7 +85,6 @@ #include #include #include -#include #include #include #include @@ -165,11 +164,11 @@ %include "tesseract_task_composer/core/task_composer_problem.h" -// task_composer_input -%s_u_ptr(TaskComposerInput) +// task_composer_context +%s_u_ptr(TaskComposerContext) // missing function definition -%ignore tesseract_planning::TaskComposerInput::abort; -%include "tesseract_task_composer/core/task_composer_input.h" +%ignore tesseract_planning::TaskComposerContext::abort; +%include "tesseract_task_composer/core/task_composer_context.h" // task_composer_node %s_u_ptr(TaskComposerNode) @@ -235,36 +234,33 @@ enum class future_status { %unique_ptr_as_planning(PlanningTaskComposerProblem, TaskComposerProblem); %unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(std::string name), %arg(name)); -%unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem,%arg(tesseract_planning::TaskComposerDataStorage input_data, +%unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem,%arg( tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, std::string name = "unset"), - %arg(input_data, profiles, name)); + %arg(profiles, name)); %unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(tesseract_environment::Environment::ConstPtr env, tesseract_common::ManipulatorInfo manip_info, - tesseract_planning::TaskComposerDataStorage input_data, tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, std::string name = "unset"), - %arg(env, manip_info, input_data, profiles, name)); -%unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(tesseract_environment::Environment::ConstPtr env, - tesseract_planning::TaskComposerDataStorage input_data, - tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, - std::string name = "unset"), - %arg(env, input_data, profiles, name)); + %arg(env, manip_info, profiles, name)); %unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(tesseract_environment::Environment::ConstPtr env, tesseract_common::ManipulatorInfo manip_info, tesseract_planning::ProfileRemapping move_profile_remapping, tesseract_planning::ProfileRemapping composite_profile_remapping, - tesseract_planning::TaskComposerDataStorage input_data, tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, std::string name = "unset"), - %arg(env, manip_info, move_profile_remapping, composite_profile_remapping, input_data, profiles, name)); + %arg(env, manip_info, move_profile_remapping, composite_profile_remapping, profiles, name)); + %unique_ptr_constructor(tesseract_planning::PlanningTaskComposerProblem, %arg(tesseract_environment::Environment::ConstPtr env, tesseract_planning::ProfileRemapping move_profile_remapping, tesseract_planning::ProfileRemapping composite_profile_remapping, - tesseract_planning::TaskComposerDataStorage input_data, tesseract_planning::ProfileDictionary::ConstPtr profiles = nullptr, std::string name = "unset"), - %arg(env, move_profile_remapping, composite_profile_remapping, input_data, profiles, name)); + %arg(env, move_profile_remapping, composite_profile_remapping, profiles, name)); +%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) diff --git a/tesseract_python/tests/tesseract_motion_planning/test_descartes_planner.py b/tesseract_python/tests/tesseract_motion_planning/test_descartes_planner.py index 0a04f9cd2..61b979b49 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_descartes_planner.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_descartes_planner.py @@ -12,10 +12,11 @@ MoveInstructionType_LINEAR, MoveInstruction, InstructionPoly, CartesianWaypointPoly, MoveInstructionPoly, \ CompositeInstruction, ProfileDictionary, InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly,\ 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_descartes import DescartesDefaultPlanProfileD, \ DescartesMotionPlannerD, DescartesPlanProfileD, \ ProfileDictionary_addProfile_DescartesPlanProfileD, cast_DescartesPlanProfileD +from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram from ..tesseract_support_resource_locator import TesseractSupportResourceLocator DESCARTES_DEFAULT_NAMESPACE = "DescartesMotionPlannerTask" 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 bf4c03dfa..d870674c2 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py @@ -14,9 +14,10 @@ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ JointWaypointPoly_wrap_JointWaypoint, 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_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator, \ OMPLProblemGeneratorFn, 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_trajopt_planner.py b/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py index 3376c4b39..69e173a08 100644 --- a/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py +++ b/tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py @@ -14,10 +14,11 @@ InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ JointWaypointPoly_wrap_JointWaypoint, 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_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \ TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ ProfileDictionary_addProfile_TrajOptCompositeProfile +from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 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 af6eada45..226825cd2 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 @@ -26,8 +26,7 @@ # TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \ # ProfileDictionary_addProfile_TrajOptCompositeProfile from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory, \ - TaskComposerDataStorage, TaskComposerInput, PlanningTaskComposerProblemUPtr, \ - PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr + TaskComposerDataStorage, TaskComposerContext, PlanningTaskComposerProblem from ..tesseract_support_resource_locator import TesseractSupportResourceLocator @@ -76,38 +75,40 @@ 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 + task = None + env, manip_info = get_environment() - config_path = FilesystemPath(os.path.join(TESSERACT_TASK_COMPOSER_DIR, "config/task_composer_plugins.yaml")) + config_path = FilesystemPath(os.path.join(TESSERACT_TASK_COMPOSER_DIR, "config/task_composer_plugins_no_trajopt_ifopt.yaml")) factory = TaskComposerPluginFactory(config_path) task = factory.createTaskComposerNode("TrajOptPipeline") + print("trajopt task name: " + task.getName()) - input_key = task.getInputKeys()[0] output_key = task.getOutputKeys()[0] profiles = ProfileDictionary() program = freespace_example_progam_iiwa(manip_info) - program_anypoly = AnyPoly_wrap_CompositeInstruction(program) - task_data = TaskComposerDataStorage() - task_data.setData(input_key, program_anypoly) + problem_input = AnyPoly_wrap_CompositeInstruction(program) - planning_task_problem = PlanningTaskComposerProblemUPtr.make_unique(env, task_data, profiles) - task_problem = PlanningTaskComposerProblemUPtr_as_TaskComposerProblemUPtr(planning_task_problem) - - task_input = TaskComposerInput(task_problem) - + planning_task_problem = PlanningTaskComposerProblem(env, profiles) + planning_task_problem.input = problem_input task_executor = factory.createTaskComposerExecutor("TaskflowExecutor") output_program = None try: - future = task_executor.run(task.get(), task_input) + future = task_executor.run(task.get(), planning_task_problem) future.wait() - output_program = AnyPoly_as_CompositeInstruction(task_input.data_storage.getData(output_key)) + output_program = AnyPoly_as_CompositeInstruction(future.context.data_storage.getData(output_key)) assert len(output_program) == 11 # Print out the output program @@ -125,11 +126,9 @@ def test_task_composer_trajopt_example(): finally: # Cleanup memory to prevent segfault on exit - del task_problem - del task_input + del planning_task_problem del output_program del future - del task_data del task_executor del task diff --git a/tools/extract_docs/extract_python_docs.py b/tools/extract_docs/extract_python_docs.py index e48e56a06..96f926bf8 100644 --- a/tools/extract_docs/extract_python_docs.py +++ b/tools/extract_docs/extract_python_docs.py @@ -188,7 +188,7 @@ def find_constants(): # Run jinja2 tempalate file api_docs_generated.rst.j2 from jinja2 import Environment, FileSystemLoader, select_autoescape env = Environment( - loader=FileSystemLoader(searchpath=""), + loader=FileSystemLoader(searchpath=f"{script_dir}"), autoescape=select_autoescape(['html', 'xml']) )