NiryoRobotics / ned_ros

Ned ros stack
https://niryo.com
GNU General Public License v3.0
31 stars 16 forks source link

vision_pick: "Lookup would require extrapolation at time..." when TCP enabled #17

Closed ralfgerlich closed 8 months ago

ralfgerlich commented 1 year ago

Ned_ROS Version:

I came across this problem while trying out the Vision examples for PyNiryo, but traced it down to poses_handler_node.py in niryo_robot_poses_handlers, thus I am filing this here instead of over at the pyniryo project.

The code I used was taken from the "First Condition" example , but adding an "enable_tcp" call after "update_tool" (test_vision.py). This results in the following output:

Connected to server (10.10.10.10) on port: 40001

Traceback (most recent call last):
  File "c:\Users\Ralf Gerlich\Documents\robotik\visionset\test_vision.py", line 40, in <module>
    obj_found, shape, color = robot.vision_pick(workspace_name)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ralf Gerlich\Documents\robotik\visionset\.venv\Lib\site-packages\pyniryo\api\tcp_client.py", line 1479, in vision_pick
    return self.__move_with_vision(Command.VISION_PICK, workspace_name, height_offset, shape, color)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ralf Gerlich\Documents\robotik\visionset\.venv\Lib\site-packages\pyniryo\api\tcp_client.py", line 1437, in __move_with_vision   
    data_array = self.__send_n_receive(command, workspace_name, height_offset, shape, color)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ralf Gerlich\Documents\robotik\visionset\.venv\Lib\site-packages\pyniryo\api\tcp_client.py", line 152, in __send_n_receive      
    return self.__receive_answer(with_payload=with_payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Ralf Gerlich\Documents\robotik\visionset\.venv\Lib\site-packages\pyniryo\api\tcp_client.py", line 138, in __receive_answer      
    raise NiryoRobotException("Command KO : {}".format(received_dict["message"]))
pyniryo.api.exceptions.NiryoRobotException: Command KO : An error occured while executing the last command : Error Code : -303
Message : Lookup would require extrapolation at time 1675425382.461638212, but only time 1675425382.461936712 is in the buffe, when looking up transform from frame [pick_target] to frame [base_link]

When I remove the enable_tcp call, the error disappears. This seems to be an actual bug to me, as obviously the code is intended to support the case where the TCP is enabled.

jmottier-niryo commented 12 months ago

Hi, thank you for reporting the bug. It has been added to our list of known bugs, and we'll be working on fixing it.