ra-mtp-ntnu / moto

A Python library for controlling Yaskawa MOTOMAN robots.
https://github.com/tingelst/moto
Apache License 2.0
36 stars 10 forks source link

TimeoutError #16

Open waillyam23 opened 2 years ago

waillyam23 commented 2 years ago

Hello,

I am currently working on a hc10 from Yaskawa and was interested by your library to read and write on the ports of the robot in python. I am not a socket specialist and went through this error which I can't find how to resolve:

➜  scripts git:(main) ✗ python3 test_moto.py       
Traceback (most recent call last):
  File "moto_controll.py", line 7, in <module>
    m = Moto(
  File "/home/aip/.local/lib/python3.8/site-packages/moto/__init__.py", line 155, in __init__
    self._state_connection.start()
  File "/home/aip/.local/lib/python3.8/site-packages/moto/state_connection.py", line 76, in start
    raise TimeoutError(
TimeoutError: Did not receive at least one of each message before timeout occured. Try increasing the timeout period. Timeout currently set to 5.0

I already tried to increase the timeout, and checked if the ports (like TCP_PORT_STATE = 50241) were the good ones. To do this I checked the ports used by a working MoveIt application on this robot. The controller is yrc1000, and the ip adress has been changed.

Please let me know if you have an idea,

Sincerely

gavanderhoorn commented 2 years ago

Off-topic, but:

I am currently working on a hc10 from Yaskawa and was interested by your library to read and write on the ports of the robot in python.

do the ROS services offered by motoman_driver's io_relay not work for you?

You don't need to run the full driver to be able to use those services. Just io_relay should be enough.

waillyam23 commented 2 years ago

The io_relay node from motoman is working. It connects well to the server when i do roslaunch motoman_driver io_relay.launch robot-ip:=192.168.1.40 use_bswap:=false and I am able to get the values of the registers with the service read_mregister.

As for the c++ part, I have seen there is some interesting functions to read and write in the registers. @gavanderhoorn do you have examples or documentation on the functions in io_relay ?

Thank you for you off-topic comment, I would have missed this option otherwise ^^

gavanderhoorn commented 2 years ago

For questions regarding motoman_driver, I would suggest to post in the Discussion forum.

It wouldn't be nice to Lars and the rest of @ra-mtp-ntnu to discuss something which they do not host here.

waillyam23 commented 2 years ago

Indeed

tingelst commented 2 years ago

Were you able to connect in the end, @waillyam23?

waillyam23 commented 2 years ago

Not through your library, but we found other solutions trough motoman. I am not working anymore on this robot, but thank you for your concern :)