GithubHelp home page GithubHelp logo

tesseract-robotics / tesseract_python Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 12.0 6.06 MB

This contains python wrappers for both Tesseract and Tesseract Planning packages

Home Page: https://tesseract-robotics.github.io/tesseract_python/

HTML 0.73% Python 31.51% CMake 4.57% SWIG 36.99% C 20.00% C++ 1.45% JavaScript 4.53% Jinja 0.22%

tesseract_python's People

Contributors

haudren avatar johnwason avatar levi-armstrong avatar marip8 avatar mpowelson avatar rsinnet avatar schornakj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tesseract_python's Issues

TaskComposerPluginFactory constructor is not compatible with string input

I am unable to construct a TaskComposerPluginFactory using a string as input:

import os

from tesseract_robotics import tesseract_common
from tesseract_robotics.tesseract_task_composer import TaskComposerPluginFactory

TESSERACT_SUPPORT_DIR = os.environ["TESSERACT_RESOURCE_PATH"]
TESSERACT_TASK_COMPOSER_DIR = os.environ["TESSERACT_TASK_COMPOSER_CONFIG_FILE"]

TASK_COMPOSER_PLUGIN_YAML = r"config/task_composer_plugins.yaml"

tesseract_common.setLogLevel(tesseract_common.CONSOLE_BRIDGE_LOG_DEBUG)

config_path = TESSERACT_TASK_COMPOSER_DIR + TASK_COMPOSER_PLUGIN_YAML
factory = TaskComposerPluginFactory(config_path)

I get the following error:

You can set logging level with TRAJOPT_LOG_THRESH. Valid values: FATAL ERROR WARN INFO DEBUG TRACE. Defaulting to ERROR
Traceback (most recent call last):
  File "/home/samxl/workspaces/tesseract_ws/src/tesseract_playground/task_composer.py", line 16, in <module>
    factory = TaskComposerPluginFactory(config_path)
  File "/home/samxl/.local/lib/python3.8/site-packages/tesseract_robotics/tesseract_task_composer/tesseract_task_composer_python.py", line 1958, in __init__
    _tesseract_task_composer_python.TaskComposerPluginFactory_swiginit(self, _tesseract_task_composer_python.new_TaskComposerPluginFactory(*args))
RuntimeError: operator[] call on a scalar

If I look at the TaskComposerPluginFactory, I find references to a constructor using a string as input and would've expected this to also be accepted.

For now, I will work around this by using a tesseract_common::FilesystemPath object as input.

Planning for multiple moves crashes - no start point

Hello tesseract devs,

