Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Python API inconsistent behavior MoveL MoveC

#1
Hi All,

When adding movement instructions to a program using the python API

program.MoveL(mat) where mat is of type robodk.robomath.Mat works

however

program.MoveC(mat1, mat2)

results in:  File "C:\RoboDK\Python-Embedded\lib\site-packages\robodk\robolink.py", line 6021, in MoveC
    raise Exception("Adding a movement instruction to a program given joints or a pose is not supported. Use a target item instead, for example, add a target as with RDK.AddTarget(...) and set the pose or joints.")
Exception: Adding a movement instruction to a program given joints or a pose is not supported. Use a target item instead, for example, add a target as with RDK.AddTarget(...) and set the pose or joints.

Ideally I would like to able to add circular movement instructions without having to create a target beforehand as this slows down the program generation when dealing with large programs. Is there a reason that the behaviour of MoveL is different than MoveC
#2
The latest version of RoboDK supports doing circular movements using joints and poses via the API.

Are you using the latest version of RoboDK? You can download it here:
https://robodk.com/download
#3
Hi Albert,

Thank you for your reply. I am using 5.6.9. As far I can tell the python API does not have 5.7 release yet.
I will test again once it is available.
What surprised me was that it works for MoveL but not for MoveC, which is why I called it inconsistent behaviour.
#4
I was referring to the latest version of RoboDK, not the Python API.

The Python API side should already support MoveC with any type of target, pose or joints.
#5
Hi Albert,
I am using RoboDK 5.7
Using the python API adding a linear motion with a pose works however with a circular motion it does not.
See robolink function below, as the type is Mat the error is raised.


    def MoveC(self, target1: Union['Item', List[float], robomath.Mat], target2: Union['Item', List[float], robomath.Mat], blocking: bool = True):
        """Move a robot to a specific target ("Move Circular" mode). By default, this procedure waits (blocks) until the robot finishes the movement.

        :param target1: pose along the cicle movement
        :type target1: :class:`~robodk.robomath.Mat`, list of joints or :class:`.Item`
        :param target2: final circle target
        :type target2: :class:`~robodk.robomath.Mat`, list of joints or :class:`.Item`
        :param blocking: True if the instruction should wait until the robot finished the movement (default=True)
        :type blocking: bool

        .. seealso:: :func:`~robodk.robolink.Item.MoveL`, :func:`~robodk.robolink.Item.MoveC`, :func:`~robodk.robolink.Item.SearchL`, :func:`~robodk.robolink.Robolink.AddTarget`
        """
        if self.type == ITEM_TYPE_PROGRAM:
            if type(target1) != Item or type(target2) != Item:
                raise Exception("Adding a movement instruction to a program given joints or a pose is not supported. Use a target item instead, for example, add a target as with RDK.AddTarget(...) and set the pose or joints.")
            self.addMoveC(target1, target2)

        else:
            self.link.MoveC(target1, target2, self, blocking)
#6
OK I didn't realize you were referring to program items instead of robot items. This is currently not supported.

I'm moving this thread to the request new features section.
  




Users browsing this thread:
1 Guest(s)