├── .github └── workflows │ ├── api_docs.yml │ ├── focal_build.yml │ ├── nightly.yml │ ├── vcpkg_triplets │ ├── arm64-osx-dynamic-release.cmake │ └── x64-osx-dynamic-release.cmake │ ├── wheels.yml │ └── windows_noetic_build.yml ├── README.md ├── ci ├── dependencies.rosinstall ├── dependencies_with_ext.rosinstall ├── docs ├── .gitignore ├── Makefile ├── _source │ ├── examples │ │ ├── collision.rst │ │ ├── examples.rst │ │ ├── kinematics.rst │ │ ├── planning_composer.rst │ │ └── planning_no_composer.rst │ ├── important_notes.rst │ └── modules │ │ ├── api.rst │ │ ├── tesseract_collision │ │ ├── api_docs_generated.rst │ │ └── tesseract_collision.rst │ │ ├── tesseract_command_language │ │ ├── api_docs_generated.rst │ │ └── tesseract_command_language.rst │ │ ├── tesseract_common │ │ ├── api_docs_generated.rst │ │ └── tesseract_common.rst │ │ ├── tesseract_environment │ │ ├── api_docs_generated.rst │ │ └── tesseract_environment.rst │ │ ├── tesseract_geometry │ │ ├── api_docs_generated.rst │ │ └── tesseract_geometry.rst │ │ ├── tesseract_kinematics │ │ ├── api_docs_generated.rst │ │ └── tesseract_kinematics.rst │ │ ├── tesseract_motion_planners │ │ ├── api_docs_generated.rst │ │ └── tesseract_motion_planners.rst │ │ ├── tesseract_motion_planners_descartes │ │ ├── api_docs_generated.rst │ │ └── tesseract_motion_planners_descartes.rst │ │ ├── tesseract_motion_planners_ompl │ │ ├── api_docs_generated.rst │ │ └── tesseract_motion_planners_ompl.rst │ │ ├── tesseract_motion_planners_simple │ │ ├── api_docs_generated.rst │ │ └── tesseract_motion_planners_simple.rst │ │ ├── tesseract_motion_planners_trajopt │ │ ├── api_docs_generated.rst │ │ └── tesseract_motion_planners_trajopt.rst │ │ ├── tesseract_robotics_viewer │ │ ├── index.rst │ │ ├── tesseract_robotics_viewer.rst │ │ └── tesseract_robotics_viewer_aio.rst │ │ ├── tesseract_scene_graph │ │ ├── api_docs_generated.rst │ │ └── tesseract_scene_graph.rst │ │ ├── tesseract_srdf │ │ ├── api_docs_generated.rst │ │ └── tesseract_srdf.rst │ │ ├── tesseract_state_solver │ │ ├── api_docs_generated.rst │ │ └── tesseract_state_solver.rst │ │ ├── tesseract_task_composer │ │ ├── api_docs_generated.rst │ │ └── tesseract_task_composer.rst │ │ ├── tesseract_time_parameterization │ │ ├── api_docs_generated.rst │ │ └── tesseract_time_parameterization.rst │ │ ├── tesseract_urdf │ │ ├── api_docs_generated.rst │ │ └── tesseract_urdf.rst │ │ └── tesseract_visualization │ │ ├── api_docs_generated.rst │ │ └── tesseract_visualization.rst ├── _static │ ├── clipboard.min.js │ ├── footer.jpg │ ├── logo.jpg │ ├── logo_512_300dpi.png │ ├── override.css │ └── tesseract_evolution.png ├── _templates │ ├── footer.html │ └── layout.html ├── _themes │ └── sphinx_rtd_theme │ │ ├── __init__.py │ │ ├── breadcrumbs.html │ │ ├── footer.html │ │ ├── layout.html │ │ ├── search.html │ │ ├── searchbox.html │ │ ├── static │ │ ├── css │ │ │ ├── badge_only.css │ │ │ └── theme.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── js │ │ │ ├── modernizr.min.js │ │ │ └── theme.js │ │ ├── theme.conf │ │ └── versions.html ├── conf.py ├── index.rst ├── preprocess_docstrings.py └── requirements.txt ├── doxygen.config ├── examples ├── tesseract_collision_example.py ├── tesseract_kinematics_example.py ├── tesseract_planning_example_composer.py └── tesseract_planning_example_no_composer.py ├── logo.png ├── tesseract_python ├── .gitignore ├── CMakeLists.txt ├── cmake │ ├── FindSWIG.cmake │ ├── __init__.py.in │ ├── __package_init__.py.in │ ├── install_build_wheel.cmake.in │ ├── setup.py.in │ └── tesseract_python_module.cmake ├── colcon.pkg ├── package.xml ├── swig │ ├── boost_filesystem_path.i │ ├── boost_uuid.i │ ├── console_bridge.i │ ├── eigen.i │ ├── eigen_geometry.i │ ├── eigen_types.i │ ├── json_typemaps.i │ ├── numpy.i │ ├── rework_include │ │ ├── tesseract_command_language │ │ │ ├── composite_instruction.i │ │ │ └── poly │ │ │ │ ├── cartesian_waypoint_poly.i │ │ │ │ ├── instruction_poly.i │ │ │ │ ├── joint_waypoint_poly.i │ │ │ │ ├── move_instruction_poly.i │ │ │ │ ├── state_waypoint_poly.i │ │ │ │ └── waypoint_poly.i │ │ ├── tesseract_common │ │ │ ├── any.i │ │ │ └── joint_state.i │ │ └── tesseract_kinematics │ │ │ └── core │ │ │ └── types.i │ ├── shared_factory.i │ ├── std_unique_ptr.i │ ├── tesseract_collision_python.i │ ├── tesseract_collisions_python_std_functions.h │ ├── tesseract_command_language_python.i │ ├── tesseract_command_language_python_std_functions.h │ ├── tesseract_common_python.i │ ├── tesseract_common_python_std_functions.h │ ├── tesseract_environment_python.i │ ├── tesseract_environment_python_std_functions.h │ ├── tesseract_geometry_python.i │ ├── tesseract_kinematics_python.i │ ├── tesseract_motion_planners_descartes_python.i │ ├── tesseract_motion_planners_ompl_python.i │ ├── tesseract_motion_planners_python.i │ ├── tesseract_motion_planners_simple_python.i │ ├── tesseract_motion_planners_trajopt_python.i │ ├── tesseract_scene_graph_python.i │ ├── tesseract_srdf_python.i │ ├── tesseract_state_solver_python.i │ ├── tesseract_std_function.i │ ├── tesseract_swig_include.i │ ├── tesseract_task_composer_python.i │ ├── tesseract_time_parameterization_python.i │ ├── tesseract_type_erasure_macros.i │ ├── tesseract_urdf_python.i │ ├── tesseract_vector_reference_wrapper_instruction_typemaps.i │ ├── tesseract_visualization_python.i │ ├── tinyxml2.i │ └── trajopt │ │ └── problem_description.i └── tests │ ├── __init__.py │ ├── tesseract_collision │ ├── __init__.py │ ├── test_collision_box_cone_unit.py │ └── test_collision_mesh_mesh_unit.py │ ├── tesseract_common │ └── test_tesseract_common.py │ ├── tesseract_environment │ ├── __init__.py │ ├── test_mesh_material_loading.py │ ├── test_tesseract_environment.py │ └── test_tesseract_environment_kingroup.py │ ├── tesseract_geometry │ └── test_tesseract_geometry.py │ ├── tesseract_kinematics │ ├── __init__.py │ ├── test_kdl_kinematics.py │ └── test_opw_kinematics.py │ ├── tesseract_motion_planning │ ├── __init__.py │ ├── test_descartes_planner.py │ ├── test_iterative_spline.py │ ├── test_ompl_planner.py │ ├── test_simple_planner.py │ ├── test_time_optimal_trajectory.py │ └── test_trajopt_planner.py │ ├── tesseract_scene_graph │ ├── __init__.py │ └── test_tesseract_scene_graph.py │ ├── tesseract_support_resource_locator.py │ └── tesseract_task_composer │ ├── __init__.py │ └── test_tesseract_task_composer.py ├── tesseract_viewer_python ├── .gitignore ├── CMakeLists.txt ├── colcon.pkg ├── examples │ ├── abb_irb2400_viewer.py │ ├── javascript │ │ ├── tesseract_viewer_python_iframe.html │ │ └── tesseract_viewer_python_iframe_trajectory.html │ ├── shapes_viewer.py │ ├── shapes_viewer_ssl_webxr_headset.py │ └── tesseract_material_mesh_viewer.py ├── package.xml ├── setup.py └── tesseract_robotics_viewer │ ├── __init__.py │ ├── resources │ ├── __init__.py │ ├── geometries.json │ └── static │ │ ├── app.js │ │ └── index.html │ ├── tesseract_env_to_gltf.py │ ├── tesseract_viewer.py │ ├── tesseract_viewer_aio.py │ └── util.py └── tools └── extract_docs ├── api_docs_generated.rst.j2 └── extract_python_docs.py /.github/workflows/api_docs.yml: -------------------------------------------------------------------------------- 1 | name: DeployDocumentation 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | run_number: 7 | description: 'Run number of the wheels workflow to pull documentation from' 8 | required: true 9 | 10 | jobs: 11 | collect_documentation: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: dawidd6/action-download-artifact@v2 15 | with: 16 | workflow: 'wheels.yml' 17 | run_number: ${{ github.event.inputs.run_number }} 18 | name: 'python-docs-ubuntu-20.04-3.10' 19 | path: 'docs' 20 | - uses: actions/upload-pages-artifact@v1 21 | with: 22 | path: 'docs' 23 | deploy_documentation: 24 | # Add a dependency to the build job 25 | needs: collect_documentation 26 | 27 | # Grant GITHUB_TOKEN the permissions required to make a Pages deployment 28 | permissions: 29 | pages: write # to deploy to Pages 30 | id-token: write # to verify the deployment originates from an appropriate source 31 | 32 | # Deploy to the github-pages environment 33 | environment: 34 | name: github-pages 35 | url: ${{ steps.deployment.outputs.page_url }} 36 | 37 | # Specify runner + deployment step 38 | runs-on: ubuntu-latest 39 | steps: 40 | - name: Deploy to GitHub Pages 41 | id: deployment 42 | uses: actions/deploy-pages@v1 43 | -------------------------------------------------------------------------------- /.github/workflows/focal_build.yml: -------------------------------------------------------------------------------- 1 | name: Focal-Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | schedule: 9 | - cron: '0 5 * * *' 10 | 11 | jobs: 12 | industrial_ci: 13 | name: Noetic 14 | runs-on: ubuntu-latest 15 | env: 16 | CI_NAME: Focal-Build 17 | OS_NAME: ubuntu 18 | OS_CODE_NAME: focal 19 | ROS_DISTRO: noetic 20 | ROS_REPO: main 21 | UPSTREAM_WORKSPACE: 'dependencies.rosinstall' 22 | ROSDEP_SKIP_KEYS: "bullet bullet-extras fcl ompl orocos_kdl python-numpy ifopt python descartes_opw descartes_samplers descartes_light opw_kinematics ros_industrial_cmake_boilerplate iwyu taskflow" 23 | DOCKER_IMAGE: "rosindustrial/tesseract:noetic" 24 | CCACHE_DIR: "/home/runner/work/tesseract_python/tesseract_python/Focal-Build/.ccache" 25 | PARALLEL_TESTS: false 26 | PARALLEL_BUILDS: false 27 | BEFORE_RUN_TARGET_TEST_EMBED: "ici_with_unset_variables source /root/target_ws/install/setup.bash" 28 | UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release" 29 | TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTESSERACT_ENABLE_TESTING=ON" 30 | CTEST_OUTPUT_ON_FAILURE: 1 31 | steps: 32 | - uses: actions/checkout@v1 33 | 34 | - name: Free Disk Space 35 | run: | 36 | sudo swapoff -a 37 | sudo rm -f /swapfile 38 | sudo apt clean 39 | docker rmi $(docker image ls -aq) 40 | df -h 41 | 42 | - name: Prepare ccache timestamp 43 | id: ccache_cache_timestamp 44 | shell: cmake -P {0} 45 | run: | 46 | string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) 47 | message("::set-output name=timestamp::${current_date}") 48 | 49 | - name: ccache cache files 50 | uses: actions/cache@v1.1.0 51 | with: 52 | path: ${{ env.CI_NAME }}/.ccache 53 | key: ${{ env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} 54 | restore-keys: | 55 | ${{ env.CI_NAME }}-ccache- 56 | 57 | - uses: 'ros-industrial/industrial_ci@master' 58 | env: ${{env}} 59 | -------------------------------------------------------------------------------- /.github/workflows/nightly.yml: -------------------------------------------------------------------------------- 1 | name: Nightly 2 | 3 | on: 4 | pull_request: 5 | types: [labeled] 6 | schedule: 7 | - cron: '0 5 * * *' 8 | 9 | jobs: 10 | industrial_ci: 11 | if: contains(github.event.pull_request.labels.*.name, 'check-tesseract-ros') || github.event.schedule == true 12 | name: ${{ matrix.env.CI_NAME }} 13 | runs-on: ubuntu-latest 14 | strategy: 15 | fail-fast: false 16 | matrix: 17 | env: 18 | - {CI_NAME: Bionic-Build-Nightly, 19 | OS_NAME: ubuntu, 20 | OS_CODE_NAME: bionic, 21 | ROS_DISTRO: melodic, 22 | ROS_REPO: main, 23 | UPSTREAM_WORKSPACE: 'dependencies.rosinstall', 24 | ROSDEP_SKIP_KEYS: "bullet bullet-extras ros_industrial_cmake_boilerplate fcl iwyu", 25 | DOCKER_IMAGE: "rosindustrial/tesseract:melodic", 26 | CCACHE_DIR: "/home/runner/work/tesseract_python/tesseract_python/Bionic-Build-Nightly/.ccache", 27 | PARALLEL_TESTS: false, 28 | UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release", 29 | TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release", 30 | DOWNSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"} 31 | - {CI_NAME: Focal-Build-Nightly, 32 | OS_NAME: ubuntu, 33 | OS_CODE_NAME: focal, 34 | ROS_DISTRO: noetic, 35 | ROS_REPO: main, 36 | UPSTREAM_WORKSPACE: 'dependencies.rosinstall', 37 | ROSDEP_SKIP_KEYS: "bullet bullet-extras ros_industrial_cmake_boilerplat fcl iwyu benchmark", 38 | DOCKER_IMAGE: "rosindustrial/tesseract:noetic", 39 | CCACHE_DIR: "/home/runner/work/tesseract_python/tesseract_python/Focal-Build-Nightly/.ccache", 40 | UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release", 41 | TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release", 42 | DOWNSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"} 43 | 44 | steps: 45 | - uses: actions/checkout@v1 46 | 47 | - name: Free Disk Space 48 | run: | 49 | sudo swapoff -a 50 | sudo rm -f /swapfile 51 | sudo apt clean 52 | docker rmi $(docker image ls -aq) 53 | df -h 54 | 55 | - name: Prepare ccache timestamp 56 | id: ccache_cache_timestamp 57 | shell: cmake -P {0} 58 | run: | 59 | string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) 60 | message("::set-output name=timestamp::${current_date}") 61 | 62 | - name: ccache cache files 63 | uses: actions/cache@v1.1.0 64 | with: 65 | path: ${{ matrix.env.CI_NAME }}/.ccache 66 | key: ${{ matrix.env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} 67 | restore-keys: | 68 | ${{ matrix.env.CI_NAME }}-ccache- 69 | 70 | - uses: 'ros-industrial/industrial_ci@master' 71 | env: ${{matrix.env}} 72 | -------------------------------------------------------------------------------- /.github/workflows/vcpkg_triplets/arm64-osx-dynamic-release.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE arm64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE dynamic) 4 | 5 | set(VCPKG_CMAKE_SYSTEM_NAME Darwin) 6 | set(VCPKG_OSX_ARCHITECTURES arm64) 7 | 8 | set(VCPKG_BUILD_TYPE release) 9 | set(VCPKG_OSX_DEPLOYMENT_TARGET 12.0) 10 | -------------------------------------------------------------------------------- /.github/workflows/vcpkg_triplets/x64-osx-dynamic-release.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE dynamic) 4 | 5 | set(VCPKG_CMAKE_SYSTEM_NAME Darwin) 6 | set(VCPKG_OSX_ARCHITECTURES x86_64) 7 | 8 | set(VCPKG_BUILD_TYPE release) 9 | set(VCPKG_OSX_DEPLOYMENT_TARGET 12.0) 10 | -------------------------------------------------------------------------------- /.github/workflows/windows_noetic_build.yml: -------------------------------------------------------------------------------- 1 | name: Windows-Noetic-Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | schedule: 9 | - cron: '0 5 * * *' 10 | 11 | jobs: 12 | windows_ci: 13 | name: Noetic 14 | runs-on: windows-2019 15 | env: 16 | ROS_DISTRO: noetic 17 | CTEST_OUTPUT_ON_FAILURE: 1 18 | steps: 19 | - uses: actions/checkout@v2 20 | with: 21 | submodules: recursive 22 | path: src/tesseract_python 23 | - name: Build 24 | shell: cmd 25 | run: | 26 | choco sources add -n=roswin -s https://aka.ms/ros/public --priority 1 27 | if %errorlevel% neq 0 exit /b %errorlevel% 28 | choco install ros-%ROS_DISTRO%-desktop_full -y --no-progress 29 | if %errorlevel% neq 0 exit /b %errorlevel% 30 | choco install swig 31 | C:/opt/ros/noetic/x64/python.exe -m pip uninstall pytest-rerunfailures -y 32 | if %errorlevel% neq 0 exit /b %errorlevel% 33 | 34 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 35 | call "C:\opt\ros\%ROS_DISTRO%\x64\setup.bat" 36 | 37 | set 38 | 39 | rosdep update 40 | 41 | vcs import --input "${{ github.workspace }}/src/tesseract_python/dependencies_with_ext.rosinstall" src/ 42 | 43 | rosdep install -q --from-paths . --ignore-src -y 44 | 45 | catkin_make_isolated --install --use-ninja --force-cmake --only-pkg-with-deps tesseract_python --cmake-args -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=C:/opt/ros/noetic/x64/python.exe -DPYTHON_LIBRARY=C:/opt/ros/noetic/x64/Lib/python38.lib -DINSTALL_OMPL=ON -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DINSTALL_FCL=ON -DINSTALL_BULLET=ON -DNO_OPENCL=ON 46 | if %errorlevel% neq 0 exit /b %errorlevel% 47 | call "%CD%\install_isolated\setup.bat" 48 | set TESSERACT_SUPPORT_DIR=%CD%\src\tesseract\tesseract_support 49 | set TESSERACT_TASK_COMPOSER_DIR=%GITHUB_WORKSPACE%\src\tesseract_planning\tesseract_task_composer 50 | C:/opt/ros/noetic/x64/python.exe -m pytest src\tesseract_python\tesseract_python 51 | if %errorlevel% neq 0 exit /b %errorlevel% 52 | -------------------------------------------------------------------------------- /ci: -------------------------------------------------------------------------------- 1 | .github/workflows/ -------------------------------------------------------------------------------- /dependencies.rosinstall: -------------------------------------------------------------------------------- 1 | - git: 2 | local-name: ros_industrial_cmake_boilerplate 3 | uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git 4 | version: 0.7.1 5 | - git: 6 | local-name: tesseract 7 | uri: https://github.com/tesseract-robotics/tesseract.git 8 | version: 0.28.0 9 | - git: 10 | local-name: tesseract_planning 11 | uri: https://github.com/tesseract-robotics/tesseract_planning.git 12 | version: 0.28.1 13 | - git: 14 | local-name: trajopt 15 | uri: https://github.com/tesseract-robotics/trajopt.git 16 | version: 0.28.0 17 | - git: 18 | local-name: descartes_light 19 | uri: https://github.com/swri-robotics/descartes_light.git 20 | version: 0.4.5 21 | - git: 22 | local-name: opw_kinematics 23 | uri: https://github.com/Jmeyer1292/opw_kinematics.git 24 | version: 0.5.2 25 | - git: 26 | local-name: ifopt 27 | uri: https://github.com/ethz-adrl/ifopt.git 28 | version: 2.1.3 29 | - git: 30 | local-name: ruckig 31 | uri: https://github.com/pantor/ruckig.git 32 | version: v0.9.2 -------------------------------------------------------------------------------- /dependencies_with_ext.rosinstall: -------------------------------------------------------------------------------- 1 | - git: 2 | local-name: ros_industrial_cmake_boilerplate 3 | uri: https://github.com/ros-industrial/ros_industrial_cmake_boilerplate.git 4 | version: 0.7.1 5 | - git: 6 | local-name: tesseract 7 | uri: https://github.com/tesseract-robotics/tesseract.git 8 | version: 0.28.0 9 | - git: 10 | local-name: tesseract_planning 11 | uri: https://github.com/tesseract-robotics/tesseract_planning.git 12 | version: 0.28.1 13 | - git: 14 | local-name: trajopt 15 | uri: https://github.com/tesseract-robotics/trajopt.git 16 | version: 0.28.0 17 | - git: 18 | local-name: descartes_light 19 | uri: https://github.com/swri-robotics/descartes_light.git 20 | version: 0.4.3 21 | - git: 22 | local-name: opw_kinematics 23 | uri: https://github.com/Jmeyer1292/opw_kinematics.git 24 | version: 0.5.0 25 | - git: 26 | local-name: ifopt 27 | uri: https://github.com/ethz-adrl/ifopt.git 28 | version: 2.1.3 29 | - git: 30 | local-name: ruckig 31 | uri: https://github.com/pantor/ruckig.git 32 | version: v0.9.2 33 | - git: 34 | local-name: tesseract_ext 35 | uri: https://github.com/tesseract-robotics/tesseract_ext.git 36 | version: master 37 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | readme.md -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = SphinxTest 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/_source/examples/collision.rst: -------------------------------------------------------------------------------- 1 | tesseract_collision_example.py 2 | ============================== 3 | 4 | .. literalinclude:: ../../../examples/tesseract_collision_example.py 5 | :language: python 6 | :caption: Example demonstrating collision checking 7 | :name: tesseract_collision_example.py 8 | 9 | -------------------------------------------------------------------------------- /docs/_source/examples/examples.rst: -------------------------------------------------------------------------------- 1 | Examples 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Examples 7 | 8 | collision 9 | kinematics 10 | planning_composer 11 | planning_no_composer 12 | -------------------------------------------------------------------------------- /docs/_source/examples/kinematics.rst: -------------------------------------------------------------------------------- 1 | tesseract_kinematics_example.py 2 | ============================== 3 | 4 | .. literalinclude:: ../../../examples/tesseract_kinematics_example.py 5 | :language: python 6 | :caption: Example demonstrating forward and inverse kinematics 7 | :name: tesseract_kinematics_example.py 8 | 9 | -------------------------------------------------------------------------------- /docs/_source/examples/planning_composer.rst: -------------------------------------------------------------------------------- 1 | tesseract_planning_example_composer.py 2 | ============================== 3 | 4 | .. literalinclude:: ../../../examples/tesseract_planning_example_composer.py 5 | :language: python 6 | :caption: Example demonstrating planning using the task composer 7 | :name: tesseract_planning_example_composer.py 8 | 9 | -------------------------------------------------------------------------------- /docs/_source/examples/planning_no_composer.rst: -------------------------------------------------------------------------------- 1 | tesseract_planning_example_no_composer.py 2 | ============================== 3 | 4 | .. literalinclude:: ../../../examples/tesseract_planning_example_no_composer.py 5 | :language: python 6 | :caption: Example demonstrating planning without using the task composer 7 | :name: tesseract_planning_example_no_composer.py 8 | 9 | -------------------------------------------------------------------------------- /docs/_source/modules/api.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | :caption: API Reference: 7 | 8 | tesseract_common 9 | tesseract_geometry 10 | tesseract_collision 11 | tesseract_scene_graph 12 | tesseract_srdf 13 | tesseract_urdf 14 | tesseract_state_solver 15 | tesseract_kinematics 16 | tesseract_environment 17 | tesseract_visualization 18 | tesseract_command_language 19 | tesseract_motion_planners 20 | tesseract_motion_planners_descartes 21 | tesseract_motion_planners_trajopt 22 | tesseract_motion_planners_ompl 23 | tesseract_motion_planners_simple 24 | tesseract_time_parameterization 25 | tesseract_task_composer 26 | tesseract_robotics_viewer -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_collision/tesseract_collision.rst: -------------------------------------------------------------------------------- 1 | ====================================== 2 | tesseract_robotics.tesseract_collision 3 | ====================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module is used to provide collision checking capabilities for Tesseract. See ``tesseract_collision_example.py`` 11 | for an example of how to use collision checking. Collision checking is implemented by plugins that need to be configured. 12 | See the main Tesseract documentation for more information on how to configure plugins. 13 | 14 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_command_language/tesseract_command_language.rst: -------------------------------------------------------------------------------- 1 | ============================================= 2 | tesseract_robotics.tesseract_command_language 3 | ============================================= 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | The command language is used to describe a sequence of commands that can be executed by a robot. The command language is 11 | used to provide input waypoint sequences to the planner, and receive output trajectories from the planner. 12 | 13 | The command language makes heavy use of type erasure. Unfortunately type erasure does not work with Python, 14 | so module level utility functions must be used to create and cast instructions and waypoints. Example 15 | commands that are frequently used are ``CartesianWaypointPoly_wrap_CartesianWaypoint``, 16 | ``MoveInstructionPoly_wrap_MoveInstruction``, ``InstructionPoly_as_MoveInstructionPoly``, 17 | and ``WaypointPoly_as_StateWaypointPoly``, howevere there are many more. While these conversions can be done 18 | implicitly in C++, they must be done explicitly in Python. 19 | 20 | The ``ProfileDictionary`` has a similar problem, and must use special accessor functions that are created for 21 | each types that is stored in the dictionary. For instance, for ``OMPLDefaultPlanProfile`` the accessor 22 | function ``ProfileDictionary_addProfile_OMPLPlanProfile`` must be used to store the profile in the dictionary. 23 | See the planning examples for examples of using the accessors for the profile dictionary, and see the 24 | ``ProfileDictionary_*`` accessor functions available in each module. 25 | 26 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_common/tesseract_common.rst: -------------------------------------------------------------------------------- 1 | =================================== 2 | tesseract_robotics.tesseract_common 3 | =================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | Introduction 11 | ************ 12 | 13 | ``tesseract_common`` contains functionality that is common to all tesseract modules. This includes general types, 14 | container templates, utility functions, and more. The Python wrappers contain additional functionality for 15 | using with Eigen Geometry, Boost Filesystem, Boost Uuid, console_bridge, and TinyXML2. 16 | 17 | Eigen Geometry 18 | ============== 19 | 20 | Matrix and vector types for Eigen are automatically converted to NumPy arrays when returned from a function, and 21 | NumPy arrays are automatically converted to Eigen types when passed into a function. This works for matrices and 22 | vectors, but does not work well for the Eigen geometry types used by Tesseract. The following Eigen classes are 23 | available in ``tesseract_common``: 24 | 25 | * ``Quaterniond`` - Represents a Quaternion in (w,x,y,z) format 26 | * ``AngleAxisd`` - Represents a rotation as an angle around an axis 27 | * ``Translation3d`` - Represents a translation in 3D space 28 | * ``Isometry3d`` - Represents a rotation and translation in 3D space. This is used by Tesseract to represent transforms and poses. 29 | 30 | Resource Locators 31 | ================= 32 | 33 | Resource locators are used by Tesseract to locate resources such as meshes, urdfs, srdfs, etc. The 34 | :py:class:`tesseract_common.GeneralResourceLocator` class is available to locate resources in Python. This 35 | class searches paths in the environmental variable ``TESSERACT_RESOURCE_PATH`` to find resources. Each ``package:///`` 36 | will search for the subdirectory ```` in each path in ``TESSERACT_RESOURCE_PATH``. 37 | 38 | It is also possible to create a custom resource locator. See the ``TesseractSupportResourceLocator`` in the 39 | unit tests for an example of a custom resource locator. 40 | 41 | Boost Filesystem 42 | ================ 43 | 44 | ``boost::filesystem::path`` is used by Tesseract to represent file paths. Because of function overloads, it is not 45 | possible to use strings for filesystems. The ``FileSystem`` path class is used as a container for paths 46 | to allow the correct function overloads to be selected. 47 | 48 | Boost Uuid 49 | ========== 50 | 51 | The ``boost::uuids::uuid`` is used by Tesseract to represent unique identifiers. The ``Uuid`` class is available 52 | to represent ``boost::uuids::uuid`` in Python. 53 | 54 | The ``newRandomUuid`` function is available to generate a random ``Uuid`` in Python. 55 | 56 | Console Bridge 57 | ============== 58 | 59 | The ``console_bridge`` package is used by Tesseract to provide logging functionality. Several functions are available 60 | to modify the logging level and to log messages: 61 | 62 | The following module level functions are available to modify the logging behavior: 63 | 64 | * ``getLogLevel()`` 65 | * ``setLogLevel()`` 66 | * ``useOutputHandler()`` 67 | * ``noOutputHandler()`` 68 | 69 | The following module level constants are available for setting the logging level: 70 | 71 | * ``CONSOLE_BRIDGE_LOG_NONE`` 72 | * ``CONSOLE_BRIDGE_LOG_ERROR`` 73 | * ``CONSOLE_BRIDGE_LOG_WARN`` 74 | * ``CONSOLE_BRIDGE_LOG_INFO`` 75 | * ``CONSOLE_BRIDGE_LOG_DEBUG`` 76 | 77 | The ``useOutputHandler()`` function can be used with the ``OutputHandler`` class to capture logging messages in Python: 78 | 79 | .. code-block:: python 80 | 81 | class MyOutputHandler(tesseract_common.OutputHandler): 82 | def __init__(self): 83 | super().__init__() 84 | 85 | def log(self, text, level, filename, line): 86 | # Do something with the logging message 87 | print(text) 88 | 89 | output_handler = MyOutputHandler() 90 | tesseract_common.useOutputHandler(output_handler) 91 | 92 | # Always restore the original output handler when done to avoid segfaults on exit 93 | tesseract_common.restorePreviousOutputHandler() 94 | 95 | TinyXML2 Support 96 | ================ 97 | 98 | The `tinyxml2` package is used to serialize and deserialize Tesseract types. The `tinyxml2` wrappers are included 99 | in the `tesseract_common` package to allow for serialization and deserialization of Tesseract types in Python. 100 | 101 | .. include:: ./api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_environment/tesseract_environment.rst: -------------------------------------------------------------------------------- 1 | ======================================== 2 | tesseract_robotics.tesseract_environment 3 | ======================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | The :mod:`tesseract_robotics.tesseract_environment` module contains the core classes for representing the environment. 11 | These are typically constructed using URDF and SRDF files. The functions in the environment can be used to access 12 | collision checkers and kinematics utility classes. Planners require an environment to plan in. 13 | 14 | The environment can be modified using "Environment Command" classes, that are executed using the 15 | ``applyCommand`` or ``applyCommands`` functions. 16 | 17 | 18 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_geometry/tesseract_geometry.rst: -------------------------------------------------------------------------------- 1 | ===================================== 2 | tesseract_robotics.tesseract_geometry 3 | ===================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module contains the geometry data structures for Tesseract. The user dose not typically need to use 11 | these classes since they are loaded from URDF. However, they are available for use for purposes such as 12 | dynamically modifying the environment using "Environment Commands". 13 | 14 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_kinematics/tesseract_kinematics.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | tesseract_robotics.tesseract_kinematics 3 | ================================= 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides kinematics support. These are typically accessed through the environment classes. See 11 | `tesseract_kinematics_example.py` for examples of using forward and inverse kinematics. The kinematics 12 | functionality is provided using plugins, that must be configured by yaml files. See the documentation for the main 13 | Tesseract package for more details on configuring plugins. 14 | See the example for more information. 15 | 16 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | MotionPlanner Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_motion_planners.MotionPlanner 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | MotionPlannerUPtr Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_motion_planners.MotionPlannerUPtr 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | PlannerRequest Class 21 | =================================================================================================== 22 | .. autoclass:: tesseract_robotics.tesseract_motion_planners.PlannerRequest 23 | :noindex: 24 | :exclude-members: thisown 25 | :members: 26 | 27 | PlannerResponse Class 28 | =================================================================================================== 29 | .. autoclass:: tesseract_robotics.tesseract_motion_planners.PlannerResponse 30 | :noindex: 31 | :exclude-members: thisown 32 | :members: 33 | 34 | 35 | Functions 36 | ********* 37 | 38 | assignCurrentStateAsSeed Function 39 | =================================================================================================== 40 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.assignCurrentStateAsSeed 41 | :noindex: 42 | 43 | contactCheckProgram Function 44 | =================================================================================================== 45 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.contactCheckProgram 46 | :noindex: 47 | 48 | formatProgram Function 49 | =================================================================================================== 50 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.formatProgram 51 | :noindex: 52 | 53 | getJointTurns Function 54 | =================================================================================================== 55 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.getJointTurns 56 | :noindex: 57 | 58 | getRobotConfig Function 59 | =================================================================================================== 60 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.getRobotConfig 61 | :noindex: 62 | 63 | toToolpath Function 64 | =================================================================================================== 65 | .. autofunction:: tesseract_robotics.tesseract_motion_planners.toToolpath 66 | :noindex: 67 | 68 | Constants 69 | ********* 70 | 71 | * ``RobotConfig_FDB`` 72 | * ``RobotConfig_FDT`` 73 | * ``RobotConfig_FUB`` 74 | * ``RobotConfig_FUT`` 75 | * ``RobotConfig_NDB`` 76 | * ``RobotConfig_NDT`` 77 | * ``RobotConfig_NUB`` 78 | * ``RobotConfig_NUT`` 79 | 80 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners/tesseract_motion_planners.rst: -------------------------------------------------------------------------------- 1 | ============================================ 2 | tesseract_robotics.tesseract_motion_planners 3 | ============================================ 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides common motion planning functionality for Tesseract. Specific planners are located in 11 | their own packages. Planning is typically done using the ``tesseract_task_composer`` interface. 12 | 13 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners_descartes/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | DescartesDefaultPlanProfileD Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_motion_planners_descartes.DescartesDefaultPlanProfileD 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | DescartesMotionPlannerD Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_motion_planners_descartes.DescartesMotionPlannerD 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | DescartesPlanProfileD Class 21 | =================================================================================================== 22 | .. autoclass:: tesseract_robotics.tesseract_motion_planners_descartes.DescartesPlanProfileD 23 | :noindex: 24 | :exclude-members: thisown 25 | :members: 26 | 27 | PoseSamplerFn Class 28 | =================================================================================================== 29 | .. autoclass:: tesseract_robotics.tesseract_motion_planners_descartes.PoseSamplerFn 30 | :noindex: 31 | :exclude-members: thisown 32 | :members: 33 | 34 | PoseSamplerFnBase Class 35 | =================================================================================================== 36 | .. autoclass:: tesseract_robotics.tesseract_motion_planners_descartes.PoseSamplerFnBase 37 | :noindex: 38 | :exclude-members: thisown 39 | :members: 40 | 41 | 42 | Functions 43 | ********* 44 | 45 | cast_DescartesPlanProfileD Function 46 | =================================================================================================== 47 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.cast_DescartesPlanProfileD 48 | :noindex: 49 | 50 | sampleFixed Function 51 | =================================================================================================== 52 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.sampleFixed 53 | :noindex: 54 | 55 | sampleToolAxis Function 56 | =================================================================================================== 57 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.sampleToolAxis 58 | :noindex: 59 | 60 | sampleToolXAxis Function 61 | =================================================================================================== 62 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.sampleToolXAxis 63 | :noindex: 64 | 65 | sampleToolYAxis Function 66 | =================================================================================================== 67 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.sampleToolYAxis 68 | :noindex: 69 | 70 | sampleToolZAxis Function 71 | =================================================================================================== 72 | .. autofunction:: tesseract_robotics.tesseract_motion_planners_descartes.sampleToolZAxis 73 | :noindex: 74 | 75 | Container Templates 76 | ******************* 77 | 78 | * ``DescartesPlanProfileMapD`` -> ``std::unordered_map>>`` 79 | 80 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners_descartes/tesseract_motion_planners_descartes.rst: -------------------------------------------------------------------------------- 1 | ====================================================== 2 | tesseract_robotics.tesseract_motion_planners_descartes 3 | ====================================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides a Descartes motion planner for Tesseract. Descartes is a library for Cartesian planning. 11 | Planning is typically done using the ``tesseract_task_composer`` interface. 12 | 13 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners_ompl/tesseract_motion_planners_ompl.rst: -------------------------------------------------------------------------------- 1 | ================================================= 2 | tesseract_robotics.tesseract_motion_planners_ompl 3 | ================================================= 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides access to the OMPL motion planner library. OMPL provides a large number of motion planners. 11 | The exact planner is configured using the planner "profiles" available in This module. 12 | Planning is typically done using the ``tesseract_task_composer`` interface. 13 | 14 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners_simple/tesseract_motion_planners_simple.rst: -------------------------------------------------------------------------------- 1 | =================================================== 2 | tesseract_robotics.tesseract_motion_planners_simple 3 | =================================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides simple interpolation planners for Tesseract. These interpolation planners are typically 11 | used to increase the density of waypoints before passing to another planner such as TrajOpt or Descartes. 12 | Planning is typically done using the ``tesseract_task_composer`` interface. 13 | 14 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_motion_planners_trajopt/tesseract_motion_planners_trajopt.rst: -------------------------------------------------------------------------------- 1 | ==================================================== 2 | tesseract_robotics.tesseract_motion_planners_trajopt 3 | ==================================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | This module provides access to the TrajOpt motion planner library. TrajOpt is a local optimizer for trajectories. 11 | If it is likely a local planner will not find a direct path, an OMPL planner can be used to find a clear path, 12 | and then use TrajOpt to optimize the path. 13 | Planning is typically done using the ``tesseract_task_composer`` interface. 14 | 15 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_robotics_viewer/index.rst: -------------------------------------------------------------------------------- 1 | tesseract_robotics_viewer Package 2 | ========================= 3 | 4 | The ``tesseract-robotics-viewer`` package provides a web browser based viewer for the Tesseract environment using 5 | ThreeJS. The viewer is designed to be simple and portable for use with planning development and 6 | monitoring. 7 | 8 | The package must be installed separately from the main ``tesseract-robotics`` package. 9 | 10 | .. code-block:: bash 11 | 12 | python -m pip install tesseract-robotics-viewer 13 | 14 | The viewer provides a synchronous and asynchronous interface. The class ``tesseract_robotics_viewer.TesseractViewer`` 15 | provides the synchronous viewer. The class ``tesseract_robotics_viewer.tesseract_viewer_aio.TesseractViewerAIO`` 16 | provides the asynchronous implementation. 17 | 18 | See the main ``tesseract_robotics`` Python examples for examples of using the viewer. These examples use the viewer 19 | to display the planned trajectories. 20 | 21 | API 22 | --- 23 | 24 | .. toctree:: 25 | :maxdepth: 4 26 | :caption: Viewer API Reference: 27 | 28 | tesseract_robotics_viewer 29 | tesseract_robotics_viewer_aio 30 | 31 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_robotics_viewer/tesseract_robotics_viewer.rst: -------------------------------------------------------------------------------- 1 | tesseract_robotics_viewer Module 2 | ================================= 3 | 4 | .. autoclass:: tesseract_robotics_viewer.TesseractViewer 5 | :members: -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_robotics_viewer/tesseract_robotics_viewer_aio.rst: -------------------------------------------------------------------------------- 1 | tesseract_robotics_viewer.tesseract_viewer_aio Module 2 | ================================= 3 | 4 | .. autoclass:: tesseract_robotics_viewer.tesseract_viewer_aio.TesseractViewerAIO 5 | :members: -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_scene_graph/tesseract_scene_graph.rst: -------------------------------------------------------------------------------- 1 | ======================================== 2 | tesseract_robotics.tesseract_scene_graph 3 | ======================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | The `tesseract_scene_graph` package manages the scene graph for the Tesseract environment. The user will typically 11 | only use classes in This module if modifying the environment after it has been loaded from a URDF. 12 | 13 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_srdf/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | KinematicsInformation Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_srdf.KinematicsInformation 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | SRDFModel Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_srdf.SRDFModel 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | 21 | Functions 22 | ********* 23 | 24 | compareLinkPairAlphabetically Function 25 | =================================================================================================== 26 | .. autofunction:: tesseract_robotics.tesseract_srdf.compareLinkPairAlphabetically 27 | :noindex: 28 | 29 | getAlphabeticalACMKeys Function 30 | =================================================================================================== 31 | .. autofunction:: tesseract_robotics.tesseract_srdf.getAlphabeticalACMKeys 32 | :noindex: 33 | 34 | parseCalibrationConfigString Function 35 | =================================================================================================== 36 | .. autofunction:: tesseract_robotics.tesseract_srdf.parseCalibrationConfigString 37 | :noindex: 38 | 39 | parseContactManagersPluginConfigString Function 40 | =================================================================================================== 41 | .. autofunction:: tesseract_robotics.tesseract_srdf.parseContactManagersPluginConfigString 42 | :noindex: 43 | 44 | parseKinematicsPluginConfigString Function 45 | =================================================================================================== 46 | .. autofunction:: tesseract_robotics.tesseract_srdf.parseKinematicsPluginConfigString 47 | :noindex: 48 | 49 | processSRDFAllowedCollisions Function 50 | =================================================================================================== 51 | .. autofunction:: tesseract_robotics.tesseract_srdf.processSRDFAllowedCollisions 52 | :noindex: 53 | 54 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_srdf/tesseract_srdf.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | tesseract_robotics.tesseract_srdf 3 | ================================= 4 | 5 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_state_solver/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | KDLStateSolver Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_state_solver.KDLStateSolver 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | MutableStateSolver Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_state_solver.MutableStateSolver 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | MutableStateSolverUPtr Class 21 | =================================================================================================== 22 | .. autoclass:: tesseract_robotics.tesseract_state_solver.MutableStateSolverUPtr 23 | :noindex: 24 | :exclude-members: thisown 25 | :members: 26 | 27 | OFKTStateSolver Class 28 | =================================================================================================== 29 | .. autoclass:: tesseract_robotics.tesseract_state_solver.OFKTStateSolver 30 | :noindex: 31 | :exclude-members: thisown 32 | :members: 33 | 34 | StateSolver Class 35 | =================================================================================================== 36 | .. autoclass:: tesseract_robotics.tesseract_state_solver.StateSolver 37 | :noindex: 38 | :exclude-members: thisown 39 | :members: 40 | 41 | StateSolverUPtr Class 42 | =================================================================================================== 43 | .. autoclass:: tesseract_robotics.tesseract_state_solver.StateSolverUPtr 44 | :noindex: 45 | :exclude-members: thisown 46 | :members: 47 | 48 | 49 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_state_solver/tesseract_state_solver.rst: -------------------------------------------------------------------------------- 1 | ========================================= 2 | tesseract_robotics.tesseract_state_solver 3 | ========================================= 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | The StateSolver is used to solve the transforms within the environment given a set of joints and joint positions. 11 | It is loaded from a plugin. 12 | 13 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_task_composer/tesseract_task_composer.rst: -------------------------------------------------------------------------------- 1 | ==================================================== 2 | tesseract_robotics.tesseract_task_composer 3 | ==================================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | The TaskComposer is used to create pipelines and decision trees for planning. See the examples for more details. 11 | 12 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_time_parameterization/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | InstructionsTrajectory Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_time_parameterization.InstructionsTrajectory 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | IterativeSplineParameterization Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_time_parameterization.IterativeSplineParameterization 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | RuckigTrajectorySmoothing Class 21 | =================================================================================================== 22 | .. autoclass:: tesseract_robotics.tesseract_time_parameterization.RuckigTrajectorySmoothing 23 | :noindex: 24 | :exclude-members: thisown 25 | :members: 26 | 27 | TimeOptimalTrajectoryGeneration Class 28 | =================================================================================================== 29 | .. autoclass:: tesseract_robotics.tesseract_time_parameterization.TimeOptimalTrajectoryGeneration 30 | :noindex: 31 | :exclude-members: thisown 32 | :members: 33 | 34 | TrajectoryContainer Class 35 | =================================================================================================== 36 | .. autoclass:: tesseract_robotics.tesseract_time_parameterization.TrajectoryContainer 37 | :noindex: 38 | :exclude-members: thisown 39 | :members: 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_time_parameterization/tesseract_time_parameterization.rst: -------------------------------------------------------------------------------- 1 | ================================================== 2 | tesseract_robotics.tesseract_time_parameterization 3 | ================================================== 4 | 5 | .. contents:: Table of Contents 6 | :depth: 2 7 | :local: 8 | :backlinks: none 9 | 10 | Time parameterization is used to assign time values to a trajectory based on the limits of the robot. 11 | 12 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_urdf/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | 7 | Functions 8 | ********* 9 | 10 | parseURDFFile Function 11 | =================================================================================================== 12 | .. autofunction:: tesseract_robotics.tesseract_urdf.parseURDFFile 13 | :noindex: 14 | 15 | parseURDFString Function 16 | =================================================================================================== 17 | .. autofunction:: tesseract_robotics.tesseract_urdf.parseURDFString 18 | :noindex: 19 | 20 | writeURDFFile Function 21 | =================================================================================================== 22 | .. autofunction:: tesseract_robotics.tesseract_urdf.writeURDFFile 23 | :noindex: 24 | 25 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_urdf/tesseract_urdf.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | tesseract_robotics.tesseract_urdf 3 | ================================= 4 | 5 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_visualization/api_docs_generated.rst: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | 6 | ArrowMarker Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.tesseract_visualization.ArrowMarker 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | 13 | AxisMarker Class 14 | =================================================================================================== 15 | .. autoclass:: tesseract_robotics.tesseract_visualization.AxisMarker 16 | :noindex: 17 | :exclude-members: thisown 18 | :members: 19 | 20 | ContactResultsMarker Class 21 | =================================================================================================== 22 | .. autoclass:: tesseract_robotics.tesseract_visualization.ContactResultsMarker 23 | :noindex: 24 | :exclude-members: thisown 25 | :members: 26 | 27 | GeometryMarker Class 28 | =================================================================================================== 29 | .. autoclass:: tesseract_robotics.tesseract_visualization.GeometryMarker 30 | :noindex: 31 | :exclude-members: thisown 32 | :members: 33 | 34 | Marker Class 35 | =================================================================================================== 36 | .. autoclass:: tesseract_robotics.tesseract_visualization.Marker 37 | :noindex: 38 | :exclude-members: thisown 39 | :members: 40 | 41 | ToolpathMarker Class 42 | =================================================================================================== 43 | .. autoclass:: tesseract_robotics.tesseract_visualization.ToolpathMarker 44 | :noindex: 45 | :exclude-members: thisown 46 | :members: 47 | 48 | TrajectoryInterpolator Class 49 | =================================================================================================== 50 | .. autoclass:: tesseract_robotics.tesseract_visualization.TrajectoryInterpolator 51 | :noindex: 52 | :exclude-members: thisown 53 | :members: 54 | 55 | TrajectoryPlayer Class 56 | =================================================================================================== 57 | .. autoclass:: tesseract_robotics.tesseract_visualization.TrajectoryPlayer 58 | :noindex: 59 | :exclude-members: thisown 60 | :members: 61 | 62 | Visualization Class 63 | =================================================================================================== 64 | .. autoclass:: tesseract_robotics.tesseract_visualization.Visualization 65 | :noindex: 66 | :exclude-members: thisown 67 | :members: 68 | 69 | VisualizationLoader Class 70 | =================================================================================================== 71 | .. autoclass:: tesseract_robotics.tesseract_visualization.VisualizationLoader 72 | :noindex: 73 | :exclude-members: thisown 74 | :members: 75 | 76 | 77 | Constants 78 | ********* 79 | 80 | * ``MarkerType_ARROW`` 81 | * ``MarkerType_AXIS`` 82 | * ``MarkerType_CONTACT_RESULTS`` 83 | * ``MarkerType_GEOMETRY`` 84 | * ``MarkerType_LINE_LIST`` 85 | * ``MarkerType_LINE_STRIP`` 86 | * ``MarkerType_NONE`` 87 | * ``MarkerType_POINTS`` 88 | * ``MarkerType_TEXT`` 89 | * ``MarkerType_TOOLPATH`` 90 | * ``MarkerType_TRIANGLE_FAN`` 91 | * ``MarkerType_TRIANGLE_LIST`` 92 | * ``MarkerType_TRIANGLE_STRIP`` 93 | * ``MarkerType_USER_DEFINED`` 94 | 95 | -------------------------------------------------------------------------------- /docs/_source/modules/tesseract_visualization/tesseract_visualization.rst: -------------------------------------------------------------------------------- 1 | ========================================== 2 | tesseract_robotics.tesseract_visualization 3 | ========================================== 4 | 5 | .. include:: api_docs_generated.rst -------------------------------------------------------------------------------- /docs/_static/footer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_static/footer.jpg -------------------------------------------------------------------------------- /docs/_static/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_static/logo.jpg -------------------------------------------------------------------------------- /docs/_static/logo_512_300dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_static/logo_512_300dpi.png -------------------------------------------------------------------------------- /docs/_static/override.css: -------------------------------------------------------------------------------- 1 | .icon:before { 2 | white-space: pre-wrap !important; 3 | } 4 | .header-override { 5 | margin-bottom: 20px; 6 | } 7 | .header-override p { 8 | padding: 5px; 9 | font-size: 1.2em; 10 | text-align: right; 11 | } 12 | 13 | .wy-breadcrumbs li.wy-breadcrumbs-aside { 14 | display: block; 15 | width: 100%; 16 | text-align: right; 17 | margin-bottom: -25px; 18 | } 19 | 20 | .btn-copyboard { 21 | opacity: 0.20; 22 | background-color: #00adef; 23 | color: #ffffff; 24 | white-space: nowrap; 25 | padding: 2px 2px; 26 | position: relative; 27 | float: right; 28 | transition:opacity 0.3s ease-in-out; 29 | -webkit-transition:opacity 0.3s ease-in-out; 30 | -o-transition:opacity 0.3s ease-in-out; 31 | } 32 | 33 | .btn-copyboard:hover { 34 | background-color: #00adef; 35 | color: #ffffff; 36 | opacity:1; 37 | } 38 | 39 | .btn-copyboard:hover::after, .btn-copyboard:focus, .btn-copyboard:active { 40 | background-color: #00adef; 41 | color: #ffffff; 42 | } 43 | -------------------------------------------------------------------------------- /docs/_static/tesseract_evolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_static/tesseract_evolution.png -------------------------------------------------------------------------------- /docs/_templates/footer.html: -------------------------------------------------------------------------------- 1 |
2 | {% if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %} 3 | 11 | {% endif %} 12 | 13 |
14 | 15 | 20 | 21 |
22 |