in our project we face the problem, that we can't plan a path with more than two MoveInstructions. As soon as we add a third MoveInstruction the planning fails with the error message, that no start point has been set. But we couldn't find a way to add a start point. All we can do and did is set a state for the environment. Do you maybe know what causes this issue?
In the following I will add code extracts and the error message:

    OMPL_DEFAULT_NAMESPACE = "OMPLMotionPlannerTask"
    TRAJOPT_DEFAULT_NAMESPACE = "TrajOptMotionPlannerTask"


    # Initialize the resource locator and environment
    
    # Fill in the manipulator information. This is used to find the kinematic chain for the manipulator. This must
    # match the SRDF, although the exact tcp_frame can differ if a tool is used.
    manip_info = ManipulatorInfo()
    manip_info.tcp_frame = "tool0"
    manip_info.manipulator = "manipulator"
    manip_info.working_frame = "base_link"

    locator = GeneralResourceLocator()
    urdf_xml_path = FilesystemPath(locator.locateResource("/root/ws/src/tesseract_planning/resources/urdf/workStation.urdf").getFilePath())
    srdf_xml_path = FilesystemPath(locator.locateResource("/root/ws/src/tesseract_planning/resources/urdf/workStation.srdf").getFilePath())

    t_env = Environment()
    t_env.init(urdf_xml_path, srdf_xml_path, locator)
    joint_names = ["shoulder_pan_joint","shoulder_lift_joint","elbow_joint","wrist_1_joint","wrist_2_joint","wrist_3_joint"]


    # Set the initial state of the robot
    t_env.setState(joint_names, np.ones(6)*0.1)

    env = t_env
    manip = manip_info

    cur_state = env.getState()
    wp1 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.5,0.5,0.5) * Quaterniond(1,0.0,0.0,0.0))
    wp2 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(-0.5,0.5,0.5) * Quaterniond(1.0,0.0,0.0,0.0))
    wp3 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.5,-0.5,0.5) * Quaterniond(1.0,0.0,0.0,0.0))
    instruction = MoveInstructionType_FREESPACE

    start_instruction = None
    plan_f1 = None
    start_instruction = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp1), instruction, "freespace_profile") 
    plan_f1 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp2), instruction, "freespace_profile")
    plan_f2 = MoveInstruction(CartesianWaypointPoly_wrap_CartesianWaypoint(wp3), instruction, "freespace_profile")

    program = CompositeInstruction("DEFAULT")
    program.setManipulatorInfo(manip)
    program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(start_instruction))
    program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(plan_f1))
    program.appendMoveInstruction(MoveInstructionPoly_wrap_MoveInstruction(plan_f2))
  
    plan_profile = OMPLDefaultPlanProfile()
    plan_profile.planners.clear()
    plan_profile.planners.append(RRTConnectConfigurator())


    profiles = ProfileDictionary()
    ProfileDictionary_addProfile_OMPLPlanProfile(profiles,OMPL_DEFAULT_NAMESPACE, "TEST_PROFILE", plan_profile)
    request = PlannerRequest()
    request.instructions = program
    request.env = env
    request.env_state = cur_state
    request.profiles = profiles
    

    ompl_planner = OMPLMotionPlanner(OMPL_DEFAULT_NAMESPACE)
    response=ompl_planner.solve(request)
    assert response.successful
    results_instruction = response.results


    # The OMPL program does not generate dense waypoints. This function will interpolate the results to generate
    # a dense set of waypoints.
    interpolated_results_instruction = generateInterpolatedProgram(results_instruction, cur_state, env, 3.14, 3.14, 3.14, 30)

    # Create the TrajOpt planner profile configurations. TrajOpt is used to optimize the random program generated
    # by OMPL
    from tesseract_robotics.tesseract_time_parameterization import TimeOptimalTrajectoryGeneration, InstructionsTrajectory, RuckigTrajectorySmoothing
    from tesseract_robotics.tesseract_motion_planners_trajopt import TrajOptDefaultPlanProfile, TrajOptDefaultCompositeProfile, \
    TrajOptProblemGeneratorFn, TrajOptMotionPlanner, ProfileDictionary_addProfile_TrajOptPlanProfile, \
    ProfileDictionary_addProfile_TrajOptCompositeProfile

    trajopt_plan_profile = TrajOptDefaultPlanProfile()
    trajopt_composite_profile = TrajOptDefaultCompositeProfile()

    trajopt_profiles = ProfileDictionary()
    ProfileDictionary_addProfile_TrajOptPlanProfile(trajopt_profiles, TRAJOPT_DEFAULT_NAMESPACE, "TEST_PROFILE", trajopt_plan_profile)
    ProfileDictionary_addProfile_TrajOptCompositeProfile(trajopt_profiles, TRAJOPT_DEFAULT_NAMESPACE, "TEST_PROFILE", trajopt_composite_profile)

    # Create the TrajOpt planner
    trajopt_planner = TrajOptMotionPlanner(TRAJOPT_DEFAULT_NAMESPACE)

    # Create the TrajOpt planning request and run the planner
    trajopt_request = PlannerRequest()
    trajopt_request.instructions = interpolated_results_instruction
    trajopt_request.env = env
    trajopt_request.env_state = cur_state
    trajopt_request.profiles = trajopt_profiles

    trajopt_response = trajopt_planner.solve(trajopt_request)
    assert trajopt_response.successful
        
    trajopt_results_instruction = trajopt_response.results
Info:    No planner specified. Using default.
Info:    LBKPIECE1: Attempting to use default projection.
Debug:   LBKPIECE1: Planner range detected to be 5.758648
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Debug:   RRTConnect: Planner range detected to be 5.758648
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Debug:   RRTConnect: Planner range detected to be 5.758648
Info:    RRTConnect: Starting planning with 64 states already in datastructure
Info:    RRTConnect: Starting planning with 64 states already in datastructure
Info:    RRTConnect: Created 67 states (65 start + 2 goal)
Debug:   ParallelPlan.solveOne: Solution found by RRTConnect in 0.301845 seconds
Info:    RRTConnect: Created 67 states (65 start + 2 goal)
Info:    ProblemDefinition: Adding approximate solution from planner RRTConnect
Debug:   ParallelPlan.solveOne: Solution found by RRTConnect in 0.364229 seconds
Info:    ParallelPlan::solve(): Solution found by one or more threads in 0.364570 seconds
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Info:    RRTConnect: Starting planning with 67 states already in datastructure
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Info:    RRTConnect: Starting planning with 67 states already in datastructure
Info:    RRTConnect: Created 81 states (72 start + 9 goal)
Debug:   ParallelPlan.solveOne: Solution found by RRTConnect in 3.793736 seconds
Info:    RRTConnect: Created 75 states (72 start + 3 goal)
Info:    ProblemDefinition: Adding approximate solution from planner RRTConnect
Debug:   ParallelPlan.solveOne: Solution found by RRTConnect in 3.802919 seconds
Info:    ParallelPlan::solve(): Solution found by one or more threads in 3.803152 seconds
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Info:    RRTConnect: Starting planning with 81 states already in datastructure
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Info:    RRTConnect: Starting planning with 75 states already in datastructure
Info:    RRTConnect: Created 75 states (72 start + 3 goal)
Info:    RRTConnect: Created 86 states (75 start + 11 goal)
Info:    ProblemDefinition: Adding approximate solution from planner RRTConnect
Debug:   ParallelPlan.solveOne: Solution found by RRTConnect in 0.876887 seconds
Info:    ParallelPlan::solve(): Solution found by one or more threads in 0.877205 seconds
Info:    SimpleSetup: Path simplification took 0.978598 seconds and changed from 3 to 2 states
Info:    No planner specified. Using default.
Info:    LBKPIECE1: Attempting to use default projection.
Debug:   LBKPIECE1: Planner range detected to be 5.758648
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Debug:   RRTConnect: Planner range detected to be 5.758648
Debug:   ParallelPlan.solveOne starting planner RRTConnect
Debug:   RRTConnect: Planner range detected to be 5.758648
terminate called after throwing an instance of 'ompl::Exception'
  what():  RRTConnect: No start states specified


I would be grateful for any kind of help.

Best regards,
Kai

Rename root package from "tesseract" to "tesseract_robotics"

There is another project out there named "tesseract" that has taken the root namespace tesseract on PyPI and other package managers. Currently all of the modules in Python for tesseract robotics have names like tesseract.tesseract_common, tesseract.tesseract_geometry, etc. Renaming to something tesseract_robotics.tesseract_common and tesseract_robotics.tesseract_geometry would help get around this issue.

@Levi-Armstrong @mpowelson any thoughts?

Failed to instantiate plugin 'ProcessPlanningInputTaskFactory'

I've installed tesseract_python using the instructions in the readme. I am using Ubuntu 20.04 (via WSL2 on Windows 11).

Once I start the listed example tesseract_planning_example_composer I received the following error:

You can set logging level with TRAJOPT_LOG_THRESH. Valid values: FATAL ERROR WARN INFO DEBUG TRACE. Defaulting to ERROR
Error:   Failed to instantiate plugin 'ProcessPlanningInputTaskFactory', Details:
Search Paths (Search System Folders: True):
    - /__w/tesseract_python/tesseract_python/ws/install/lib
    - /usr/local/lib