23 | {%- if show_copyright %} 24 | {%- if hasdoc('copyright') %} 25 | {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}{% endtrans %} 26 | {%- else %} 27 | {% trans copyright=copyright|e %}© Copyright {{ copyright }}{% endtrans %} 28 | {%- endif %} 29 | {%- endif %} 30 | 31 | {%- if build_id and build_url %} 32 | {% trans build_url=build_url, build_id=build_id %} 33 | 34 | Build 35 | {{ build_id }}. 36 | 37 | {% endtrans %} 38 | {%- elif commit %} 39 | {% trans commit=commit %} 40 | 41 | Revision {{ commit }}. 42 | 43 | {% endtrans %} 44 | {%- elif last_updated %} 45 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} 46 | {%- endif %} 47 | 48 |

49 |
50 | 51 | {%- if show_sphinx %} 52 | {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. 53 | {%- endif %} 54 | 55 | {%- block extrafooter %} {% endblock %} 56 | 57 |
58 | -------------------------------------------------------------------------------- /docs/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends '!layout.html' %} 2 | 3 | {% block extrabody %} 4 | 5 | {% endblock %} 6 | 7 | {% block extracontent %} 8 |
9 | 10 | 11 | 12 |

13 | ROS-Industrial Website|Blog 14 |

15 |
16 | {% endblock %} 17 | 18 | {% block footer %} 19 | 39 | {% endblock %} 40 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | from os import path 7 | 8 | __version__ = '0.4.2' 9 | __version_full__ = __version__ 10 | 11 | 12 | def get_html_theme_path(): 13 | """Return list of HTML theme paths.""" 14 | cur_dir = path.abspath(path.dirname(path.dirname(__file__))) 15 | return cur_dir 16 | 17 | # See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package 18 | def setup(app): 19 | app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__))) 20 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/breadcrumbs.html: -------------------------------------------------------------------------------- 1 | {# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} 2 | 3 | {% if page_source_suffix %} 4 | {% set suffix = page_source_suffix %} 5 | {% else %} 6 | {% set suffix = source_suffix %} 7 | {% endif %} 8 | 9 | {% if meta is defined and meta is not none %} 10 | {% set check_meta = True %} 11 | {% else %} 12 | {% set check_meta = False %} 13 | {% endif %} 14 | 15 | {% if check_meta and 'github_url' in meta %} 16 | {% set display_github = True %} 17 | {% endif %} 18 | 19 | {% if check_meta and 'bitbucket_url' in meta %} 20 | {% set display_bitbucket = True %} 21 | {% endif %} 22 | 23 | {% if check_meta and 'gitlab_url' in meta %} 24 | {% set display_gitlab = True %} 25 | {% endif %} 26 | 27 |
28 | 29 | 70 | 71 | {% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %} 72 | 80 | {% endif %} 81 |
82 |
83 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/footer.html: -------------------------------------------------------------------------------- 1 |
2 | {% if (theme_prev_next_buttons_location == 'bottom' or theme_prev_next_buttons_location == 'both') and (next or prev) %} 3 | 11 | {% endif %} 12 | 13 |
14 | 15 |
16 |