Search Libraries:
    - libtesseract_task_composer_factories.so
    - libtesseract_task_composer_planning_factories.so
    - libtesseract_task_composer_taskflow_factories.so

         at line 161 in /__w/tesseract_python/tesseract_python/ws/install/include/tesseract_common/plugin_loader.hpp
Warning: Failed to load symbol 'ProcessPlanningInputTaskFactory'
         at line 273 in /__w/tesseract_python/tesseract_python/ws/src/tesseract_planning/tesseract_task_composer/core/src/task_composer_plugin_factory.cpp
Warning: Failed to load symbol 'PipelineTaskFactory', Details: Task Composer Graph 'FreespacePipeline' failed to create node 'ProcessInputTask'
         at line 281 in /__w/tesseract_python/tesseract_python/ws/src/tesseract_planning/tesseract_task_composer/core/src/task_composer_plugin_factory.cpp
Segmentation fault

The other examples seem to run fine. Both tesseract_collision_example, and tesseract_kinematics_example run without errors and provide output to the terminal. tesseract_planning_example_no_composer also runs as expected and provides output to the terminal. Furthermore, on localhost:8000 this example also produces a visual of a robot moving along a trajectory.

Did I miss any installation instructions or am I doing something wrong?

TesseractViewer cannot display the screen

env:
pyhton 3.8(conda)
tesseract-robotics 0.2.0
viewer:0.2.5
win11

Problem description:
It connects fine, but the display is blank

successfully installed the library through the following command

python -m pip install tesseract-robotics tesseract-robotics-viewer

The test code is as follows:

from tesseract_robotics.tesseract_environment import Environment
from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource
import os
import re
import traceback
from tesseract_robotics_viewer import TesseractViewer
import numpy as np
import time
import sys

shapes_urdf = """
<robot name="multipleshapes">

  <link name="world"/>
  <link name="cylinder_link">
    <visual>
      <geometry>
        <cylinder length="0.6" radius="0.2"/>
      </geometry>
      <material name="red">
        <color rgba="0.8 0 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="clyinder_joint" type="revolute">
    <parent link="world"/>
    <child link="cylinder_link"/>
    <axis xyz="0 1 0"/>
    <limit effort="0" lower="-2.0944" upper="2.0944" velocity="6.2832"/>
  </joint>

  <link name="box_link">
    <visual>
      <geometry>
        <box size="0.6 0.1 0.2"/>
      </geometry>
      <material name="green">
        <color rgba="0 0.8 0 1"/>
      </material>
    </visual>
  </link>

  <joint name="box_joint" type="revolute">
    <parent link="world"/>
    <child link="box_link"/>
    <origin xyz="1 0 0"/>
    <axis xyz="0 1 0"/>
    <limit effort="0" lower="-2.0944" upper="2.0944" velocity="6.2832"/>
  </joint>

  <link name="sphere_link">
    <visual>
      <geometry>
        <sphere radius="0.5"/>
      </geometry>
      <material name="blue">
        <color rgba="0 0 0.8 1"/>
      </material>
    </visual>
  </link>

  <joint name="sphere_joint" type="revolute">
    <parent link="world"/>
    <child link="sphere_link"/>
    <origin xyz="2 0 0"/>
    <axis xyz="0 1 0"/>
    <limit effort="0" lower="-2.0944" upper="2.0944" velocity="6.2832"/>
  </joint>

</robot>
"""

TESSERACT_SUPPORT_DIR = os.environ["TESSERACT_SUPPORT_DIR"]


class TesseractSupportResourceLocator(ResourceLocator):
    def __init__(self):
        super().__init__()

    def locateResource(self, url):
        try:
            try:
                if os.path.exists(url):
                    return SimpleLocatedResource(url, url, self)
            except:
                pass
            url_match = re.match(r"^package:\/\/tesseract_support\/(.*)$", url)
            if (url_match is None):
                print("url_match failed")
                return None
            if not "TESSERACT_SUPPORT_DIR" in os.environ:
                return None
            tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"]
            filename = os.path.join(tesseract_support, os.path.normpath(url_match.group(1)))
            ret = SimpleLocatedResource(url, filename, self)
            return ret
        except:
            traceback.print_exc()


t_env = Environment()

# locator must be kept alive by maintaining a reference
locator = TesseractSupportResourceLocator()
t_env.init(shapes_urdf, locator)

viewer = TesseractViewer()

viewer.update_environment(t_env, [0, 0, 0])

viewer.start_serve_background()


if sys.version_info[0] < 3:
    raw_input("press enter")
else:
    input("press enter")

Saved scenes cannot be updated after updating joint variables

viewer.update_joint_positions()
viewer.save_scene_gltf()

After using the first line of code to update the joint variables, the viewer display has changed. Using the second line of code to save the scene, the scene obtained is always the initial scene, how to save the updated scene?

Segmentation fault when using setState on empty Environment

When I used the setState method of a newly constructed Environment I encountered a segmentation fault.

I am running Ubuntu 20.04 via WSL2 on Windows 11.

To reproduce the segmentation fault on my system:

import numpy as np
from tesseract_robotics.tesseract_environment import Environment

joint_names = ["joint_a1", "joint_a2", "joint_a3", "joint_a4", "joint_a5", "joint_a6"]
joint_position = np.array([-0.4, 0.2762, 0.0, -1.3348, 0.0, 1.4959, 0.0])

env = Environment()
env.setState(joint_names, joint_position)

Terminal output:

Segmentation fault

I understand that it does not make much sense to try to set the state of an empty environment, but I encountered this issue trying to recreate one of the C++ examples. Not having any meaningful error message in Python makes it hard to debug.

Updating to support Node JS

@johnwason I am not familiar with SWIG, but noticed that it supports converting to Node JS. I am interested to hear your thoughts on what it might take to updated this to support Node JS?

Numpy array not accepted as a Vector3d when dtype is not float64

The conversion from NumPy Arrays to Eigen::Vector3d seems to be a little too strict on the dtype of the array.

I am running Ubuntu 20.04 via WSL2 on Windows 11.

The following code is valid:

x = Isometry3d.Identity()
x.setTranslation(np.array([1., 0., 0.]))

while the following code produces an error:

x = Isometry3d.Identity()
x.setTranslation(np.array([1, 0, 0]))
ValueError                                Traceback (most recent call last)
      [1] x = Isometry3d.Identity()
----> [2] x.setTranslation(np.array([1, 0, 0]))

File [~/.local/lib/python3.8/site-packages/tesseract_robotics/tesseract_common/tesseract_common_python.py:2654], in Isometry3d.setTranslation(self, translation)
   2647 def setTranslation(self, translation):
   2648     r"""
   2649     Set the translation vector of this Isometry3d
   2650 
   2651     :type translation: Eigen::Vector3d
   2652     :param translation: Translation vector
   2653     """
-> 2654     return _tesseract_common_python.Isometry3d_setTranslation(self, translation)

ValueError: Type mismatch between NumPy and Eigen objects: got code 7, expected 12

This also applies to other functions that accept a Vector3d as I also encountered it for the Isometry.translate() function. Other dtypes also do not work, e.g. np.float32.

robot does not move smoothly in Tesseract viewer

@johnwason hello,when I change the joints of the robot arm, I find that the browser shows that the robot does not move smoothly and seems to have a delay.the code is as follows:

while 1 :
 t_env.setState(joint_names,joint)
 viewer.update_joint_positions(joint_names,joint)

but when I run the example in the readme, the robot can move smoothly,the code is as follows:

from tesseract_robotics.tesseract_common import FilesystemPath, Isometry3d, Translation3d, Quaterniond, \
    ManipulatorInfo