17 | {%- if show_copyright %} 18 | {%- if hasdoc('copyright') %} 19 | {% trans path=pathto('copyright'), copyright=copyright|e %}© Copyright {{ copyright }}{% endtrans %} 20 | {%- else %} 21 | {% trans copyright=copyright|e %}© Copyright {{ copyright }}{% endtrans %} 22 | {%- endif %} 23 | {%- endif %} 24 | 25 | {%- if build_id and build_url %} 26 | {% trans build_url=build_url, build_id=build_id %} 27 | 28 | Build 29 | {{ build_id }}. 30 | 31 | {% endtrans %} 32 | {%- elif commit %} 33 | {% trans commit=commit %} 34 | 35 | Revision {{ commit }}. 36 | 37 | {% endtrans %} 38 | {%- elif last_updated %} 39 | {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} 40 | {%- endif %} 41 | 42 |

43 |
44 | 45 | {%- if show_sphinx %} 46 | {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. 47 | {%- endif %} 48 | 49 | {%- block extrafooter %} {% endblock %} 50 | 51 |
52 | 53 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/search.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/search.html 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Template for the search page. 6 | 7 | :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- extends "layout.html" %} 11 | {% set title = _('Search') %} 12 | {% set script_files = script_files + ['_static/searchtools.js'] %} 13 | {% block footer %} 14 | 17 | {# this is used when loading the search index using $.ajax fails, 18 | such as on Chrome for documents on localhost #} 19 | 20 | {{ super() }} 21 | {% endblock %} 22 | {% block body %} 23 | 31 | 32 | {% if search_performed %} 33 |

{{ _('Search Results') }}

34 | {% if not search_results %} 35 |

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}

36 | {% endif %} 37 | {% endif %} 38 |
39 | {% if search_results %} 40 |
    41 | {% for href, caption, context in search_results %} 42 |
  • 43 | {{ caption }} 44 |

    {{ context|e }}

    45 |
  • 46 | {% endfor %} 47 |
48 | {% endif %} 49 |
50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if builder != 'singlehtml' %} 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | {%- endif %} 10 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{height:auto;max-height:100%}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} 2 | -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/docs/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_themes/sphinx_rtd_theme/static/js/theme.js: -------------------------------------------------------------------------------- 1 | /* sphinx_rtd_theme version 0.4.2 | MIT license */ 2 | /* Built 20181005 13:10 */ 3 | require=function r(s,a,l){function c(e,n){if(!a[e]){if(!s[e]){var i="function"==typeof require&&require;if(!n&&i)return i(e,!0);if(u)return u(e,!0);var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[e]={exports:{}};s[e][0].call(o.exports,function(n){return c(s[e][1][n]||n)},o,o.exports,r,s,a,l)}return a[e].exports}for(var u="function"==typeof require&&require,n=0;n"),i("table.docutils.footnote").wrap("
"),i("table.docutils.citation").wrap("
"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i(''),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav,StickyNav:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e 4 | 5 | Read the Docs 6 | v: {{ current_version }} 7 | 8 | 9 |
10 |
11 |
{{ _('Versions') }}
12 | {% for slug, url in versions %} 13 |
{{ slug }}
14 | {% endfor %} 15 |
16 |
17 |
{{ _('Downloads') }}
18 | {% for type, url in downloads %} 19 |
{{ type }}
20 | {% endfor %} 21 |
22 |
23 |
{{ _('On Read the Docs') }}
24 |
25 | {{ _('Project Home') }} 26 |
27 |
28 | {{ _('Builds') }} 29 |
30 |
31 |
32 | {% trans %}Free document hosting provided by Read the Docs.{% endtrans %} 33 | 34 |
35 | 36 | {% endif %} 37 | 38 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. SphinxTest documentation master file, created by 2 | sphinx-quickstart on Tue Oct 3 11:09:13 2017. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | ====================================================== 7 | Welcome to the Tesseract Robotics Python Documentation 8 | ====================================================== 9 | 10 | Python wrapper for Tesseract motion planning framework, generated automatically by SWIG. 11 | Developed and maintained by Wason Technology, LLC. 12 | 13 | .. Tesseract Python Supported Packages 14 | .. ----------------------------------- 15 | 16 | .. * **tesseract_collision** – This package contains privides a common interface for collision checking prividing several implementation of a Bullet collision library and FCL collision library. It includes both continuous and discrete collision checking for convex-convex, convex-concave and concave-concave shapes. 17 | .. * **tesseract_common** – This package contains common functionality needed by the majority of the packages. 18 | .. * **tesseract_environment** – This package contains the Tesseract Environment which provides functionality to add,remove,move and modify links and joint. It also manages adding object to the contact managers and provides the ability. 19 | .. * **tesseract_geometry** – This package contains geometry types used by Tesseract including primitive shapes, mesh, convex hull mesh, octomap and signed distance field. 20 | .. * **tesseract_kinematics** – This package contains a common interface for Forward and Inverse kinematics for Chain, Tree's and Graphs including implementation using KDL and OPW Kinematics. 21 | .. * **tesseract_scene_graph** – This package contains the scene graph which is the data structure used to manage the connectivity of objects in the environment. It inherits from boost graph and provides addition functionality for adding,removing and modifying Links and Joints along with search implementation. 22 | .. * **tesseract_support** – This package contains support data used for unit tests and examples throughout Tesseract. 23 | .. * **tesseract_urdf** - This package contains a custom urdf parser supporting addition shapes and features currently not supported by urdfdom. 24 | .. * **tesseract_visualization** – This package contains visualization utilities and libraries. 25 | .. * **tesseract_command_language** - This is a generic programing language used as input for motion and process planning. It is very similar to how you currently program a robot on an industrial teach pendant. 26 | .. * **tesseract_motion_planners** – This package contains a common interface for Planners and includes implementation for OMPL, TrajOpt, TrajOpt IFOPT and Descartes. 27 | .. * **tesseract_process_managers** – This package contains a common interface for Process Planning and includes implementation for a wide variaty of process found industrial automation like painting, griding, welding, pick and place and more. 28 | .. * **tesseract_time_parameterization** – This package contains a time parameterization algorithms and includes iteritive spline. 29 | 30 | Related Repositories 31 | -------------------- 32 | 33 | * `Tesseract `_ 34 | * `Tesseract Planning `_ 35 | * `General Robotics Toolbox `_ 36 | * `PyRI Open Source Teach Pendant `_ 37 | 38 | Contents 39 | ------------ 40 | 41 | .. toctree:: 42 | :maxdepth: 2 43 | 44 | Readme 45 | Important Usage Notes <_source/important_notes.rst> 46 | Examples <_source/examples/examples.rst> 47 | API Reference <_source/modules/api.rst> 48 | 49 | 50 | .. tesseract_scene_graph <_source/tesseract_scene_graph_doc.rst> 51 | .. tesseract_collision <_source/tesseract_collision_doc.rst> 52 | .. tesseract_geometry <_source/tesseract_geometry_doc.rst> 53 | .. tesseract_ros <_source/tesseract_ros_doc.rst> 54 | .. tesseract_msgs <_source/tesseract_msgs_doc.rst> 55 | .. tesseract_rviz <_source/tesseract_rviz_doc.rst> 56 | .. tesseract_monitoring <_source/tesseract_monitoring_doc.rst> 57 | .. tesseract_planning <_source/tesseract_planning_doc.rst> 58 | .. tesseract_urdf <_source/tesseract_urdf_doc.rst> 59 | .. tesseract_srdf <_source/tesseract_srdf_doc.rst> 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/preprocess_docstrings.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | def preprocess_docstrings(app, what, name, obj, options, lines): 4 | # Only process function and method docstrings 5 | if what not in ['function', 'method']: 6 | return 7 | 8 | 9 | missing_newline_regex2 = re.compile(r"[ \t]*\:(?:param|type|return|rtype|raises)") 10 | for i in range(0,len(lines)-1): 11 | line = lines[i] 12 | next_line = lines[i+1] 13 | 14 | if missing_newline_regex2.match(next_line): 15 | if len(line.strip()) > 0: 16 | lines.insert(i+1, "\n") 17 | print("Inserted newline after line: " + line) 18 | 19 | 20 | def setup(app): 21 | app.connect('autodoc-process-docstring', preprocess_docstrings) -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx==6.2.1 2 | sphinx_rtd_theme 3 | gitpython 4 | recommonmark 5 | opencv-python 6 | -------------------------------------------------------------------------------- /examples/tesseract_kinematics_example.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_common import FilesystemPath, GeneralResourceLocator, Isometry3d, Translation3d, \ 2 | TransformMap, Quaterniond 3 | from tesseract_robotics.tesseract_environment import Environment 4 | from tesseract_robotics.tesseract_kinematics import KinGroupIKInput, KinGroupIKInputs 5 | import numpy as np 6 | 7 | # Example of using kinematics to solve for forward and inverse kinematics. A tesseract environment is created 8 | # using URDF and SRDF files. The kinematics solver is configured using the SRDF file and plugin configuration files. 9 | 10 | # Initialize Environment with a robot from URDF file 11 | # The URDF and SRDF file must be configured. The kinematics solver also requires plugin configuration, 12 | # which is specified in the SRDF file. For this example, the plugin configuration file is `abb_irb2400_plugins.yaml` 13 | # and is located in the same directory as the SRDF file. This example uses the OPW kinematics solver, which is 14 | # a solver for industrial 6-dof robots with spherical wrists. The kinematic parameters for the robot must 15 | # be specified in the plugin configuration file in addition to the URDF file for the plugin to work. 16 | # The other main solver is the KDL solver, which is used by the lbr_iiwa_14_r820 robot also included in the 17 | # tesseract_support package. The KDL solver is a numerical solver and does not require additional configuration. 18 | 19 | # This example uses the GeneralResourceLocator to find resources on the file system. The GeneralResourceLocator 20 | # uses the TESSERACT_RESOURCE_PATH environmental variable. 21 | # 22 | # TESSERACT_RESOURCE_PATH must be set to the directory containing the `tesseract_support` package. This can be done 23 | # by running: 24 | # 25 | # git clone https://github.com/tesseract-robotics/tesseract.git 26 | # export TESSERACT_RESOURCE_PATH="$(pwd)/tesseract/" 27 | # 28 | # or on Windows 29 | # 30 | # git clone https://github.com/tesseract-robotics/tesseract.git 31 | # set TESSERACT_RESOURCE_PATH=%cd%\tesseract\ 32 | 33 | locator = GeneralResourceLocator() 34 | env = Environment() 35 | urdf_path_str = locator.locateResource("package://tesseract_support/urdf/abb_irb2400.urdf").getFilePath() 36 | srdf_path_str = locator.locateResource("package://tesseract_support/urdf/abb_irb2400.srdf").getFilePath() 37 | urdf_path = FilesystemPath(urdf_path_str) 38 | srdf_path = FilesystemPath(srdf_path_str) 39 | assert env.init(urdf_path, srdf_path, locator) 40 | 41 | robot_joint_names = [f"joint_{i+1}" for i in range(6)] 42 | 43 | # Get the kinematics solver. The name "manipulator" is specified in the SRDF file 44 | kin_group = env.getKinematicGroup("manipulator") 45 | 46 | # Solve forward kinematics at a specific joint position 47 | robot_joint_pos = np.deg2rad(np.array([10, 20,-5, 70, 30, 90], dtype=np.float64)) 48 | fwdkin_result = kin_group.calcFwdKin(robot_joint_pos) 49 | #fwdkin_result is a TransformMap, which is a dictionary of link names to Isometry3d. For this robot, we are 50 | #interested in the transform of the "tool0" link 51 | tool0_transform = fwdkin_result["tool0"] 52 | # Print the transform as a translation and quaternion 53 | print("Tool0 transform at joint position " + str(robot_joint_pos) + " is: ") 54 | q = Quaterniond(tool0_transform.rotation()) 55 | print("Translation: " + str(tool0_transform.translation().flatten())) 56 | print(f"Rotation: {q.w()} {q.x()} {q.y()} {q.z()}") 57 | 58 | # Solve inverse kinematics at a specific tool0 pose 59 | tool0_transform2 = Isometry3d.Identity() * Translation3d(0.7, -0.1, 1) * Quaterniond(0.70711, 0, 0.7171, 0) 60 | 61 | # Create a KinGroupIKInput and KinGroupIKInputs object. The KinGroupIKInputs object is a list of KinGroupIKInput 62 | ik = KinGroupIKInput() 63 | ik.pose = tool0_transform2 64 | ik.tip_link_name = "tool0" 65 | ik.working_frame = "base_link" 66 | iks = KinGroupIKInputs() 67 | iks.append(ik) 68 | # Solve IK 69 | ik_result = kin_group.calcInvKin(iks, robot_joint_pos) 70 | # Print the result 71 | print(f"Found {len(ik_result)} solutions") 72 | for i in range(len(ik_result)): 73 | print("Solution " + str(i) + ": " + str(ik_result[i].flatten())) 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/logo.png -------------------------------------------------------------------------------- /tesseract_python/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ -------------------------------------------------------------------------------- /tesseract_python/cmake/FindSWIG.cmake: -------------------------------------------------------------------------------- 1 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying 2 | # file Copyright.txt or https://cmake.org/licensing for details. 3 | 4 | #.rst: 5 | # FindSWIG 6 | # -------- 7 | # 8 | # Find SWIG 9 | # 10 | # This module finds an installed SWIG. It sets the following variables: 11 | # 12 | # :: 13 | # 14 | # SWIG_FOUND - set to true if SWIG is found 15 | # SWIG_DIR - the directory where swig is installed 16 | # SWIG_EXECUTABLE - the path to the swig executable 17 | # SWIG_VERSION - the version number of the swig executable 18 | # 19 | # 20 | # 21 | # The minimum required version of SWIG can be specified using the 22 | # standard syntax, e.g. find_package(SWIG 1.1) 23 | # 24 | # All information is collected from the SWIG_EXECUTABLE so the version 25 | # to be found can be changed from the command line by means of setting 26 | # SWIG_EXECUTABLE 27 | 28 | find_program(SWIG_EXECUTABLE NAMES swig4.0 swig3.0 swig2.0 swig) 29 | 30 | if(SWIG_EXECUTABLE) 31 | execute_process(COMMAND ${SWIG_EXECUTABLE} -swiglib 32 | OUTPUT_VARIABLE SWIG_swiglib_output 33 | ERROR_VARIABLE SWIG_swiglib_error 34 | RESULT_VARIABLE SWIG_swiglib_result) 35 | 36 | if(SWIG_swiglib_result) 37 | if(SWIG_FIND_REQUIRED) 38 | message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}") 39 | else() 40 | message(STATUS "Command \"${SWIG_EXECUTABLE} -swiglib\" failed with output:\n${SWIG_swiglib_error}") 41 | endif() 42 | else() 43 | string(REGEX REPLACE "[\n\r]+" ";" SWIG_swiglib_output ${SWIG_swiglib_output}) 44 | find_path(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output} NO_CMAKE_FIND_ROOT_PATH) 45 | if(SWIG_DIR) 46 | set(SWIG_USE_FILE ${CMAKE_CURRENT_LIST_DIR}/UseSWIG.cmake) 47 | execute_process(COMMAND ${SWIG_EXECUTABLE} -version 48 | OUTPUT_VARIABLE SWIG_version_output 49 | ERROR_VARIABLE SWIG_version_output 50 | RESULT_VARIABLE SWIG_version_result) 51 | if(SWIG_version_result) 52 | message(SEND_ERROR "Command \"${SWIG_EXECUTABLE} -version\" failed with output:\n${SWIG_version_output}") 53 | else() 54 | string(REGEX REPLACE ".*SWIG Version[^0-9.]*\([0-9.]+\).*" "\\1" 55 | SWIG_version_output "${SWIG_version_output}") 56 | set(SWIG_VERSION ${SWIG_version_output} CACHE STRING "Swig version" FORCE) 57 | endif() 58 | endif() 59 | endif() 60 | endif() 61 | 62 | include(FindPackageHandleStandardArgs) 63 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR 64 | VERSION_VAR SWIG_VERSION ) 65 | 66 | mark_as_advanced(SWIG_DIR SWIG_VERSION) 67 | -------------------------------------------------------------------------------- /tesseract_python/cmake/__init__.py.in: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from .@PY_MOD_NAME@ import * -------------------------------------------------------------------------------- /tesseract_python/cmake/__package_init__.py.in: -------------------------------------------------------------------------------- 1 | def _tesseract_dll_path_(): 2 | import sys 3 | import os 4 | if sys.platform == "win32" and sys.version_info[:2] >= (3, 8): 5 | tesseract_env_path = os.environ.get("TESSERACT_PYTHON_DLL_PATH",None) 6 | if tesseract_env_path: 7 | for p in tesseract_env_path.split(os.pathsep): 8 | os.add_dll_directory(p) 9 | 10 | _tesseract_dll_path_() 11 | del _tesseract_dll_path_ -------------------------------------------------------------------------------- /tesseract_python/cmake/install_build_wheel.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | message(STATUS "Running install_build_wheel.cmake") 3 | 4 | if(WIN32) 5 | execute_process(COMMAND @PYTHON_EXECUTABLE@ setup.py bdist_wheel WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 6 | if(STATUS AND NOT STATUS EQUAL 0) 7 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 8 | endif() 9 | file(GLOB wheel_files "${CMAKE_CURRENT_LIST_DIR}/python/dist/*.whl") 10 | foreach(wheel_file ${wheel_files}) 11 | execute_process(COMMAND @PYTHON_EXECUTABLE@ -m delvewheel repair --no-dll msvcp140.dll\;vcomp140.dll ${wheel_file} WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 12 | if(STATUS AND NOT STATUS EQUAL 0) 13 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 14 | endif() 15 | endforeach() 16 | 17 | elseif(APPLE) 18 | execute_process(COMMAND @PYTHON_EXECUTABLE@ setup.py bdist_wheel --plat-name=@TESSERACT_PYTHON_WHEEL_PLATFORM@ WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 19 | if(STATUS AND NOT STATUS EQUAL 0) 20 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 21 | endif() 22 | file(GLOB wheel_files "${CMAKE_CURRENT_LIST_DIR}/python/dist/*.whl") 23 | foreach(wheel_file ${wheel_files}) 24 | execute_process(COMMAND delocate-wheel --sanitize-rpaths -d -w ${CMAKE_CURRENT_LIST_DIR}/python/wheelhouse ${wheel_file} WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 25 | if(STATUS AND NOT STATUS EQUAL 0) 26 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 27 | endif() 28 | endforeach() 29 | else() 30 | execute_process(COMMAND @PYTHON_EXECUTABLE@ setup.py bdist_wheel --plat-name=@TESSERACT_PYTHON_WHEEL_PLATFORM@ WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 31 | if(STATUS AND NOT STATUS EQUAL 0) 32 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 33 | endif() 34 | file(GLOB wheel_files "${CMAKE_CURRENT_LIST_DIR}/python/dist/*.whl") 35 | foreach(wheel_file ${wheel_files}) 36 | execute_process(COMMAND @PYTHON_EXECUTABLE@ -m auditwheel repair --plat @TESSERACT_PYTHON_WHEEL_PLATFORM@ ${wheel_file} WORKING_DIRECTORY python RESULT_VARIABLE STATUS) 37 | if(STATUS AND NOT STATUS EQUAL 0) 38 | message(FATAL_ERROR "Python Build Wheel Failed: ${STATUS}") 39 | endif() 40 | endforeach() 41 | endif() -------------------------------------------------------------------------------- /tesseract_python/cmake/tesseract_python_module.cmake: -------------------------------------------------------------------------------- 1 | function(tesseract_python_module PY_MOD_NAME ) 2 | 3 | cmake_parse_arguments(PY_MOD "" "PACKAGE" "SWIG_SRCS;LIBS" ${ARGN}) 4 | 5 | list(GET PY_MOD_SWIG_SRCS 0 PY_MOD_SWIG_SRC1) 6 | 7 | set(SWIG_CXX_EXTENSION cxx) 8 | set_property(SOURCE ${PY_MOD_SWIG_SRC1} PROPERTY CPLUSPLUS ON) 9 | if (${PYTHON_VERSION_MAJOR} LESS 3) 10 | set_property(SOURCE ${PY_MOD_SWIG_SRC1} PROPERTY SWIG_FLAGS -relativeimport -threads -doxygen -DSWIGPYTHON2 ) 11 | else() 12 | set_property(SOURCE ${PY_MOD_SWIG_SRC1} PROPERTY SWIG_FLAGS -relativeimport -threads -doxygen -py3 ) 13 | endif() 14 | set_property(SOURCE ${PY_MOD_SWIG_SRC1} PROPERTY USE_LIBRARY_INCLUDE_DIRECTORIES TRUE) 15 | 16 | set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE}) 17 | set(SWIG_OUTFILE_DIR ${CMAKE_CURRENT_BINARY_DIR}) 18 | if(${CMAKE_VERSION} VERSION_GREATER "3.8.0" OR ${CMAKE_VERSION} VERSION_EQUAL "3.8.0") 19 | swig_add_library(${PY_MOD_NAME} TYPE MODULE LANGUAGE python SOURCES ${PY_MOD_SWIG_SRCS}) 20 | else() 21 | swig_add_module(${PY_MOD_NAME} python ${PY_MOD_SWIG_SRCS}) 22 | endif() 23 | swig_link_libraries(${PY_MOD_NAME} ${PY_MOD_LIBS} jsoncpp_lib ${TinyXML2_LIBRARIES} ${EIGEN3_LIBRARIES} ${PYTHON_LIBRARIES}) 24 | 25 | set(PY_MOD_REAL_NAME1 SWIG_MODULE_${PY_MOD_NAME}_REAL_NAME) 26 | set(PY_MOD_REAL_NAME ${${PY_MOD_REAL_NAME1}}) 27 | 28 | target_include_directories(${PY_MOD_REAL_NAME} PUBLIC 29 | "$" 30 | "$" 31 | "$") 32 | target_include_directories(${PY_MOD_REAL_NAME} SYSTEM PUBLIC 33 | ${EIGEN3_INCLUDE_DIRS} 34 | ${Boost_INCLUDE_DIRS} 35 | ${TinyXML2_INCLUDE_DIRS} 36 | ${PYTHON_INCLUDE_DIRS} 37 | ${NUMPY_INCLUDE_DIR} 38 | ) 39 | target_compile_definitions(${PY_MOD_REAL_NAME} PRIVATE -DSWIG_TYPE_TABLE=tesseract_python ) 40 | 41 | set_target_properties(${PY_MOD_REAL_NAME} 42 | PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE}) 43 | set_target_properties(${PY_MOD_REAL_NAME} 44 | PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE}) 45 | set_target_properties(${PY_MOD_REAL_NAME} 46 | PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE}) 47 | 48 | target_compile_options(${PY_MOD_REAL_NAME} PRIVATE ${TESSERACT_COMPILE_OPTIONS_PRIVATE}) 49 | target_compile_options(${PY_MOD_REAL_NAME} PUBLIC ${TESSERACT_COMPILE_OPTIONS_PUBLIC}) 50 | target_cxx_version(${PY_MOD_REAL_NAME} PUBLIC VERSION ${TESSERACT_CXX_VERSION}) 51 | 52 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/__init__.py.in ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE}/__init__.py @ONLY) 53 | 54 | # Run fix_python_doc_newlines.py after compilation 55 | # add_custom_command(TARGET ${PY_MOD_REAL_NAME} POST_BUILD 56 | # COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/cmake/fix_python_doc_newlines.py ${CMAKE_CURRENT_BINARY_DIR}/python/tesseract_robotics/${PY_MOD_PACKAGE} 57 | # COMMENT "Fixing python doc newlines for ${PY_MOD_NAME}.py" 58 | # VERBATIM 59 | # ) 60 | 61 | endfunction() 62 | -------------------------------------------------------------------------------- /tesseract_python/colcon.pkg: -------------------------------------------------------------------------------- 1 | { 2 | "hooks": ["share/tesseract_python/hook/ament_prefix_path.dsv", "share/tesseract_python/hook/python_path.dsv"] 3 | } 4 | -------------------------------------------------------------------------------- /tesseract_python/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tesseract_python 4 | 0.5.1 5 | The tesseract_python package 6 | John Wason 7 | Apache 2.0 8 | John Wason 9 | 10 | 11 | catkin 12 | cmake 13 | 14 | ros_industrial_cmake_boilerplate 15 | trajopt 16 | tesseract_motion_planners 17 | tesseract_common 18 | tesseract_geometry 19 | tesseract_visualization 20 | tesseract_collision 21 | tesseract_urdf 22 | tesseract_srdf 23 | tesseract_kinematics 24 | tesseract_scene_graph 25 | tesseract_environment 26 | tesseract_command_language 27 | tesseract_time_parameterization 28 | tesseract_task_composer 29 | libjsoncpp-dev 30 | 31 | python 32 | python-numpy 33 | python-dev 34 | python-pytest 35 | python3 36 | python3-numpy 37 | python3-dev 38 | python3-pytest 39 | swig 40 | 41 | 42 | cmake 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /tesseract_python/swig/boost_filesystem_path.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file boost_filesystem_path.i 3 | * @brief Implement very simple wrapper for boost::filesystem::path 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %{ 28 | #include 29 | %} 30 | 31 | namespace boost 32 | { 33 | namespace filesystem 34 | { 35 | 36 | %rename(FilesystemPath) path; 37 | /** 38 | * @brief Wrapper for boost::filesystem::path 39 | */ 40 | class path 41 | { 42 | public: 43 | 44 | /** 45 | * @brief Construct a new path object 46 | * 47 | * @param s The path 48 | */ 49 | path(const std::string& s); 50 | 51 | /** 52 | @brief Return the path as a string 53 | 54 | @return The path as a string 55 | */ 56 | std::string string(); 57 | 58 | %pythoncode %{ 59 | def __str__(self): 60 | return self.string() 61 | %} 62 | }; 63 | } 64 | } 65 | 66 | %template(VectorFilesystemPath) std::vector; 67 | -------------------------------------------------------------------------------- /tesseract_python/swig/boost_uuid.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file boost_uuid.i 3 | * @brief Implement very simple wrapper for boost::uuids::uuid 4 | * 5 | * @author John Wason 6 | * @date June 2, 2023 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2023, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %{ 28 | #include 29 | #include 30 | #include 31 | %} 32 | 33 | namespace boost { 34 | namespace uuids { 35 | %rename(Uuid) uuid; 36 | /** 37 | * @brief Wrapper for boost::uuids::uuid 38 | * 39 | * @details 40 | * This class is a simple wrapper for boost::uuids::uuid. It is used to 41 | * provide a simple interface for the uuid class in python. 42 | */ 43 | class uuid 44 | { 45 | public: 46 | %extend { 47 | bool __eq__(const uuid& other) const 48 | { 49 | return *$self == other; 50 | } 51 | 52 | bool __neq__(const uuid& other) const 53 | { 54 | return *$self != other; 55 | } 56 | 57 | /** 58 | * @brief Convert uuid to string 59 | * 60 | */ 61 | std::string __str__() const 62 | { 63 | return boost::uuids::to_string(*$self); 64 | } 65 | } 66 | }; 67 | 68 | 69 | } 70 | } 71 | 72 | %inline { 73 | /** 74 | * @brief Generate a new random uuid 75 | * 76 | * @details 77 | * This function generates a new random uuid 78 | * 79 | * @return A new random uuid 80 | */ 81 | 82 | boost::uuids::uuid newRandomUuid() 83 | { 84 | return boost::uuids::random_generator()(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /tesseract_python/swig/console_bridge.i: -------------------------------------------------------------------------------- 1 | 2 | %feature(director) console_bridge::OutputHandler; 3 | 4 | namespace console_bridge 5 | { 6 | /** \brief The set of priorities for message logging */ 7 | enum LogLevel 8 | { 9 | /** \brief Debug level */ 10 | CONSOLE_BRIDGE_LOG_DEBUG = 0, 11 | /** \brief Informative message */ 12 | CONSOLE_BRIDGE_LOG_INFO, 13 | /** \brief Warning */ 14 | CONSOLE_BRIDGE_LOG_WARN, 15 | /** \brief Error condition */ 16 | CONSOLE_BRIDGE_LOG_ERROR, 17 | /** \brief Fatal error */ 18 | CONSOLE_BRIDGE_LOG_NONE 19 | }; 20 | 21 | /** 22 | * \brief Set the minimum level of logging data to output. Messages with lower logging levels will 23 | * not be recorded. 24 | */ 25 | void setLogLevel(LogLevel level); 26 | 27 | /** 28 | * \brief Retrieve the current level of logging data. Messages with lower logging levels will not be 29 | * recorded. 30 | */ 31 | LogLevel getLogLevel(void); 32 | 33 | %pythondynamic OutputHandler; 34 | class OutputHandler 35 | { 36 | public: 37 | OutputHandler(void){} 38 | 39 | virtual ~OutputHandler(void){} 40 | 41 | /** 42 | * \brief log a message to the output handler with the given text and logging level from a 43 | * specific file and line number 44 | * \param text to log 45 | * \param level console_bridge log level 46 | * \param filename of the output log 47 | * \param line 48 | */ 49 | virtual void log(const std::string &text, LogLevel level, const char *filename, int line) = 0; 50 | }; 51 | 52 | /** 53 | * \brief This function instructs console bridge that no messages should be outputted. 54 | * Equivalent to useOutputHandler(NULL) 55 | */ 56 | void noOutputHandler(void); 57 | 58 | /** 59 | * \brief Restore the output handler that was previously in use (if any) 60 | */ 61 | void restorePreviousOutputHandler(void); 62 | 63 | /** 64 | * \brief Specify the instance of the OutputHandler to use. 65 | * By default, this is OutputHandlerSTD 66 | */ 67 | void useOutputHandler(OutputHandler *oh); 68 | 69 | /** 70 | * \brief Root level logging function. This should not be invoked directly, but rather used via a 71 | * \ref logging "logging macro". Formats the message string given the arguments and forwards the 72 | * string to the output handler 73 | */ 74 | void log(const char *file, 75 | int line, 76 | LogLevel level, 77 | const char* m 78 | ); 79 | 80 | } -------------------------------------------------------------------------------- /tesseract_python/swig/eigen_types.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file eigen_types.i 3 | * @brief Eigen typemaps used by Tesseract 4 | * 5 | * @author John Wason 6 | * @date December 10, 2019 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2019, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | // workaround Eigen::Ref argout 28 | 29 | namespace Eigen 30 | { 31 | template class Ref; 32 | class MatrixXd; 33 | } 34 | 35 | %feature("valuewrapper") Eigen::Ref; 36 | %template() Eigen::Ref; 37 | 38 | 39 | %eigen_typemaps(Eigen::Vector2d); 40 | %eigen_typemaps(Eigen::Vector3d); 41 | %eigen_typemaps(Eigen::Vector4d); 42 | %eigen_typemaps(Eigen::VectorXd); 43 | %eigen_typemaps(%arg(Eigen::VectorX)); 44 | %eigen_typemaps(Eigen::MatrixXd); 45 | %eigen_typemaps(%arg(Eigen::Matrix3Xd)); 46 | %eigen_typemaps(%arg(Eigen::MatrixX2d)); 47 | %eigen_typemaps(%arg(Eigen::Matrix)); 48 | %eigen_typemaps(%arg(Eigen::Matrix)); 49 | %eigen_typemaps(Eigen::VectorXi); 50 | %eigen_typemaps(Eigen::Matrix3d); 51 | %eigen_typemaps(Eigen::Matrix4d); 52 | 53 | // Assume that Eigen::Index can be treated as int64_t 54 | namespace Eigen { 55 | typedef ptrdiff_t Index; 56 | } 57 | 58 | /* 59 | //Workaround typemaps for Isometry3d 60 | 61 | %typemap(in, fragment="Eigen_Fragments") Eigen::Isometry3d const& (Eigen::Isometry3d temp) 62 | { 63 | // In: plain, const& 64 | Eigen::Matrix4d temp_matrix; 65 | if (!ConvertFromNumpyToEigenMatrix(&temp_matrix, $input)) 66 | SWIG_fail; 67 | temp = temp_matrix; 68 | $1 = &temp; 69 | } 70 | %typemap(in, fragment="Eigen_Fragments") Eigen::Isometry3d (Eigen::Isometry3d temp) 71 | { 72 | // In: plain, non-const&, const& 73 | Eigen::Matrix4d temp_matrix; 74 | if (!ConvertFromNumpyToEigenMatrix(&temp_matrix, $input)) 75 | SWIG_fail; 76 | temp = temp_matrix; 77 | $1 = temp; 78 | } 79 | %typemap(out, fragment="Eigen_Fragments") Eigen::Isometry3d, Eigen::Isometry3d const 80 | { 81 | Eigen::Matrix4d temp_matrix=$1.matrix(); 82 | if (!ConvertFromEigenToNumPyMatrix(&$result, &temp_matrix)) 83 | SWIG_fail; 84 | } 85 | %typemap(out, fragment="Eigen_Fragments") Eigen::Isometry3d&, Eigen::Isometry3d const& 86 | { 87 | Eigen::Matrix4d temp_matrix=$1->matrix(); 88 | if (!ConvertFromEigenToNumPyMatrix(&$result, &temp_matrix)) 89 | SWIG_fail; 90 | } 91 | 92 | // Argout: & (for returning values to in-out arguments) 93 | %typemap(argout, fragment="Eigen_Fragments") Eigen::Isometry3d & 94 | { 95 | // Argout: & 96 | PyObject* ret1 = $result; 97 | PyObject* ret2; 98 | Eigen::Matrix4d temp_matrix=$1->matrix(); 99 | if (!ConvertFromEigenToNumPyMatrix(&ret2, &temp_matrix)) 100 | SWIG_fail; 101 | $result = PyTuple_Pack(2, ret1, ret2); 102 | Py_DECREF(ret1); 103 | Py_DECREF(ret2); 104 | } 105 | 106 | %typemap(in, numinputs=0) Eigen::Isometry3d & (Eigen::Isometry3d temp) { 107 | $1 = &temp; 108 | } 109 | */ -------------------------------------------------------------------------------- /tesseract_python/swig/json_typemaps.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file json_typemaps.i 3 | * @brief Python Typemaps for JsonCPP 4 | * 5 | * @author John Wason 6 | * @date December 10, 2019 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2019, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %{ 28 | #include 29 | %} 30 | 31 | %typemap(in) const Json::Value& (Json::Value temp){ 32 | std::string *ptr = (std::string *)0; 33 | int res = SWIG_AsPtr_std_string($input, &ptr); 34 | if (!SWIG_IsOK(res) || !ptr) { 35 | %argument_fail((ptr ? res : SWIG_TypeError), "$type", $symname, $argnum); 36 | } 37 | std::string ptr_dat; 38 | ptr_dat.swap(*ptr); 39 | if (SWIG_IsNewObj(res)) %delete(ptr); 40 | Json::Reader reader; 41 | bool parse_successful = reader.parse(ptr_dat, temp); 42 | if (!parse_successful) 43 | { 44 | PyErr_SetString(PyExc_ValueError, "Could not parse Json."); 45 | SWIG_fail; 46 | } 47 | $1 = &temp; 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/cartesian_waypoint_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | class CartesianWaypoint; 4 | struct CartesianWaypointPoly 5 | { 6 | CartesianWaypointPoly(); 7 | CartesianWaypointPoly(const CartesianWaypointPoly&); 8 | 9 | void setTransform(const Eigen::Isometry3d& transform); 10 | const Eigen::Isometry3d& getTransform() const; 11 | 12 | void setUpperTolerance(const Eigen::VectorXd& upper_tol); 13 | const Eigen::VectorXd& getUpperTolerance() const; 14 | 15 | void setLowerTolerance(const Eigen::VectorXd& lower_tol); 16 | const Eigen::VectorXd& getLowerTolerance() const; 17 | 18 | void setSeed(const tesseract_common::JointState& seed); 19 | const tesseract_common::JointState& getSeed() const; 20 | 21 | void setName(const std::string& name); 22 | const std::string& getName() const; 23 | 24 | void print(const std::string& prefix = "") const; 25 | 26 | /** 27 | * @brief Check if it has a seed. If the position or joint names is empty this returns false 28 | * @return True if it has a seed, otherwise false 29 | */ 30 | bool hasSeed() const; 31 | 32 | /** @brief Clear the seed to empty data structures */ 33 | void clearSeed(); 34 | 35 | /** 36 | * @brief Returns true if waypoint has tolerances 37 | * @return True if waypoint has tolerances 38 | */ 39 | bool isToleranced() const; 40 | }; 41 | 42 | } // namespace tesseract_planning 43 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/instruction_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | struct InstructionPoly 4 | { 5 | InstructionPoly(); 6 | InstructionPoly(const InstructionPoly&); 7 | const boost::uuids::uuid& getUUID() const; 8 | void regenerateUUID(); 9 | 10 | const boost::uuids::uuid& getParentUUID() const; 11 | void setParentUUID(const boost::uuids::uuid& uuid); 12 | 13 | const std::string& getDescription() const; 14 | 15 | void setDescription(const std::string& description); 16 | 17 | void print(const std::string& prefix = "") const; 18 | 19 | bool isCompositeInstruction() const; 20 | 21 | bool isMoveInstruction() const; 22 | 23 | }; 24 | 25 | } // namespace tesseract_planning 26 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/joint_waypoint_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | class JointWaypoint; 4 | struct JointWaypointPoly 5 | { 6 | JointWaypointPoly(); 7 | JointWaypointPoly(const JointWaypointPoly&); 8 | 9 | void setNames(const std::vector& names); 10 | const std::vector& getNames() const; 11 | 12 | void setPosition(const Eigen::VectorXd& position); 13 | const Eigen::VectorXd& getPosition() const; 14 | 15 | void setUpperTolerance(const Eigen::VectorXd& upper_tol); 16 | const Eigen::VectorXd& getUpperTolerance() const; 17 | 18 | void setLowerTolerance(const Eigen::VectorXd& lower_tol); 19 | const Eigen::VectorXd& getLowerTolerance() const; 20 | 21 | void setIsConstrained(bool value); 22 | bool isConstrained() const; 23 | 24 | void setName(const std::string& name); 25 | const std::string& getName() const; 26 | 27 | void print(const std::string& prefix = "") const; 28 | 29 | /** 30 | * @brief Returns true if waypoint has tolerances 31 | * @return True if waypoint has tolerances 32 | */ 33 | bool isToleranced() const; 34 | 35 | }; 36 | 37 | } // namespace tesseract_planning -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/move_instruction_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | struct MoveInstructionPoly; 4 | 5 | enum class MoveInstructionType : int 6 | { 7 | LINEAR = 0, 8 | FREESPACE = 1, 9 | CIRCULAR = 2, 10 | }; 11 | } // namespace tesseract_planning 12 | 13 | namespace tesseract_planning 14 | { 15 | class MoveInstruction; 16 | struct MoveInstructionPoly 17 | { 18 | MoveInstructionPoly(); 19 | MoveInstructionPoly(const MoveInstructionPoly&); 20 | 21 | const boost::uuids::uuid& getUUID() const; 22 | void regenerateUUID(); 23 | 24 | const boost::uuids::uuid& getParentUUID() const; 25 | void setParentUUID(const boost::uuids::uuid& uuid); 26 | 27 | void assignCartesianWaypoint(CartesianWaypointPoly waypoint); 28 | void assignJointWaypoint(JointWaypointPoly waypoint); 29 | void assignStateWaypoint(StateWaypointPoly waypoint); 30 | WaypointPoly& getWaypoint(); 31 | const WaypointPoly& getWaypoint() const; 32 | 33 | void setManipulatorInfo(tesseract_common::ManipulatorInfo info); 34 | const tesseract_common::ManipulatorInfo& getManipulatorInfo() const; 35 | tesseract_common::ManipulatorInfo& getManipulatorInfo(); 36 | 37 | void setProfile(const std::string& profile); 38 | const std::string& getProfile() const; 39 | 40 | void setPathProfile(const std::string& profile); 41 | const std::string& getPathProfile() const; 42 | 43 | void setProfileOverrides(ProfileOverrides profile_overrides); 44 | const ProfileOverrides getProfileOverrides() const; 45 | 46 | void setPathProfileOverrides(ProfileOverrides profile_overrides); 47 | const ProfileOverrides getPathProfileOverrides() const; 48 | 49 | void setMoveType(MoveInstructionType move_type); 50 | MoveInstructionType getMoveType() const; 51 | 52 | const std::string& getDescription() const; 53 | void setDescription(const std::string& description); 54 | 55 | void print(const std::string& prefix = "") const; 56 | 57 | CartesianWaypointPoly createCartesianWaypoint() const; 58 | JointWaypointPoly createJointWaypoint() const; 59 | StateWaypointPoly createStateWaypoint() const; 60 | 61 | // MoveInstructionPoly methods 62 | 63 | MoveInstructionPoly createChild() const; 64 | 65 | bool isLinear() const; 66 | 67 | bool isFreespace() const; 68 | 69 | bool isCircular() const; 70 | 71 | bool isChild() const; 72 | 73 | }; 74 | 75 | } // namespace tesseract_planning 76 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/state_waypoint_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | class StateWaypoint; 4 | struct StateWaypointPoly 5 | { 6 | 7 | StateWaypointPoly(); 8 | StateWaypointPoly(const StateWaypointPoly&); 9 | 10 | void setNames(const std::vector& names); 11 | const std::vector& getNames() const; 12 | 13 | void setPosition(const Eigen::VectorXd& position); 14 | const Eigen::VectorXd& getPosition() const; 15 | 16 | void setVelocity(const Eigen::VectorXd& velocity); 17 | const Eigen::VectorXd& getVelocity() const; 18 | 19 | void setAcceleration(const Eigen::VectorXd& acceleration); 20 | const Eigen::VectorXd& getAcceleration() const; 21 | 22 | void setEffort(const Eigen::VectorXd& effort); 23 | const Eigen::VectorXd& getEffort() const; 24 | 25 | void setTime(double time); 26 | double getTime() const; 27 | 28 | void setName(const std::string& name); 29 | const std::string& getName() const; 30 | 31 | void print(const std::string& prefix = "") const; 32 | 33 | }; 34 | 35 | } // namespace tesseract_planning 36 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_command_language/poly/waypoint_poly.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_planning 2 | { 3 | 4 | struct WaypointPoly 5 | { 6 | WaypointPoly(); 7 | WaypointPoly(const WaypointPoly&); 8 | 9 | void setName(const std::string& name); 10 | const std::string& getName() const; 11 | 12 | void print(const std::string& prefix = "") const; 13 | 14 | bool isCartesianWaypoint() const; 15 | 16 | bool isJointWaypoint() const; 17 | 18 | bool isStateWaypoint() const; 19 | 20 | }; 21 | 22 | } // namespace tesseract_planning -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_common/any.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_common 2 | { 3 | using AnyBase = tesseract_common::TypeErasureBase; 4 | 5 | struct Any : AnyBase 6 | { 7 | using AnyBase::AnyBase; 8 | }; 9 | 10 | } // namespace tesseract_common 11 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_common/joint_state.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_common 2 | { 3 | class JointState 4 | { 5 | public: 6 | JointState() = default; 7 | JointState(std::vector joint_names, Eigen::VectorXd position); 8 | 9 | /** @brief The joint corresponding to the position vector. */ 10 | std::vector joint_names; 11 | 12 | /** @brief The joint position at the waypoint */ 13 | Eigen::VectorXd position; 14 | 15 | /** @brief The velocity at the waypoint (optional) */ 16 | Eigen::VectorXd velocity; 17 | 18 | /** @brief The Acceleration at the waypoint (optional) */ 19 | Eigen::VectorXd acceleration; 20 | 21 | /** @brief The Effort at the waypoint (optional) */ 22 | Eigen::VectorXd effort; 23 | 24 | /** @brief The Time from start at the waypoint (optional) */ 25 | double time{ 0 }; 26 | 27 | bool operator==(const JointState& other) const; 28 | 29 | bool operator!=(const JointState& rhs) const; 30 | 31 | }; 32 | 33 | } // namespace tesseract_common 34 | 35 | %template(JointStates) std::vector; 36 | 37 | namespace tesseract_common 38 | { 39 | /** @brief Represents a joint trajectory */ 40 | class JointTrajectory 41 | { 42 | public: 43 | JointTrajectory(std::string description = ""); 44 | JointTrajectory(std::vector states, std::string description = ""); 45 | 46 | std::vector states; 47 | std::string description; 48 | 49 | bool operator==(const JointTrajectory& other) const; 50 | 51 | bool operator!=(const JointTrajectory& rhs) const; 52 | 53 | /////////////////////////// 54 | // C++ container support // 55 | /////////////////////////// 56 | 57 | /** value_type */ 58 | using value_type = JointState; 59 | /** pointer */ 60 | using pointer = typename std::vector::pointer; 61 | /** const_pointer */ 62 | using const_pointer = typename std::vector::const_pointer; 63 | /** reference */ 64 | using reference = typename std::vector::reference; 65 | /** const_reference */ 66 | using const_reference = typename std::vector::const_reference; 67 | /** size_type */ 68 | using size_type = typename std::vector::size_type; 69 | /** difference_type */ 70 | using difference_type = typename std::vector::difference_type; 71 | 72 | %ignore get_allocator; 73 | %ignore resize; 74 | %ignore assign; 75 | %ignore swap; 76 | %ignore insert; 77 | %ignore JointTrajectory(); 78 | %ignore JointTrajectory(const JointTrajectory&); 79 | %ignore JointTrajectory(size_type); 80 | %ignore JointTrajectory(size_type, value_type const &); 81 | %swig_vector_methods(tesseract_common::JointTrajectory) 82 | %std_vector_methods(JointTrajectory) 83 | }; 84 | 85 | } // namespace tesseract_common 86 | 87 | -------------------------------------------------------------------------------- /tesseract_python/swig/rework_include/tesseract_kinematics/core/types.i: -------------------------------------------------------------------------------- 1 | namespace tesseract_kinematics 2 | { 3 | /** @brief The inverse kinematics solutions container */ 4 | using IKSolutions = std::vector; 5 | 6 | /** @brief The Universal Robot kinematic parameters */ 7 | struct URParameters 8 | { 9 | URParameters(); 10 | URParameters(double d1, double a2, double a3, double d4, double d5, double d6); 11 | 12 | double d1; 13 | double a2; 14 | double a3; 15 | double d4; 16 | double d5; 17 | double d6; 18 | }; 19 | 20 | /** @brief The UR10 kinematic parameters */ 21 | const URParameters UR10Parameters; 22 | 23 | /** @brief The UR5 kinematic parameters */ 24 | const URParameters UR5Parameters; 25 | 26 | /** @brief The UR3 kinematic parameters */ 27 | const URParameters UR3Parameters; 28 | 29 | /** @brief The UR10e kinematic parameters */ 30 | const URParameters UR10eParameters; 31 | 32 | /** @brief The UR5e kinematic parameters */ 33 | const URParameters UR5eParameters; 34 | 35 | /** @brief The UR3e kinematic parameters */ 36 | const URParameters UR3eParameters; 37 | 38 | } // namespace tesseract_kinematics 39 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_collisions_python_std_functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_collisions_python_std_functions.h 3 | * @brief Callback directors for tesseract_collision_python module 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | #include 28 | 29 | #pragma once 30 | 31 | class IsContactAllowedFnBase 32 | { 33 | public: 34 | virtual bool call(const std::string& a, const std::string& b) = 0; 35 | virtual ~IsContactAllowedFnBase() {} 36 | }; 37 | 38 | class IsContactValidFnBase 39 | { 40 | public: 41 | virtual bool call(const tesseract_collision::ContactResult& a) = 0; 42 | virtual ~IsContactValidFnBase() {} 43 | }; 44 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_command_language_python_std_functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_command_language_python_std_functions.h 3 | * @brief Callback directors for tesseract_command_language_python module 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | #include 28 | 29 | class flattenFilterFnBase 30 | { 31 | public: 32 | virtual bool call(const tesseract_planning::InstructionPoly&, 33 | const tesseract_planning::CompositeInstruction&, 34 | bool parent_is_first_composite) = 0; 35 | virtual ~flattenFilterFnBase() {} 36 | }; 37 | 38 | class locateFilterFnBase 39 | { 40 | public: 41 | virtual bool call(const tesseract_planning::InstructionPoly&, 42 | const tesseract_planning::CompositeInstruction&, 43 | bool parent_is_first_composite) = 0; 44 | virtual ~locateFilterFnBase() {} 45 | }; -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_common_python_std_functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_common_python_std_functions.h 3 | * @brief Callback directors for tesseract_scene_graph_python module 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | #include 28 | 29 | #pragma once 30 | 31 | class SimpleResourceLocatorFnBase 32 | { 33 | public: 34 | virtual std::string call(const std::string& a) = 0; 35 | virtual ~SimpleResourceLocatorFnBase() {} 36 | }; -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_environment_python_std_functions.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_environment_python_std_functions.h 3 | * @brief Callback directors for tesseract_python module 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | #include 28 | 29 | #pragma once 30 | 31 | class FindTCPOffsetCallbackFnBase 32 | { 33 | public: 34 | virtual Eigen::Isometry3d call(const tesseract_common::ManipulatorInfo& a) = 0; 35 | virtual ~FindTCPOffsetCallbackFnBase() {} 36 | }; 37 | 38 | class EventCallbackFnBase 39 | { 40 | public: 41 | virtual void call(const tesseract_environment::Event& a) = 0; 42 | virtual ~EventCallbackFnBase() {} 43 | }; 44 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_motion_planners_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_motion_planners_python.i 3 | * @brief The tesseract_motion_planners_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date December 8, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_motion_planners") tesseract_motion_planners_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | %import "tesseract_environment_python.i" 34 | %import "tesseract_command_language_python.i" 35 | 36 | %{ 37 | // tesseract_motion_planners 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | #include 45 | #include 46 | 47 | // tesseract_state_solver 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | // tesseract_kinematics 54 | #include 55 | #include 56 | 57 | // tesseract_environment 58 | #include 59 | #include 60 | #include 61 | 62 | // tesseract_command_language 63 | #include 64 | #include 65 | 66 | #include "tesseract_environment_python_std_functions.h" 67 | 68 | %} 69 | 70 | %unique_ptr_value_wrapper(tesseract_kinematics::KinematicGroup); 71 | %unique_ptr_value_wrapper(tesseract_kinematics::JointGroup); 72 | 73 | // tesseract_motion_planners 74 | #define TESSERACT_MOTION_PLANNERS_CORE_PUBLIC 75 | 76 | %include "tesseract_motion_planners/core/types.h" 77 | 78 | %shared_ptr(tesseract_planning::MotionPlanner) 79 | %wrap_unique_ptr(MotionPlannerUPtr,tesseract_planning::MotionPlanner) 80 | %include "tesseract_motion_planners/core/planner.h" 81 | 82 | %include "tesseract_motion_planners/core/utils.h" 83 | 84 | %include "tesseract_motion_planners/robot_config.h" 85 | %template(getRobotConfig) tesseract_planning::getRobotConfig; 86 | %template(getJointTurns) tesseract_planning::getJointTurns; 87 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_srdf_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_srdf_python.i 3 | * @brief The tesseract_scene_graph_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date December 8, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_srdf") tesseract_srdf_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | %import "tesseract_scene_graph_python.i" 34 | 35 | %{ 36 | 37 | 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | // tesseract_srdf 45 | #include 46 | #include 47 | #include 48 | 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | %} 55 | 56 | // tesseract_srdf 57 | #define TESSERACT_SRDF_PUBLIC 58 | 59 | %shared_ptr(tesseract_srdf::SRDFModel) 60 | %include "tesseract_srdf/kinematics_information.h" 61 | %include "tesseract_srdf/srdf_model.h" 62 | %include "tesseract_srdf/utils.h" 63 | 64 | %inline { 65 | tesseract_common::CalibrationInfo parseCalibrationConfigString(const tesseract_scene_graph::SceneGraph& scene_graph, 66 | const std::string& yaml_str) 67 | { 68 | YAML::Node config; 69 | try 70 | { 71 | config = YAML::Load(yaml_str); 72 | } 73 | catch (...) 74 | { 75 | std::throw_with_nested(std::runtime_error("calibration_config: YAML failed to parse calibration config string")); 76 | } 77 | 78 | const YAML::Node& cal_info = config[tesseract_common::CalibrationInfo::CONFIG_KEY]; 79 | auto info = cal_info.as(); 80 | 81 | // Check to make sure calibration joints exist 82 | for (const auto& cal_joint : info.joints) 83 | { 84 | if (scene_graph.getJoint(cal_joint.first) == nullptr) 85 | std::throw_with_nested(std::runtime_error("calibration_config: joint '" + cal_joint.first + "' does not exist!")); 86 | } 87 | 88 | return info; 89 | } 90 | 91 | tesseract_common::KinematicsPluginInfo parseKinematicsPluginConfigString(const std::string& yaml_str) 92 | { 93 | 94 | YAML::Node config; 95 | try 96 | { 97 | config = YAML::Load(yaml_str); 98 | } 99 | catch (...) 100 | { 101 | std::throw_with_nested(std::runtime_error("kinematics_plugin_config: YAML failed to parse kinematics plugins string" )); 102 | } 103 | 104 | const YAML::Node& kin_plugin_info = config[tesseract_common::KinematicsPluginInfo::CONFIG_KEY]; 105 | 106 | return kin_plugin_info.as(); 107 | } 108 | 109 | tesseract_common::ContactManagersPluginInfo 110 | parseContactManagersPluginConfigString(const std::string& yaml_str) 111 | { 112 | YAML::Node config; 113 | try 114 | { 115 | config = YAML::Load(yaml_str); 116 | } 117 | catch (...) 118 | { 119 | std::throw_with_nested(std::runtime_error("contact_managers_plugin_config: YAML failed to parse contact " 120 | "managers plugins string")); 121 | } 122 | 123 | const YAML::Node& cm_plugin_info = config[tesseract_common::ContactManagersPluginInfo::CONFIG_KEY]; 124 | return cm_plugin_info.as(); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_state_solver_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_state_solver_python.i 3 | * @brief The tesseract_state_solver_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date February 9, 2022 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2022, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_state_solver") tesseract_state_solver_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | //%import "tesseract_common_python.i" 34 | //%import "tesseract_geometry_python.i" 35 | %import "tesseract_scene_graph_python.i" 36 | %import "tesseract_srdf_python.i" 37 | 38 | %{ 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | // tesseract_state_solver 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | %} 58 | 59 | // tesseract_state_solver 60 | #define TESSERACT_STATE_SOLVER_CORE_PUBLIC 61 | 62 | namespace tesseract_scene_graph 63 | { 64 | class KDLTreeData; 65 | } 66 | 67 | %ignore KDLStateSolver(const tesseract_scene_graph::SceneGraph& scene_graph, tesseract_scene_graph::KDLTreeData data); 68 | 69 | %shared_ptr(tesseract_scene_graph::StateSolver) 70 | %wrap_unique_ptr(StateSolverUPtr,tesseract_scene_graph::StateSolver) 71 | %include "tesseract_state_solver/state_solver.h" 72 | 73 | %shared_ptr(tesseract_scene_graph::MutableStateSolver) 74 | %wrap_unique_ptr(MutableStateSolverUPtr,tesseract_scene_graph::MutableStateSolver) 75 | %include "tesseract_state_solver/mutable_state_solver.h" 76 | 77 | %shared_ptr(tesseract_scene_graph::KDLStateSolver) 78 | %include "tesseract_state_solver/kdl/kdl_state_solver.h" 79 | 80 | %shared_ptr(tesseract_scene_graph::OFKTStateSolver) 81 | %include "tesseract_state_solver/ofkt/ofkt_state_solver.h" 82 | 83 | 84 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_swig_include.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_swig_include.i 3 | * @brief Common include for tesseract swig modules 4 | * 5 | * @author John Wason 6 | * @date December 18, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %{ 28 | #define SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS 29 | %} 30 | 31 | 32 | %include 33 | %include 34 | %include 35 | %include 36 | %include 37 | %include 38 | %include 39 | %include 40 | %include 41 | %include 42 | %include 43 | %include 44 | 45 | %include "std_unique_ptr.i" 46 | 47 | namespace std { 48 | typedef ::size_t size_t; 49 | } 50 | 51 | %exception { 52 | try { 53 | $action 54 | } 55 | SWIG_CATCH_STDEXCEPT 56 | } 57 | 58 | %feature("director:except") { 59 | if ($error != NULL) { 60 | throw Swig::DirectorMethodException(); 61 | } 62 | } 63 | 64 | #ifndef SWIGPYTHON2 65 | %pythonnondynamic; 66 | #endif 67 | 68 | %include "eigen.i" 69 | %include "shared_factory.i" 70 | %include "json_typemaps.i" 71 | %include "eigen_types.i" 72 | 73 | %{ 74 | namespace std 75 | { 76 | 77 | #if SWIG_VERSION < 0x040200 78 | // SwigPySequence_Ref is not defined in swig >= 4.2.0 79 | template struct remove_reference> 80 | { 81 | typedef T type; 82 | }; 83 | 84 | template struct remove_reference> 85 | { 86 | typedef const T type; 87 | }; 88 | #endif 89 | 90 | template struct remove_reference> 91 | { 92 | typedef T type; 93 | }; 94 | 95 | template struct remove_reference> 96 | { 97 | typedef const T type; 98 | }; 99 | 100 | template struct remove_reference&> 101 | { 102 | typedef T type; 103 | }; 104 | 105 | template struct remove_reference&> 106 | { 107 | typedef const T type; 108 | }; 109 | 110 | } 111 | %} -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_time_parameterization_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_time_parameterization_python.i 3 | * @brief The tesseract_time_parameterization_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date December 8, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_time_parameterization") tesseract_time_parameterization_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | %import "tesseract_command_language_python.i" 34 | 35 | %{ 36 | 37 | 38 | #include 39 | 40 | // tesseract_time_parameterization 41 | #include 42 | #include 43 | #include 44 | #include 45 | %} 46 | 47 | %ignore tesseract_planning::totg; 48 | 49 | // tesseract_time_parameterization 50 | #define TESSERACT_TIME_PARAMETERIZATION_PUBLIC 51 | %shared_ptr(tesseract_planning::TrajectoryContainer) 52 | %include "tesseract_time_parameterization/core/trajectory_container.h" 53 | 54 | %shared_ptr(tesseract_planning::InstructionsTrajectory) 55 | %include "tesseract_time_parameterization/core/instructions_trajectory.h" 56 | 57 | // tesseract_time_parameterization_isp 58 | %include "tesseract_time_parameterization/isp/iterative_spline_parameterization.h" 59 | 60 | // tesseract_time_parameterization_totg 61 | %shared_ptr(tesseract_planning::TimeOptimalTrajectoryGeneration) 62 | %include "tesseract_time_parameterization/totg/time_optimal_trajectory_generation.h" 63 | 64 | // tesseract_time_parameterization_ruckig 65 | %include "tesseract_time_parameterization/ruckig/ruckig_trajectory_smoothing.h" 66 | 67 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_urdf_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_scene_graph_python.i 3 | * @brief The tesseract_scene_graph_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date December 8, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_urdf") tesseract_urdf_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | //%import "tesseract_common_python.i" 34 | %import "tesseract_scene_graph_python.i" 35 | 36 | %{ 37 | 38 | 39 | #include 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | #include 48 | #include 49 | 50 | // tesseract_urdf 51 | #include 52 | 53 | %} 54 | 55 | %unique_ptr_value_wrapper(tesseract_scene_graph::SceneGraph); 56 | 57 | %include "tesseract_urdf/urdf_parser.h" 58 | -------------------------------------------------------------------------------- /tesseract_python/swig/tesseract_visualization_python.i: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tesseract_visualization_python.i 3 | * @brief The tesseract_visualization_python SWIG master file. 4 | * 5 | * @author John Wason 6 | * @date December 8, 2020 7 | * @version TODO 8 | * @bug No known bugs 9 | * 10 | * @copyright Copyright (c) 2020, Wason Technology, LLC 11 | * 12 | * @par License 13 | * Software License Agreement (Apache License) 14 | * @par 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * @par 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | %module(directors="1", package="tesseract_robotics.tesseract_visualization") tesseract_visualization_python 28 | 29 | #pragma SWIG nowarn=473 30 | 31 | %include "tesseract_swig_include.i" 32 | 33 | %import "tesseract_environment_python.i" 34 | 35 | %{ 36 | 37 | // tesseract_geometry 38 | 39 | #include 40 | 41 | // tesseract_visualization 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | 54 | #include 55 | 56 | // tesseract_state_solver 57 | #include 58 | #include 59 | #include 60 | #include 61 | 62 | // tesseract_kinematics 63 | #include 64 | #include 65 | 66 | // tesseract_environment 67 | #include 68 | #include 69 | #include 70 | 71 | #include "tesseract_environment_python_std_functions.h" 72 | 73 | %} 74 | 75 | // tesseract_visualization 76 | #define TESSERACT_VISUALIZATION_PUBLIC 77 | 78 | %shared_ptr(tesseract_visualization::Marker) 79 | %include "tesseract_visualization/markers/marker.h" 80 | 81 | %shared_ptr(tesseract_visualization::ArrowMarker) 82 | %include "tesseract_visualization/markers/arrow_marker.h" 83 | 84 | %shared_ptr(tesseract_visualization::AxisMarker) 85 | %include "tesseract_visualization/markers/axis_marker.h" 86 | 87 | %shared_ptr(tesseract_visualization::ContactResultsMarker) 88 | %include "tesseract_visualization/markers/contact_results_marker.h" 89 | 90 | %shared_ptr(tesseract_visualization::GeometryMarker) 91 | %include "tesseract_visualization/markers/geometry_marker.h" 92 | 93 | %shared_ptr(tesseract_visualization::ToolpathMarker) 94 | %include "tesseract_visualization/markers/toolpath_marker.h" 95 | %include "tesseract_visualization/trajectory_interpolator.h" 96 | %include "tesseract_visualization/trajectory_player.h" 97 | 98 | %shared_ptr(tesseract_visualization::Visualization) 99 | %include "tesseract_visualization/visualization.h" 100 | %include "tesseract_visualization/visualization_loader.h" 101 | 102 | 103 | -------------------------------------------------------------------------------- /tesseract_python/swig/tinyxml2.i: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "tinyxml2.h" 3 | %} 4 | %ignore tinyxml2::StrPair; 5 | %ignore tinyxml2::DynArray; 6 | %ignore tinyxml2::MemPool; 7 | %include "tinyxml2.h" -------------------------------------------------------------------------------- /tesseract_python/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_collision/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_collision/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_collision/test_collision_mesh_mesh_unit.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import numpy.testing as nptest 3 | from tesseract_robotics import tesseract_geometry 4 | from tesseract_robotics import tesseract_geometry 5 | from tesseract_robotics import tesseract_common 6 | 7 | def addCollisionObjects(checker): 8 | 9 | pass -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_common/test_tesseract_common.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics import tesseract_common 2 | from inspect import currentframe, getframeinfo 3 | 4 | import numpy.testing as nptest 5 | 6 | def test_bytes_resource(): 7 | 8 | my_bytes = bytearray([10,57,92,56,92,46,92,127]) 9 | my_bytes_url = "file:///test_bytes.bin" 10 | bytes_resource = tesseract_common.BytesResource(my_bytes_url,my_bytes) 11 | my_bytes_ret = bytes_resource.getResourceContents() 12 | assert(len(my_bytes_ret) == len(my_bytes)) 13 | assert(my_bytes == bytearray(my_bytes_ret)) 14 | assert(my_bytes_url == bytes_resource.getUrl()) 15 | 16 | class _TestOutputHandler(tesseract_common.OutputHandler): 17 | def __init__(self): 18 | super().__init__() 19 | self.last_text=None 20 | 21 | def log(self, text, level, filename, line): 22 | self.last_text = text 23 | 24 | def test_console_bridge(): 25 | tesseract_common.setLogLevel(tesseract_common.CONSOLE_BRIDGE_LOG_DEBUG) 26 | 27 | frameinfo = getframeinfo(currentframe()) 28 | tesseract_common.log(frameinfo.filename,frameinfo.lineno, 29 | tesseract_common.CONSOLE_BRIDGE_LOG_DEBUG, "This is a test message") 30 | 31 | output_handler = _TestOutputHandler() 32 | tesseract_common.useOutputHandler(output_handler) 33 | 34 | tesseract_common.log(frameinfo.filename,frameinfo.lineno, 35 | tesseract_common.CONSOLE_BRIDGE_LOG_DEBUG, "This is a test message 2") 36 | tesseract_common.restorePreviousOutputHandler() 37 | 38 | assert output_handler.last_text == "This is a test message 2" 39 | 40 | tesseract_common.setLogLevel(tesseract_common.CONSOLE_BRIDGE_LOG_ERROR) 41 | 42 | def test_manipulator_info(): 43 | 44 | info = tesseract_common.ManipulatorInfo() 45 | info.tcp_offset="tool0" 46 | assert info.tcp_offset=="tool0" 47 | 48 | transform = tesseract_common.Isometry3d() * tesseract_common.Translation3d(1,2,3) 49 | info.tcp_offset = transform 50 | transform2=info.tcp_offset 51 | nptest.assert_allclose(transform2.matrix(), transform.matrix()) -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_environment/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_environment/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_environment/test_tesseract_environment.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics import tesseract_scene_graph 2 | from tesseract_robotics import tesseract_collision 3 | from tesseract_robotics import tesseract_environment 4 | from tesseract_robotics.tesseract_common import Isometry3d, Translation3d, AngleAxisd 5 | from tesseract_robotics import tesseract_common 6 | from tesseract_robotics import tesseract_collision 7 | from tesseract_robotics import tesseract_urdf 8 | from tesseract_robotics import tesseract_srdf 9 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 10 | import traceback 11 | import os 12 | import re 13 | import numpy as np 14 | 15 | def get_scene_graph(): 16 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 17 | path = os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.urdf") 18 | locator = TesseractSupportResourceLocator() 19 | return tesseract_urdf.parseURDFFile(path, locator).release() 20 | 21 | def get_srdf_model(scene_graph): 22 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 23 | path = os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.srdf") 24 | srdf = tesseract_srdf.SRDFModel() 25 | locator = TesseractSupportResourceLocator() 26 | srdf.initFile(scene_graph, path, locator) 27 | return srdf 28 | 29 | def get_environment(): 30 | scene_graph = get_scene_graph() 31 | assert scene_graph is not None 32 | 33 | srdf = get_srdf_model(scene_graph) 34 | assert srdf is not None 35 | 36 | env = tesseract_environment.Environment() 37 | assert env is not None 38 | 39 | assert env.getRevision() == 0 40 | 41 | success = env.init(scene_graph,srdf) 42 | assert success 43 | assert env.getRevision() == 3 44 | 45 | joint_names = [f"joint_a{i+1}" for i in range(7)] 46 | joint_values = np.array([1,2,1,2,1,2,1],dtype=np.float64) 47 | 48 | scene_state_changed = [False] 49 | command_applied = [False] 50 | 51 | def event_cb_py(evt): 52 | try: 53 | if evt.type == tesseract_environment.Events_SCENE_STATE_CHANGED: 54 | evt2 = tesseract_environment.cast_SceneStateChangedEvent(evt) 55 | if len(evt2.state.joints) != 7: 56 | print("joint state length error") 57 | return 58 | for i in range(len(joint_names)): 59 | if evt2.state.joints[joint_names[i]] != joint_values[i]: 60 | print("joint value mismatch") 61 | return 62 | scene_state_changed[0] = True 63 | if evt.type == tesseract_environment.Events_COMMAND_APPLIED: 64 | evt2 = tesseract_environment.cast_CommandAppliedEvent(evt) 65 | print(evt2.revision) 66 | if evt2.revision == 4: 67 | command_applied[0] = True 68 | except: 69 | traceback.print_exc() 70 | event_cb = tesseract_environment.EventCallbackFn(event_cb_py) 71 | 72 | env.addEventCallback(12345, event_cb) 73 | 74 | env.setState(joint_names, joint_values) 75 | assert scene_state_changed[0] 76 | 77 | cmd = tesseract_environment.RemoveJointCommand("joint_a7-tool0") 78 | assert env.applyCommand(cmd) 79 | assert command_applied[0] 80 | 81 | # env.init() now populates contact managers? 82 | 83 | """discrete_create_fn = tesseract_collision.DiscreteContactManagerFactoryCreateMethod(tesseract_collision_bullet.BulletDiscreteBVHManager.create) 84 | assert env.registerDiscreteContactManager(tesseract_collision_bullet.BulletDiscreteBVHManager.name(), 85 | discrete_create_fn) 86 | 87 | cont_create_fn = tesseract_collision.ContinuousContactManagerFactoryCreateMethod(tesseract_collision_bullet.BulletCastBVHManager.create) 88 | assert env.registerContinuousContactManager(tesseract_collision_bullet.BulletCastBVHManager.name(), 89 | cont_create_fn) 90 | 91 | env.setActiveDiscreteContactManager(tesseract_collision_bullet.BulletDiscreteBVHManager.name()) 92 | env.setActiveContinuousContactManager(tesseract_collision_bullet.BulletCastBVHManager.name())""" 93 | 94 | return env 95 | 96 | def test_env(): 97 | get_environment() -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_environment/test_tesseract_environment_kingroup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import numpy as np 3 | 4 | from tesseract_robotics.tesseract_environment import Environment 5 | from tesseract_robotics.tesseract_common import FilesystemPath, ManipulatorInfo 6 | from tesseract_robotics.tesseract_kinematics import KinGroupIKInput, KinGroupIKInputs, getRedundantSolutions 7 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 8 | 9 | def get_environment(): 10 | env = Environment() 11 | locator = TesseractSupportResourceLocator() 12 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 13 | urdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/abb_irb2400.urdf")) 14 | srdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/abb_irb2400.srdf")) 15 | assert env.init(urdf_path, srdf_path, locator) 16 | manip_info = ManipulatorInfo() 17 | manip_info.manipulator = "manipulator" 18 | manip_info.tcp_frame = "tool0" 19 | manip_info.working_frame = "base_link" 20 | joint_names = list(env.getJointGroup("manipulator").getJointNames()) 21 | 22 | return env, manip_info, joint_names 23 | 24 | def test_get_environment(): 25 | get_environment() 26 | 27 | def test_kinematic_group(): 28 | 29 | env, manip_info, joint_names = get_environment() 30 | 31 | kin_group = env.getKinematicGroup(manip_info.manipulator) 32 | 33 | joint_vals = np.ones((6,),dtype=np.float64)*0.1 34 | pose_map = kin_group.calcFwdKin(joint_vals) 35 | pose = pose_map[manip_info.tcp_frame] 36 | 37 | ik = KinGroupIKInput() 38 | ik.pose = pose 39 | ik.tip_link_name = "tool0" 40 | ik.working_frame = "base_link" 41 | iks = KinGroupIKInputs() 42 | iks.append(ik) 43 | 44 | invkin1 = kin_group.calcInvKin(iks,joint_vals*0.1) 45 | invkin = invkin1[0] 46 | 47 | np.testing.assert_allclose(invkin.flatten(),joint_vals) 48 | 49 | def test_kinematic_info(): 50 | 51 | env, manip_info, joint_names = get_environment() 52 | kin_info = env.getKinematicsInformation() 53 | 54 | assert list(kin_info.joint_groups) == [] 55 | assert list(kin_info.link_groups) == [] 56 | def test_tesseract_redundant_solutions_tesseract_function(): 57 | 58 | env, manip_info, joint_names = get_environment() 59 | 60 | kin_group = env.getKinematicGroup(manip_info.manipulator) 61 | 62 | limits = kin_group.getLimits() 63 | redundancy_indices = list(kin_group.getRedundancyCapableJointIndices()) 64 | 65 | import tesseract_robotics.tesseract_kinematics as tes_com 66 | sol = np.ones((6,1))*np.deg2rad(5) 67 | redun_sol = tes_com.getRedundantSolutions(sol, limits.joint_limits, redundancy_indices) 68 | 69 | assert len(redun_sol) == 2 70 | 71 | assert np.allclose(redun_sol[0].flatten(), 72 | np.array([0.08726646, 0.08726646, 0.08726646, 0.08726646, 0.08726646, -6.19591884])) or \ 73 | np.allclose(redun_sol[0].flatten(), 74 | np.array([0.08726646, 0.08726646, 0.08726646, 0.08726646, 0.08726646, 6.19591884])) 75 | 76 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_kinematics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_kinematics/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_kinematics/test_kdl_kinematics.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics import tesseract_kinematics 2 | from tesseract_robotics import tesseract_scene_graph 3 | from tesseract_robotics import tesseract_urdf 4 | from tesseract_robotics import tesseract_common 5 | from tesseract_robotics import tesseract_state_solver 6 | 7 | import re 8 | import os 9 | import traceback 10 | import numpy as np 11 | import numpy.testing as nptest 12 | 13 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 14 | 15 | def get_scene_graph(): 16 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 17 | path = os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.urdf") 18 | locator = TesseractSupportResourceLocator() 19 | return tesseract_urdf.parseURDFFile(path, locator).release() 20 | 21 | 22 | def get_plugin_factory(): 23 | support_dir = os.environ["TESSERACT_SUPPORT_DIR"] 24 | kin_config = tesseract_common.FilesystemPath(support_dir + "/urdf/" + "lbr_iiwa_14_r820_plugins.yaml") 25 | locator = TesseractSupportResourceLocator() 26 | return tesseract_kinematics.KinematicsPluginFactory(kin_config, locator), locator 27 | 28 | 29 | def run_inv_kin_test(inv_kin, fwd_kin): 30 | 31 | pose = np.eye(4) 32 | pose[2,3] = 1.306 33 | 34 | seed = np.array([-0.785398, 0.785398, -0.785398, 0.785398, -0.785398, 0.785398, -0.785398]) 35 | tip_pose = tesseract_common.TransformMap() 36 | tip_pose["tool0"] = tesseract_common.Isometry3d(pose) 37 | solutions = inv_kin.calcInvKin(tip_pose,seed) 38 | assert len(solutions) > 0 39 | 40 | result = fwd_kin.calcFwdKin(solutions[0]) 41 | 42 | nptest.assert_almost_equal(pose,result["tool0"].matrix(),decimal=3) 43 | 44 | def test_kdl_kin_chain_lma_inverse_kinematic(): 45 | plugin_factory, p_locator = get_plugin_factory() 46 | scene_graph = get_scene_graph() 47 | solver = tesseract_state_solver.KDLStateSolver(scene_graph) 48 | scene_state1 = solver.getState(np.zeros((7,))) 49 | scene_state2 = solver.getState(np.zeros((7,))) 50 | inv_kin = plugin_factory.createInvKin("manipulator","KDLInvKinChainLMA",scene_graph,scene_state1) 51 | fwd_kin = plugin_factory.createFwdKin("manipulator","KDLFwdKinChain",scene_graph,scene_state2) 52 | 53 | assert inv_kin 54 | assert fwd_kin 55 | 56 | run_inv_kin_test(inv_kin, fwd_kin) 57 | 58 | del inv_kin 59 | del fwd_kin 60 | 61 | 62 | def test_jacobian(): 63 | plugin_factory, p_locator = get_plugin_factory() 64 | scene_graph = get_scene_graph() 65 | solver = tesseract_state_solver.KDLStateSolver(scene_graph) 66 | scene_state = solver.getState(np.zeros((7,))) 67 | fwd_kin = plugin_factory.createFwdKin("manipulator","KDLFwdKinChain",scene_graph,scene_state) 68 | scene_graph = get_scene_graph() 69 | 70 | jvals = np.array([-0.785398, 0.785398, -0.785398, 0.785398, -0.785398, 0.785398, -0.785398]) 71 | 72 | link_name = "tool0" 73 | jacobian = fwd_kin.calcJacobian(jvals,link_name) 74 | 75 | assert jacobian.shape == (6,7) 76 | 77 | del fwd_kin 78 | 79 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_kinematics/test_opw_kinematics.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics import tesseract_kinematics 2 | from tesseract_robotics import tesseract_scene_graph 3 | from tesseract_robotics import tesseract_urdf 4 | from tesseract_robotics import tesseract_common 5 | from tesseract_robotics import tesseract_state_solver 6 | 7 | import re 8 | import os 9 | import traceback 10 | import numpy as np 11 | import numpy.testing as nptest 12 | 13 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 14 | 15 | def get_scene_graph(): 16 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 17 | path = os.path.join(tesseract_support, "urdf/abb_irb2400.urdf") 18 | locator = TesseractSupportResourceLocator() 19 | return tesseract_urdf.parseURDFFile(path, locator).release() 20 | 21 | 22 | def get_plugin_factory(): 23 | support_dir = os.environ["TESSERACT_SUPPORT_DIR"] 24 | kin_config = tesseract_common.FilesystemPath(support_dir + "/urdf/" + "abb_irb2400_plugins.yaml") 25 | locator = TesseractSupportResourceLocator() 26 | return tesseract_kinematics.KinematicsPluginFactory(kin_config, locator), locator 27 | 28 | 29 | def run_inv_kin_test(inv_kin, fwd_kin): 30 | 31 | pose = np.eye(4) 32 | pose[2,3] = 1.306 33 | 34 | seed = np.array([-0.785398, 0.785398, -0.785398, 0.785398, -0.785398, 0.785398]) 35 | tip_pose = tesseract_common.TransformMap() 36 | tip_pose["tool0"] = tesseract_common.Isometry3d(pose) 37 | solutions = inv_kin.calcInvKin(tip_pose,seed) 38 | assert len(solutions) > 0 39 | 40 | result = fwd_kin.calcFwdKin(solutions[0]) 41 | 42 | nptest.assert_almost_equal(pose,result["tool0"].matrix(),decimal=3) 43 | 44 | def test_opw_inverse_kinematic(): 45 | plugin_factory, p_locator = get_plugin_factory() 46 | scene_graph = get_scene_graph() 47 | solver = tesseract_state_solver.KDLStateSolver(scene_graph) 48 | scene_state1 = solver.getState(np.zeros((6,))) 49 | scene_state2 = solver.getState(np.zeros((6,))) 50 | inv_kin = plugin_factory.createInvKin("manipulator","OPWInvKin",scene_graph,scene_state1) 51 | fwd_kin = plugin_factory.createFwdKin("manipulator","KDLFwdKinChain",scene_graph,scene_state2) 52 | 53 | assert inv_kin 54 | assert fwd_kin 55 | 56 | run_inv_kin_test(inv_kin, fwd_kin) 57 | 58 | del inv_kin 59 | del fwd_kin 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_motion_planning/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_descartes_planner.py: -------------------------------------------------------------------------------- 1 | import re 2 | import traceback 3 | import os 4 | import numpy as np 5 | import numpy.testing as nptest 6 | 7 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 8 | from tesseract_robotics.tesseract_environment import Environment 9 | from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ 10 | ManipulatorInfo 11 | from tesseract_robotics.tesseract_command_language import JointWaypoint, CartesianWaypoint, WaypointPoly, \ 12 | MoveInstructionType_LINEAR, MoveInstruction, InstructionPoly, CartesianWaypointPoly, MoveInstructionPoly, \ 13 | CompositeInstruction, ProfileDictionary, InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly,\ 14 | CartesianWaypointPoly_wrap_CartesianWaypoint, MoveInstructionPoly_wrap_MoveInstruction 15 | from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse 16 | from tesseract_robotics.tesseract_motion_planners_descartes import DescartesDefaultPlanProfileD, \ 17 | DescartesMotionPlannerD, DescartesPlanProfileD, cast_DescartesPlanProfileD 18 | from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram 19 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 20 | 21 | DESCARTES_DEFAULT_NAMESPACE = "DescartesMotionPlannerTask" 22 | 23 | def get_environment(): 24 | locator = TesseractSupportResourceLocator() 25 | env = Environment() 26 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 27 | urdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/abb_irb2400.urdf")) 28 | srdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/abb_irb2400.srdf")) 29 | assert env.init(urdf_path, srdf_path, locator) 30 | manip_info = ManipulatorInfo() 31 | manip_info.tcp_frame = "tool0" 32 | manip_info.manipulator = "manipulator" 33 | manip_info.manipulator_ik_solver = "OPWInvKin" 34 | manip_info.working_frame = "base_link" 35 | joint_names = list(env.getJointGroup("manipulator").getJointNames()) 36 | 37 | return env, manip_info, joint_names 38 | 39 | def test_descartes_freespace_fixed_poses(): 40 | 41 | env, manip, joint_names = get_environment() 42 | kin_group = env.getKinematicGroup(manip.manipulator,manip.manipulator_ik_solver) 43 | 44 | wp1 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.8,-0.2,0.8) * Quaterniond(0,0,-1.0,0)) 45 | wp2 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.8,0.2,0.8) * Quaterniond(0,0,-1.0,0)) 46 | 47 | start_instruction = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp1), MoveInstructionType_LINEAR, "TEST_PROFILE", manip) 48 | plan_f1 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp2), MoveInstructionType_LINEAR, "TEST_PROFILE", manip) 49 | 50 | program = CompositeInstruction() 51 | program.setManipulatorInfo(manip) 52 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(start_instruction)) 53 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(plan_f1)) 54 | 55 | interpolated_program = generateInterpolatedProgram(program, env, 3.14, 1.0, 3.14, 10) 56 | 57 | plan_profile = DescartesDefaultPlanProfileD() 58 | # DescartesDefaultPlanProfileD is not upcasting automatically, use helper function 59 | plan_profile1 = cast_DescartesPlanProfileD(plan_profile) 60 | 61 | profiles = ProfileDictionary() 62 | profiles.addProfile(DESCARTES_DEFAULT_NAMESPACE,"TEST_PROFILE",plan_profile1) 63 | 64 | single_descartes_planner = DescartesMotionPlannerD(DESCARTES_DEFAULT_NAMESPACE) 65 | 66 | 67 | request = PlannerRequest() 68 | request.instructions = interpolated_program 69 | request.env = env 70 | request.profiles = profiles 71 | 72 | response = single_descartes_planner.solve(request) 73 | assert response.successful 74 | 75 | results = response.results.flatten() 76 | 77 | assert len(results) == 11 78 | for instr in results: 79 | # assert isMoveInstruction(instr) 80 | move_instr=InstructionPoly_as_MoveInstructionPoly(instr) 81 | wp1 = move_instr.getWaypoint() 82 | # assert isStateWaypoint(wp1) 83 | wp = WaypointPoly_as_StateWaypointPoly(wp1) 84 | assert len(wp.getNames()) == 6 85 | assert isinstance(wp.getPosition(),np.ndarray) 86 | assert len(wp.getPosition()) == 6 87 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_iterative_spline.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_command_language import CompositeInstruction, StateWaypoint, WaypointPoly, \ 2 | InstructionPoly, MoveInstruction, Instructions, MoveInstructionType_FREESPACE, StateWaypointPoly, \ 3 | MoveInstructionPoly, InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ 4 | MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint 5 | from tesseract_robotics.tesseract_time_parameterization import IterativeSplineParameterization, \ 6 | InstructionsTrajectory 7 | import numpy as np 8 | 9 | def create_straight_trajectory(): 10 | 11 | num = 10 12 | max_ = 2.0 13 | joint_names = ["joint_1", "joint_2", "joint_3", "joint_4", "joint_5", "joint_6"] 14 | 15 | program = CompositeInstruction() 16 | 17 | for i in range(num): 18 | p = np.zeros((6,),dtype=np.float64) 19 | p[0] = i * (max_/num) 20 | swp = StateWaypoint(joint_names, p) 21 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(MoveInstruction( 22 | StateWaypointPoly_wrap_StateWaypoint(swp), 23 | MoveInstructionType_FREESPACE))) 24 | 25 | p = np.zeros((6,),dtype=np.float64) 26 | p[0] = max_ 27 | swp = StateWaypoint(joint_names, p) 28 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(MoveInstruction( 29 | StateWaypointPoly_wrap_StateWaypoint(swp), 30 | MoveInstructionType_FREESPACE))) 31 | 32 | return program 33 | 34 | def test_time_parameterization(): 35 | 36 | time_parameterization = IterativeSplineParameterization(False) 37 | 38 | program = create_straight_trajectory() 39 | traj = InstructionsTrajectory(program) 40 | max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) 41 | max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) 42 | max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 43 | max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) 44 | max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 45 | max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) 46 | assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) 47 | res_instr1 = InstructionPoly_as_MoveInstructionPoly(program[-1]) 48 | WaypointPoly_as_StateWaypointPoly(res_instr1.getWaypoint()).getTime() > 1.0 49 | res_instr2 = InstructionPoly_as_MoveInstructionPoly(program[-1]) 50 | WaypointPoly_as_StateWaypointPoly(res_instr2.getWaypoint()).getTime() < 5.0 51 | 52 | def test_time_parameterization_vec(): 53 | 54 | time_parameterization = IterativeSplineParameterization(False) 55 | 56 | program = create_straight_trajectory() 57 | traj = InstructionsTrajectory(program) 58 | max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) 59 | max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) 60 | max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 61 | max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) 62 | max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 63 | max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) 64 | assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) 65 | res_instr1 = InstructionPoly_as_MoveInstructionPoly(program[-1]) 66 | WaypointPoly_as_StateWaypointPoly(res_instr1.getWaypoint()).getTime() > 1.0 67 | res_instr2 = InstructionPoly_as_MoveInstructionPoly(program[-1]) 68 | WaypointPoly_as_StateWaypointPoly(res_instr2.getWaypoint()).getTime() < 5.0 69 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_ompl_planner.py: -------------------------------------------------------------------------------- 1 | import re 2 | import traceback 3 | import os 4 | import numpy as np 5 | import numpy.testing as nptest 6 | 7 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 8 | from tesseract_robotics.tesseract_environment import Environment 9 | from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ 10 | ManipulatorInfo 11 | from tesseract_robotics.tesseract_command_language import JointWaypoint, CartesianWaypoint, WaypointPoly, \ 12 | MoveInstructionType_FREESPACE, MoveInstruction, InstructionPoly, MoveInstructionPoly,\ 13 | CompositeInstruction, ProfileDictionary, CartesianWaypointPoly, JointWaypointPoly, \ 14 | InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ 15 | JointWaypointPoly_wrap_JointWaypoint, CartesianWaypointPoly_wrap_CartesianWaypoint, \ 16 | MoveInstructionPoly_wrap_MoveInstruction 17 | from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse 18 | from tesseract_robotics.tesseract_motion_planners_ompl import RRTConnectConfigurator, \ 19 | OMPLMotionPlanner, OMPLRealVectorPlanProfile 20 | from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram 21 | 22 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 23 | 24 | OMPL_DEFAULT_NAMESPACE = "OMPLMotionPlannerTask" 25 | 26 | def get_environment(): 27 | locator = TesseractSupportResourceLocator() 28 | env = Environment() 29 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 30 | urdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.urdf")) 31 | srdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.srdf")) 32 | assert env.init(urdf_path, srdf_path, locator) 33 | manip_info = ManipulatorInfo() 34 | manip_info.tcp_frame = "tool0" 35 | manip_info.manipulator = "manipulator" 36 | manip_info.working_frame = "base_link" 37 | joint_names = list(env.getJointGroup("manipulator").getJointNames()) 38 | 39 | return env, manip_info, joint_names 40 | 41 | def test_ompl_freespace_joint_cart(): 42 | 43 | start_state = np.array([-0.5, 0.5, 0.0, -1.3348, 0.0, 1.4959, 0.0],dtype=np.float64) 44 | end_state = np.array([0.5, 0.5, 0.0, -1.3348, 0.0, 1.4959, 0.0],dtype=np.float64) 45 | 46 | env, manip, joint_names = get_environment() 47 | kin_group = env.getKinematicGroup(manip.manipulator) 48 | 49 | wp1 = JointWaypoint(joint_names, start_state) 50 | 51 | goal = kin_group.calcFwdKin(end_state)[manip.tcp_frame] 52 | wp2 = CartesianWaypoint(goal) 53 | 54 | start_instruction = MoveInstruction(JointWaypointPoly_wrap_JointWaypoint(wp1), MoveInstructionType_FREESPACE, "TEST_PROFILE") 55 | plan_f1 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp2), MoveInstructionType_FREESPACE, "TEST_PROFILE") 56 | 57 | program = CompositeInstruction("TEST_PROFILE") 58 | program.setManipulatorInfo(manip) 59 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(start_instruction)) 60 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(plan_f1)) 61 | 62 | interpolated_program = generateInterpolatedProgram(program, env, 3.14, 1.0, 3.14, 10) 63 | 64 | plan_profile = OMPLRealVectorPlanProfile() 65 | 66 | profiles = ProfileDictionary() 67 | profiles.addProfile(OMPL_DEFAULT_NAMESPACE, "TEST_PROFILE", plan_profile) 68 | 69 | request = PlannerRequest() 70 | request.instructions = interpolated_program 71 | request.env = env 72 | request.profiles = profiles 73 | 74 | 75 | ompl_planner = OMPLMotionPlanner(OMPL_DEFAULT_NAMESPACE) 76 | response = PlannerResponse() 77 | 78 | response=ompl_planner.solve(request) 79 | assert response.successful 80 | 81 | results = response.results.flatten() 82 | 83 | assert len(results) == 11 84 | for instr in results: 85 | instr.isMoveInstruction() 86 | move_instr1 = InstructionPoly_as_MoveInstructionPoly(instr) 87 | wp1 = move_instr1.getWaypoint() 88 | wp1.isStateWaypoint() 89 | wp = WaypointPoly_as_StateWaypointPoly(wp1) 90 | assert len(wp.getNames()) == 7 91 | assert isinstance(wp.getPosition(),np.ndarray) 92 | assert len(wp.getPosition()) == 7 93 | 94 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_simple_planner.py: -------------------------------------------------------------------------------- 1 | import re 2 | import traceback 3 | import os 4 | import numpy as np 5 | 6 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 7 | from tesseract_robotics.tesseract_environment import Environment 8 | from tesseract_robotics.tesseract_common import FilesystemPath, ManipulatorInfo 9 | from tesseract_robotics.tesseract_command_language import JointWaypoint, CartesianWaypoint, WaypointPoly, \ 10 | MoveInstructionType_FREESPACE, MoveInstruction, InstructionPoly, \ 11 | MoveInstructionPoly, MoveInstructionType_LINEAR, JointWaypointPoly, CartesianWaypointPoly, \ 12 | InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ 13 | JointWaypointPoly_wrap_JointWaypoint, CartesianWaypointPoly_wrap_CartesianWaypoint, \ 14 | MoveInstructionPoly_wrap_MoveInstruction 15 | from tesseract_robotics.tesseract_motion_planners import PlannerRequest 16 | from tesseract_robotics.tesseract_motion_planners_simple import SimplePlannerLVSPlanProfile 17 | 18 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 19 | 20 | def get_environment(): 21 | env = Environment() 22 | locator = TesseractSupportResourceLocator() 23 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 24 | urdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.urdf")) 25 | srdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.srdf")) 26 | assert env.init(urdf_path, srdf_path, locator) 27 | manip_info = ManipulatorInfo() 28 | manip_info.manipulator = "manipulator" 29 | manip_info.tcp_frame = "tool0" 30 | manip_info.working_frame = "base_link" 31 | joint_names = list(env.getJointGroup("manipulator").getJointNames()) 32 | 33 | return env, manip_info, joint_names 34 | 35 | def test_get_environment(): 36 | get_environment() 37 | 38 | def test_interpolatestatewaypoint_jointcart_freespace(): 39 | env, manip_info, joint_names = get_environment() 40 | 41 | joint_group = env.getJointGroup(manip_info.manipulator) 42 | wp1 = JointWaypoint(joint_names, np.zeros((7,),dtype=np.float64)) 43 | wp1_seed = JointWaypoint(joint_names, env.getState().getJointValues(joint_names)) 44 | wp2 = CartesianWaypoint(joint_group.calcFwdKin(np.ones((7,),dtype=np.float64))[manip_info.tcp_frame]) 45 | instr1 = MoveInstruction(JointWaypointPoly_wrap_JointWaypoint(wp1), MoveInstructionType_FREESPACE, "TEST_PROFILE", manip_info) 46 | instr1_seed = MoveInstruction(JointWaypointPoly_wrap_JointWaypoint(wp1), MoveInstructionType_LINEAR, "TEST_PROFILE", manip_info) 47 | instr1_seed.assignJointWaypoint(JointWaypointPoly_wrap_JointWaypoint(wp1_seed)) 48 | instr2 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp2), MoveInstructionType_FREESPACE, "TEST_PROFILE", manip_info) 49 | 50 | instr3 = InstructionPoly() 51 | 52 | profile = SimplePlannerLVSPlanProfile(3.14,0.5,1.57,5) 53 | composite = profile.generate(MoveInstructionPoly_wrap_MoveInstruction(instr1),MoveInstructionPoly_wrap_MoveInstruction(instr1_seed), 54 | MoveInstructionPoly_wrap_MoveInstruction(instr2),instr3,env,manip_info) 55 | 56 | for c in composite: 57 | assert c.getWaypoint().isCartesianWaypoint() or c.getWaypoint().isJointWaypoint() 58 | 59 | # assert c.as_MoveInstruction().getProfile() == instr2.getProfile() 60 | 61 | # mi = composite[-1].as_const_MoveInstruction() 62 | # last_position = mi.getWaypoint().as_const_StateWaypoint().position 63 | # final_pose = joint_group.calcFwdKin(last_position)[manip_info.tcp_frame] 64 | # assert wp2.isApprox(final_pose, 1e-3) 65 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_time_optimal_trajectory.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_command_language import CompositeInstruction, StateWaypoint, WaypointPoly, \ 2 | InstructionPoly, MoveInstruction, Instructions, MoveInstructionType_FREESPACE, StateWaypointPoly,\ 3 | MoveInstructionPoly, InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ 4 | MoveInstructionPoly_wrap_MoveInstruction, StateWaypointPoly_wrap_StateWaypoint 5 | 6 | from tesseract_robotics.tesseract_time_parameterization import TimeOptimalTrajectoryGeneration, \ 7 | InstructionsTrajectory 8 | import numpy as np 9 | 10 | def create_straight_trajectory(): 11 | 12 | num = 10 13 | max_ = 2.0 14 | joint_names = ["joint_1", "joint_2", "joint_3", "joint_4", "joint_5", "joint_6"] 15 | 16 | program = CompositeInstruction() 17 | 18 | for i in range(num): 19 | p = np.zeros((6,),dtype=np.float64) 20 | p[0] = i * (max_/num) 21 | swp = StateWaypoint(joint_names, p) 22 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(MoveInstruction( 23 | StateWaypointPoly_wrap_StateWaypoint(swp), MoveInstructionType_FREESPACE))) 24 | 25 | p = np.zeros((6,),dtype=np.float64) 26 | p[0] = max_ 27 | swp = StateWaypoint(joint_names, p) 28 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(MoveInstruction( 29 | StateWaypointPoly_wrap_StateWaypoint(swp), MoveInstructionType_FREESPACE))) 30 | 31 | return program 32 | 33 | def test_time_parameterization(): 34 | 35 | time_parameterization = TimeOptimalTrajectoryGeneration() 36 | 37 | program = create_straight_trajectory() 38 | traj = InstructionsTrajectory(program) 39 | max_velocity = np.array([[2.088, 2.082, 3.27, 3.6, 3.3, 3.078]],dtype=np.float64) 40 | max_velocity = np.hstack((-max_velocity.T, max_velocity.T)) 41 | max_acceleration = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 42 | max_acceleration = np.hstack((-max_acceleration.T, max_acceleration.T)) 43 | max_jerk = np.array([[ 1, 1, 1, 1, 1, 1]],dtype=np.float64) 44 | max_jerk = np.hstack((-max_jerk.T, max_jerk.T)) 45 | assert time_parameterization.compute(traj, max_velocity, max_acceleration, max_jerk) 46 | instr1 = program[-1] 47 | instr1_1 = InstructionPoly_as_MoveInstructionPoly(instr1) 48 | result_wp1 = instr1_1.getWaypoint() 49 | assert WaypointPoly_as_StateWaypointPoly(result_wp1).getTime() > 1.0 50 | instr1_2 = InstructionPoly_as_MoveInstructionPoly(program[-1]) 51 | assert WaypointPoly_as_StateWaypointPoly(instr1_2.getWaypoint()).getTime() < 5.0 52 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_motion_planning/test_trajopt_planner.py: -------------------------------------------------------------------------------- 1 | import re 2 | import traceback 3 | import os 4 | import numpy as np 5 | import numpy.testing as nptest 6 | 7 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 8 | from tesseract_robotics.tesseract_environment import Environment 9 | from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \ 10 | ManipulatorInfo 11 | from tesseract_robotics.tesseract_command_language import JointWaypoint, CartesianWaypoint, WaypointPoly, \ 12 | MoveInstructionType_FREESPACE, MoveInstruction, InstructionPoly, \ 13 | CompositeInstruction, ProfileDictionary, CartesianWaypointPoly, JointWaypointPoly, MoveInstructionPoly, \ 14 | InstructionPoly_as_MoveInstructionPoly, WaypointPoly_as_StateWaypointPoly, \ 15 | JointWaypointPoly_wrap_JointWaypoint, CartesianWaypointPoly_wrap_CartesianWaypoint, \ 16 | MoveInstructionPoly_wrap_MoveInstruction 17 | from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse 18 | from tesseract_robotics.tesseract_motion_planners_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \ 19 | TrajOptMotionPlanner 20 | from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram 21 | 22 | from ..tesseract_support_resource_locator import TesseractSupportResourceLocator 23 | 24 | TRAJOPT_DEFAULT_NAMESPACE = "TrajOptMotionPlannerTask" 25 | 26 | def get_environment(): 27 | locator = TesseractSupportResourceLocator() 28 | env = Environment() 29 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 30 | urdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.urdf")) 31 | srdf_path = FilesystemPath(os.path.join(tesseract_support, "urdf/lbr_iiwa_14_r820.srdf")) 32 | assert env.init(urdf_path, srdf_path, locator) 33 | manip_info = ManipulatorInfo() 34 | manip_info.tcp_frame = "tool0" 35 | manip_info.manipulator = "manipulator" 36 | manip_info.working_frame = "base_link" 37 | manip_info.manipulator_ik_solver = "KDLInvKinChainLMA" 38 | joint_names = list(env.getJointGroup("manipulator").getJointNames()) 39 | 40 | return env, manip_info, joint_names 41 | 42 | def test_trajopt_freespace_joint_cart(): 43 | 44 | env, manip, joint_names = get_environment() 45 | 46 | wp1 = JointWaypoint(joint_names, np.array([0,0,0,-1.57,0,0,0],dtype=np.float64)) 47 | wp2 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(-.2,.4,0.2) * Quaterniond(0,0,1.0,0)) 48 | 49 | start_instruction = MoveInstruction(JointWaypointPoly_wrap_JointWaypoint(wp1), MoveInstructionType_FREESPACE, "TEST_PROFILE") 50 | plan_f1 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp2), MoveInstructionType_FREESPACE, "TEST_PROFILE") 51 | 52 | program = CompositeInstruction("TEST_PROFILE") 53 | program.setManipulatorInfo(manip) 54 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(start_instruction)) 55 | program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(plan_f1)) 56 | 57 | interpolated_program = generateInterpolatedProgram(program, env, 3.14, 1.0, 3.14, 10) 58 | 59 | plan_profile = TrajOptDefaultPlanProfile() 60 | composite_profile = TrajOptDefaultCompositeProfile() 61 | 62 | profiles = ProfileDictionary() 63 | profiles.addProfile(TRAJOPT_DEFAULT_NAMESPACE, "TEST_PROFILE", plan_profile) 64 | profiles.addProfile(TRAJOPT_DEFAULT_NAMESPACE, "TEST_PROFILE", composite_profile) 65 | 66 | 67 | test_planner = TrajOptMotionPlanner(TRAJOPT_DEFAULT_NAMESPACE) 68 | 69 | 70 | request = PlannerRequest() 71 | request.instructions = interpolated_program 72 | request.env = env 73 | request.profiles = profiles 74 | 75 | response = test_planner.solve(request) 76 | assert response.successful 77 | 78 | results = response.results.flatten() 79 | 80 | assert len(results) == 11 81 | for instr in results: 82 | instr.isMoveInstruction() 83 | move_instr1 = InstructionPoly_as_MoveInstructionPoly(instr) 84 | wp1 = move_instr1.getWaypoint() 85 | wp1.isStateWaypoint() 86 | wp = WaypointPoly_as_StateWaypointPoly(wp1) 87 | assert len(wp.getNames()) == 7 88 | assert isinstance(wp.getPosition(),np.ndarray) 89 | assert len(wp.getPosition()) == 7 90 | -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_scene_graph/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_scene_graph/__init__.py -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_support_resource_locator.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import traceback 4 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 5 | 6 | class TesseractSupportResourceLocator(ResourceLocator): 7 | def __init__(self): 8 | super().__init__() 9 | 10 | def locateResource(self, url): 11 | try: 12 | try: 13 | if os.path.exists(url): 14 | return SimpleLocatedResource(url, url, self) 15 | except: 16 | pass 17 | url_match = re.match(r"^package:\/\/tesseract_support\/(.*)$",url) 18 | if (url_match is None): 19 | print("url_match failed") 20 | return None 21 | if not "TESSERACT_SUPPORT_DIR" in os.environ: 22 | return None 23 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 24 | filename = os.path.join(tesseract_support, os.path.normpath(url_match.group(1))) 25 | ret = SimpleLocatedResource(url, filename, self) 26 | return ret 27 | except: 28 | traceback.print_exc() -------------------------------------------------------------------------------- /tesseract_python/tests/tesseract_task_composer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_python/tests/tesseract_task_composer/__init__.py -------------------------------------------------------------------------------- /tesseract_viewer_python/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | node_modules 132 | package-lock.json 133 | -------------------------------------------------------------------------------- /tesseract_viewer_python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.0) 2 | 3 | # Extract package name and version 4 | find_package(ros_industrial_cmake_boilerplate REQUIRED) 5 | extract_package_metadata(pkg) 6 | project(${pkg_extracted_name} VERSION ${pkg_extracted_version}) 7 | 8 | if(NOT PYTHON_VERSION) 9 | set(PYTHON_VERSION $ENV{ROS_PYTHON_VERSION}) 10 | message(STATUS "Setting Python Version: " ${PYTHON_VERSION}) 11 | endif() 12 | 13 | if(PYTHON_VERSION) 14 | if(${PYTHON_VERSION} LESS 3) 15 | set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0) 16 | else() 17 | set(Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) 18 | endif() 19 | endif() 20 | 21 | find_package(PythonInterp ${PYTHON_VERSION} REQUIRED) 22 | find_package(PythonLibs REQUIRED) 23 | message(STATUS "Building Python Version: " ${PYTHON_VERSION_MAJOR}) 24 | 25 | # Read version 26 | FILE (STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/package.xml" tesseract_viewer_python_version1 REGEX "[0-9]+\\.[0-9]+\\.[0-9]+") 27 | IF ("${tesseract_viewer_python_version1}" STREQUAL "" ) 28 | MESSAGE(FATAL_ERROR "Could not read tesseract_viewer_python version.") 29 | ENDIF() 30 | STRING (REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9]+)" "\\1" tesseract_viewer_python_version2 ${tesseract_viewer_python_version1}) 31 | STRING (STRIP ${tesseract_viewer_python_version2} tesseract_viewer_python_version) 32 | MESSAGE(STATUS "tesseract_viewer_python version: ${tesseract_viewer_python_version}") 33 | 34 | if(NOT TESSERACT_PYTHON_BUILD_WHEEL) 35 | 36 | set(enable_setuptools_deb_layout OFF) 37 | if(EXISTS "/etc/debian_version") 38 | set(enable_setuptools_deb_layout ON) 39 | endif() 40 | option(SETUPTOOLS_DEB_LAYOUT "Enable debian style python package layout" ${enable_setuptools_deb_layout}) 41 | if(SETUPTOOLS_DEB_LAYOUT) 42 | message(STATUS "Using Debian Python package layout") 43 | set(SETUPTOOLS_ARG_EXTRA "--install-layout=deb") 44 | endif() 45 | 46 | install(CODE "message(STATUS \"Running setup.py in ${CMAKE_CURRENT_SOURCE_DIR}\") 47 | execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py install -f 48 | --root=/ --prefix=${CMAKE_INSTALL_PREFIX} ${SETUPTOOLS_ARG_EXTRA} --single-version-externally-managed WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})") 49 | 50 | # Allows Colcon to find non-Ament packages when using workspace underlays 51 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") 52 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} DESTINATION share/ament_index/resource_index/packages) 53 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/ament_prefix_path.dsv "prepend-non-duplicate;AMENT_PREFIX_PATH;") 54 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/ament_prefix_path.dsv DESTINATION share/${PROJECT_NAME}/hook) 55 | 56 | if (${PYTHON_VERSION_MAJOR} LESS 3) 57 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.dsv "prepend-non-duplicate;PYTHONPATH;lib/python2.7/dist-packages") 58 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.dsv DESTINATION share/${PROJECT_NAME}/hook) 59 | else() 60 | file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.dsv "prepend-non-duplicate;PYTHONPATH;lib/python3/dist-packages") 61 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/${PROJECT_NAME}/hook/python_path.dsv DESTINATION share/${PROJECT_NAME}/hook) 62 | endif() 63 | 64 | else() 65 | add_custom_target(tesseract_viewer_python_wheel ALL ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py bdist_wheel WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 66 | 67 | endif() 68 | -------------------------------------------------------------------------------- /tesseract_viewer_python/colcon.pkg: -------------------------------------------------------------------------------- 1 | { 2 | "hooks": ["share/tesseract_viewer_python/hook/ament_prefix_path.dsv", "share/tesseract_python/hook/python_path.dsv"] 3 | } 4 | -------------------------------------------------------------------------------- /tesseract_viewer_python/examples/javascript/tesseract_viewer_python_iframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /tesseract_viewer_python/examples/javascript/tesseract_viewer_python_iframe_trajectory.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /tesseract_viewer_python/examples/shapes_viewer.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_environment import Environment 2 | from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource 3 | import os 4 | import re 5 | import traceback 6 | from tesseract_robotics_viewer import TesseractViewer 7 | import numpy as np 8 | import time 9 | import sys 10 | 11 | shapes_urdf=""" 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | """ 73 | 74 | TESSERACT_SUPPORT_DIR = os.environ["TESSERACT_SUPPORT_DIR"] 75 | 76 | class TesseractSupportResourceLocator(ResourceLocator): 77 | def __init__(self): 78 | super().__init__() 79 | 80 | def locateResource(self, url): 81 | try: 82 | try: 83 | if os.path.exists(url): 84 | return SimpleLocatedResource(url, url, self) 85 | except: 86 | pass 87 | url_match = re.match(r"^package:\/\/tesseract_support\/(.*)$",url) 88 | if (url_match is None): 89 | print("url_match failed") 90 | return None 91 | if not "TESSERACT_SUPPORT_DIR" in os.environ: 92 | return None 93 | tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"] 94 | filename = os.path.join(tesseract_support, os.path.normpath(url_match.group(1))) 95 | ret = SimpleLocatedResource(url, filename, self) 96 | return ret 97 | except: 98 | traceback.print_exc() 99 | 100 | 101 | t_env = Environment() 102 | 103 | # locator must be kept alive by maintaining a reference 104 | locator=TesseractSupportResourceLocator() 105 | t_env.init(shapes_urdf, locator) 106 | 107 | viewer = TesseractViewer() 108 | 109 | viewer.update_environment(t_env, [0,0,0]) 110 | 111 | viewer.start_serve_background() 112 | 113 | if sys.version_info[0] < 3: 114 | raw_input("press enter") 115 | else: 116 | input("press enter") 117 | 118 | -------------------------------------------------------------------------------- /tesseract_viewer_python/examples/tesseract_material_mesh_viewer.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_environment import Environment 2 | from tesseract_robotics.tesseract_common import GeneralResourceLocator 3 | import os 4 | import re 5 | import traceback 6 | from tesseract_robotics_viewer import TesseractViewer 7 | import numpy as np 8 | import time 9 | import sys 10 | 11 | shapes_urdf=""" 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | """ 49 | 50 | t_env = Environment() 51 | 52 | # locator_fn must be kept alive by maintaining a reference 53 | locator=GeneralResourceLocator() 54 | t_env.init(shapes_urdf, locator) 55 | 56 | viewer = TesseractViewer() 57 | 58 | viewer.update_environment(t_env, [0,0,0]) 59 | 60 | viewer.start_serve_background() 61 | 62 | if sys.version_info[0] < 3: 63 | raw_input("press enter") 64 | else: 65 | input("press enter") 66 | 67 | -------------------------------------------------------------------------------- /tesseract_viewer_python/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tesseract_viewer_python 4 | 0.5.0 5 | The tesseract_viewer_python package 6 | John Wason 7 | Apache 2.0 8 | John Wason 9 | 10 | 11 | catkin 12 | cmake 13 | 14 | ros_industrial_cmake_boilerplate 15 | trajopt 16 | tesseract_collision 17 | tesseract_motion_planners 18 | tesseract_kinematics 19 | tesseract_environment 20 | tesseract_scene_graph 21 | tesseract_common 22 | tesseract_visualization 23 | tesseract_python 24 | 25 | python 26 | python-numpy 27 | python-pytest 28 | 29 | python3 30 | python3-numpy 31 | python3-pytest 32 | 33 | 34 | cmake 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /tesseract_viewer_python/setup.py: -------------------------------------------------------------------------------- 1 | # Based on https://github.com/robotraconteur/robotraconteur/blob/master/RobotRaconteurPython/setup.py.in 2 | 3 | from setuptools import setup, Distribution 4 | import os 5 | from xml.etree import ElementTree as ET 6 | 7 | tree = ET.parse(os.path.join(os.path.dirname(__file__), 'package.xml')) 8 | root = tree.getroot() 9 | version = root.find('version').text 10 | 11 | 12 | setup(name='tesseract-robotics-viewer', 13 | version=version, 14 | description='Tesseract Viewer Python Library', 15 | author='John Wason', 16 | author_email='wason@wasontech.com', 17 | url='https://github.com/tesseract-robotics/tesseract_python', 18 | packages=['tesseract_robotics_viewer','tesseract_robotics_viewer.resources'], 19 | package_data={'tesseract_robotics_viewer.resources':['static/index.html','static/app.js','geometries.json']}, 20 | license='Apache-2.0', 21 | install_requires=['numpy','tesseract_robotics>=0.2.0','opencv-contrib-python','aiohttp','importlib-resources'], 22 | long_description='Tesseract Robotics viewer package for Python' 23 | ) -------------------------------------------------------------------------------- /tesseract_viewer_python/tesseract_robotics_viewer/__init__.py: -------------------------------------------------------------------------------- 1 | from .tesseract_viewer import * -------------------------------------------------------------------------------- /tesseract_viewer_python/tesseract_robotics_viewer/resources/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tesseract-robotics/tesseract_python/56b3352052dbc72287c634eab2b8c31383a78349/tesseract_viewer_python/tesseract_robotics_viewer/resources/__init__.py -------------------------------------------------------------------------------- /tesseract_viewer_python/tesseract_robotics_viewer/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tesseract Viewer 6 | 7 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /tesseract_viewer_python/tesseract_robotics_viewer/util.py: -------------------------------------------------------------------------------- 1 | from tesseract_robotics.tesseract_common import JointTrajectory, Quaterniond 2 | from tesseract_robotics.tesseract_command_language import CompositeInstruction, InstructionPoly_as_MoveInstructionPoly, \ 3 | WaypointPoly_as_StateWaypointPoly 4 | import json 5 | import numpy as np 6 | 7 | def tesseract_trajectory_to_list(tesseract_trajectory): 8 | 9 | start_instruction_o = tesseract_trajectory[0] 10 | start_waypoint_m = InstructionPoly_as_MoveInstructionPoly(start_instruction_o) 11 | start_waypoint_o = start_waypoint_m.getWaypoint() 12 | assert start_waypoint_o.isStateWaypoint() 13 | start_waypoint = WaypointPoly_as_StateWaypointPoly(start_waypoint_o) 14 | 15 | joint_names = list(start_waypoint.getNames()) 16 | 17 | trajectory2 = [] 18 | for i in range(len(tesseract_trajectory)): 19 | instr = tesseract_trajectory[i] 20 | instr_m = InstructionPoly_as_MoveInstructionPoly(instr) 21 | wp = instr_m.getWaypoint() 22 | wp.isStateWaypoint() 23 | state_wp = WaypointPoly_as_StateWaypointPoly(wp) 24 | trajectory2.append(state_wp.getPosition().flatten().tolist() + [state_wp.getTime()]) 25 | 26 | return joint_names, trajectory2 27 | 28 | def trajectory_list_to_json(joint_names, trajectory_list, use_time = True, loop_time = 20): 29 | 30 | trajectory_json = dict() 31 | trajectory_json["use_time"] = use_time 32 | trajectory_json["loop_time"] = loop_time 33 | trajectory_json["joint_names"] = joint_names 34 | trajectory_json["trajectory"] = trajectory_list 35 | return json.dumps(trajectory_json) 36 | 37 | def joint_positions_to_trajectory_json(joint_names, joint_positions): 38 | # Create "infinite" animation with constant joint angles 39 | 40 | trajectory_json = dict() 41 | trajectory_json["use_time"] = True 42 | trajectory_json["loop_time"] = 10000 43 | 44 | assert joint_names and all(isinstance(s,str) for s in joint_names), "Joint names must all be strings" 45 | trajectory_json["joint_names"] = joint_names 46 | assert isinstance(joint_positions,np.ndarray), "Expected numpy array for joint_positions" 47 | assert joint_positions.dtype == np.float64, "Expected double float array for joint_positions" 48 | joint_positions = list(joint_positions.flatten()) 49 | assert len(joint_positions) == len(joint_names) 50 | trajectory_json["trajectory"] = [joint_positions + [0.0], joint_positions + [1e6]] 51 | 52 | return json.dumps(trajectory_json) 53 | 54 | def trajectory_list_to_frames(tesseract_env, manipulator_info, joint_names, trajectory_list): 55 | ret = [] 56 | kin = tesseract_env.getKinematicGroup(manipulator_info.manipulator) 57 | for i in range(len(trajectory_list)): 58 | frames = kin.calcFwdKin(np.asarray(trajectory_list[i],dtype=np.float64)) 59 | frame = frames[manipulator_info.tcp_frame] 60 | p = frame.translation().flatten() 61 | q1 = Quaterniond(frame.linear()) 62 | q = np.array([q1.w(), q1.x(), q1.y(), q1.z()]) 63 | 64 | ret.append([p,q]) 65 | return ret 66 | -------------------------------------------------------------------------------- /tools/extract_docs/api_docs_generated.rst.j2: -------------------------------------------------------------------------------- 1 | 2 | Classes 3 | ******* 4 | 5 | {% for tesseract_class in classes %} 6 | {{ tesseract_class }} Class 7 | =================================================================================================== 8 | .. autoclass:: tesseract_robotics.{{ tesseract_module }}.{{ tesseract_class }} 9 | :noindex: 10 | :exclude-members: thisown 11 | :members: 12 | {% endfor %} 13 | 14 | {% if functions|length > 0 -%} 15 | Functions 16 | ********* 17 | {% for function in functions %} 18 | {{ function }} Function 19 | =================================================================================================== 20 | .. autofunction:: tesseract_robotics.{{ tesseract_module }}.{{ function }} 21 | :noindex: 22 | {% endfor %} 23 | {% endif -%} 24 | 25 | {% if constants|length > 0 -%} 26 | Constants 27 | ********* 28 | 29 | {% for constant in constants -%} 30 | * ``{{ constant }}`` 31 | {% endfor %} 32 | {% endif -%} 33 | 34 | {% if containers|length > 0 -%} 35 | Container Templates 36 | ******************* 37 | 38 | {% for container in containers -%} 39 | * ``{{ container[0] }}`` -> ``{{ container[1] }}`` 40 | {% endfor %} 41 | {% endif -%} 42 | 43 | {%if any_poly|length > 0%} 44 | AnyPoly Accessor Functions 45 | ************************** 46 | 47 | {% for poly in any_poly -%} 48 | * ``{{ poly }}`` 49 | {% endfor %} 50 | {% endif -%} 51 | 52 | 53 | --------------------------------------------------------------------------------