from tesseract_robotics.tesseract_environment import Environment
from tesseract_robotics.tesseract_common import ResourceLocator, SimpleLocatedResource
from tesseract_robotics.tesseract_command_language import CartesianWaypoint, Waypoint, \
    MoveInstructionType_FREESPACE, MoveInstructionType_START, MoveInstruction, Instruction, \
    CompositeInstruction, flatten
from tesseract_robotics.tesseract_process_managers import ProcessPlanningServer, ProcessPlanningRequest, \
    FREESPACE_PLANNER_NAME
import os
import re
import traceback
from tesseract_robotics_viewer import TesseractViewer
import numpy as np
import time
import sys

TESSERACT_SUPPORT_DIR = os.environ["TESSERACT_SUPPORT_DIR"]

class TesseractSupportResourceLocator(ResourceLocator):
    def __init__(self):
        super().__init__()
    
    def locateResource(self, url):
        try:
            try:
                if os.path.exists(url):
                    return SimpleLocatedResource(url, url, self)
            except:
                pass
            url_match = re.match(r"^package:\/\/tesseract_support\/(.*)$",url)
            if (url_match is None):
                print("url_match failed")
                return None
            if not "TESSERACT_SUPPORT_DIR" in os.environ:
                return None
            tesseract_support = os.environ["TESSERACT_SUPPORT_DIR"]
            filename = os.path.join(tesseract_support, os.path.normpath(url_match.group(1)))
            ret = SimpleLocatedResource(url, filename, self)
            return ret
        except:
            traceback.print_exc()

abb_irb2400_urdf_fname = FilesystemPath(os.path.join(TESSERACT_SUPPORT_DIR,"urdf","abb_irb2400.urdf"))
abb_irb2400_srdf_fname = FilesystemPath(os.path.join(TESSERACT_SUPPORT_DIR,"urdf","abb_irb2400.srdf"))

t_env = Environment()

# locator_fn must be kept alive by maintaining a reference
locator = TesseractSupportResourceLocator()
t_env.init(abb_irb2400_urdf_fname, abb_irb2400_srdf_fname, locator)

manip_info = ManipulatorInfo()
manip_info.tcp_frame = "tool0"
manip_info.manipulator = "manipulator"
manip_info.working_frame = "base_link"

viewer = TesseractViewer()

viewer.update_environment(t_env, [0,0,0])

joint_names = ["joint_%d" % (i+1) for i in range(6)]
viewer.update_joint_positions(joint_names, np.array([1,-.2,.01,.3,-.5,1]))

viewer.start_serve_background()

t_env.setState(joint_names, np.ones(6)*0.1)

wp1 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.8,-0.3,1.455) * Quaterniond(0.70710678,0,0.70710678,0))
wp2 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.8,0.3,1.455) * Quaterniond(0.70710678,0,0.70710678,0))
wp3 = CartesianWaypoint(Isometry3d.Identity() * Translation3d(0.8,0.3,1) * Quaterniond(0.70710678,0,0.70710678,0))

start_instruction = MoveInstruction(Waypoint(wp1), MoveInstructionType_START, "DEFAULT")
plan_f1 = MoveInstruction(Waypoint(wp2), MoveInstructionType_FREESPACE, "DEFAULT")

program = CompositeInstruction("DEFAULT")
program.setStartInstruction(Instruction(start_instruction))
program.setManipulatorInfo(manip_info)
program.append(Instruction(plan_f1))

planning_server = ProcessPlanningServer(t_env, 1)
planning_server.loadDefaultProcessPlanners()
request = ProcessPlanningRequest()
request.name = FREESPACE_PLANNER_NAME
request.instructions = Instruction(program)

response = planning_server.run(request)
planning_server.waitForAll()

assert response.interface.isSuccessful()

results = flatten(response.problem.getResults().as_CompositeInstruction())

viewer.update_trajectory(results)

if sys.version_info[0] < 3:
    input("press enter")
else:
    input("press enter")

Are there parameters that affect the smoothness of the visualization in Tesseract viewer?

pip version mismatch

Hello,

I am a first time user of tesseract and stumbled over an error I cant fully explain.
Error message:

Traceback (most recent call last):
  File "/root/ws/devel/lib/tesseract_planning/planning_node.py", line 15, in <module>
    exec(compile(fh.read(), python_script, 'exec'), context)
  File "/root/ws/src/tesseract_planning/src/planning_node.py", line 23, in <module>
    from tesseract_robotics_viewer import TesseractViewer
  File "/root/.local/lib/python3.8/site-packages/tesseract_robotics_viewer/__init__.py", line 1, in <module>
    from .tesseract_viewer import *
  File "/root/.local/lib/python3.8/site-packages/tesseract_robotics_viewer/tesseract_viewer.py", line 21, in <module>
    from tesseract_robotics_viewer.tesseract_env_to_gltf import tesseract_env_to_gltf, tesseract_env_to_glb
  File "/root/.local/lib/python3.8/site-packages/tesseract_robotics_viewer/tesseract_env_to_gltf.py", line 28, in <module>
    from tesseract_robotics.tesseract_command_language import isStateWaypoint, isMoveInstruction
ImportError: cannot import name 'isStateWaypoint' from 'tesseract_robotics.tesseract_command_language' (/root/.local/lib/python3.8/site-packages/tesseract_robotics/tesseract_command_language/__init__.py)

I installed tesseract according to the installation instructions with following lines:

sudo apt install python3-pip python3-numpy
python3 -m pip install -U pip
python3 -m pip install --user  tesseract_robotics tesseract_robotics_viewer

After looking at the commit history of this repository I belief that there is a version mismatch with these two pip libraries.
In the latest release 0.2.2 the import line mentioned in the error message has been changed, but it is still in the file downloaded with the pip command. Since this release was made only "tesseract_robotics" has been updated on pip. I therefore belief, that the "tesseract_robotics_viewer" needs to be updated on pip.

As I am a first time user of tesseract I might have made some other mistake, which would make this report unnecessary, but I couldn't find another explanation for this error.

(In case it is relevant: This error occurred inside of a docker container running Ubuntu 20.04.)

I would appreciate any help or response, and thank you for developing this fantastic open source project.

Best regards,
Kai

ImportError: cannot import name 'generateInterpolatedProgram' from 'tesseract_robotics.tesseract_motion_planners_simple'

robot@DESKTOP-F7QOJTT:pytesseract$ export TESSERACT_RESOURCE_PATH=pwd/tesseract
robot@DESKTOP-F7QOJTT:pytesseract$ export TESSERACT_TASK_COMPOSER_CONFIG_FILE=pwd/tesseract_planning/tesseract_task_composer/config/task_composer_plugins_no_trajopt_ifopt.yaml
robot@DESKTOP-F7QOJTT:pytesseract$ python
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from tesseract_robotics.tesseract_motion_planners_simple import generateInterpolatedProgram
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'generateInterpolatedProgram' from 'tesseract_robotics.tesseract_motion_planners_simple' (/home/robot/.local/lib/python3.8/site-packages/tesseract_robotics/tesseract_motion_planners_simple/init.py)
from tesseract_robotics.tesseract_motion_planners import PlannerRequest, PlannerResponse
from tesseract_robotics.tesseract_motion_planners_ompl import OMPLDefaultPlanProfile, RRTConnectConfigurator,
... OMPLProblemGeneratorFn, OMPLMotionPlanner, ProfileDictionary_addProfile_OMPLPlanProfile

Unable To Move Prismatic Joint in Viewer

Hello,

I have found when attempting to move a prismatic joint on the viewer via TesseractViewer.update_joint_positions() or TesseractViewer.update_trajectory() the viewer will not move that joint. It will also will not move any revolute joints while told to move a prismatic joint.

I have noticed in the developer tools console I am getting the following error

Error: Unknown joint type
at app.js:273:27
at Array.forEach ()
at TesseractViewer.trajectoryToAnimation (app.js:239:21)
at TesseractViewer.setTrajectory (app.js:228:25)
at TesseractViewer.updateTrajectory (app.js:200:18)

After looking at the app.js I see in the trajectoryToAnimation function that it checks for joint type 2 for prismatic joints. However, when looking at the screen graph, as well as the .gltf file, I can see that the prismatic's joint type is 3.

Changing the switch statement in app.js to check for joint type 3 instead of 2 seems to resolve the issue.

I'm guessing this is a bug and have posted it here so you guys are aware.

Missing tesseract_command_language/core/serialization.h file when building Python interface

Moving issue from tesseract_planning repo to here: tesseract-robotics/tesseract_planning#206

Hi all,

When I try to build the Python interface, I get the following error:

tesseract_ws/src/tesseract_python/tesseract_python/swig/tesseract_command_language_python.i:98: Error: Unable to find 'tesseract_command_language/core/serialization.h'

It looks like serialization.cpp still exists in the src directory (https://github.com/tesseract-robotics/tesseract_planning/blob/master/tesseract_command_language/src/core/serialization.cpp) but is missing from the include directory as of tesseract-robotics/tesseract_planning@59cb076

Should this file be removed from the Python interface as well? https://github.com/tesseract-robotics/tesseract_python/blob/master/tesseract_python/swig/tesseract_command_language_python.i#L41

Thanks!

can't set a Descartes pose sampler on Profile

Hi,

First, what a formidable library, so stoked having access to tesseract from python!

I'd like to contribute by porting examples from tesseract-robotics/tesseract_planning/tree/master/tesseract_examples/src to python. Also its a nice way to find my way around ;)

I'm porting a Descartes tutorial from ROS-I training ,

from tesseract_robotics.tesseract_motion_planners_descartes import (
    cast_DescartesPlanProfileD,
    DescartesDefaultPlanProfileD,
    sampleToolZAxis,
    PoseSamplerFn,
)


def test_zaxis_descartes():
    """

    implement the ROS-I tutotial on descartes
    basically is akin to the `puzzle_piece_example.py`, but using the `descartes` lib over `trajopt`

    https://industrial-training-master.readthedocs.io/en/melodic/_source/session5/Advanced-Descartes-Path-Planning.html

    """
    plan_profile = DescartesDefaultPlanProfileD()
    # DescartesDefaultPlanProfileD is not upcasting automatically, use helper function
    plan_profile1 = cast_DescartesPlanProfileD(plan_profile)
    pp = PoseSamplerFn(sampleToolZAxis)
    plan_profile.target_pose_sampler = pp


#     plan_profile.target_pose_sampler = pp
#     Traceback (most recent call last):
#     File "C:\Program Files (x86)\JetBrains\PyCharm 2022.3.3\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec
#     exec(exp, global_vars, local_vars)
# File "<input>", line 1, in <module>
# File "C:\Users\jelle\miniconda3\envs\compas\lib\site-packages\tesseract_robotics\tesseract_motion_planners_descartes\tesseract_motion_planners_descartes_python.py", line 34, in set_instance_attr
# set(self, name, value)
# TypeError: in method 'DescartesDefaultPlanProfileD_target_pose_sampler_set', argument 2 of type 'tesseract_planning::PoseSamplerFn *'
# pp

Documentation Pages are Down

Hi all,

I'm super interested in this project! Especially the direct Python bindings. I'd like to try out the bindings (and hopefully contribute to them!) but I'm not sure how to get started. The documentation page is down.

What steps would you suggest to build and view the docs in order to get started with the Python bindings?

The viewer can not display the marker.

env:
win11
viewer: 0.2.5

I successfully displayed the robotic arm in the viewer and attempted to add line segments using the code below. However, after running the code, the line segments are not being displayed in the viewer.

viewer = TesseractViewer()
viewer.update_environment(t_env, [0, 0, -10])
viewer.start_serve_background() 
viewer.add_lines_marker([[0, 0, 0], [10, 10, 10]], color=[[220, 20, 60, 1]],update_now=True)

image

@johnwason
This problem has been bothering me for some time.Can you give me some suggestions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.