jvdtoorn / techmanpy

Python communication driver for Techman robots
MIT License
12 stars 2 forks source link

Error listner #6

Open Spider1097 opened 1 year ago

Spider1097 commented 1 year ago

When i run listner:

!/usr/bin/env python

import asyncio import techmanpy from std_msgs.msg import Int32MultiArray import rospy from geometry_msgs.msg import PoseStamped import numpy as np import signal import time

class ArmControl: def init(self): self.marker_pose=None self.move_axis_vec=[0, 0, 0, 0, 0, 0] self.step_m=400 self.step_r=10 self.marker_approached_rot=True self.marker_approached_pose_xy=True self.marker_approached_dist=True self.reseted=False

    self.turn_motors=[0, 0, 0, 0, 0, 0]
    self.selected_motor = 0
    self.actual_position = [0, 0, 0, 0, 0, 0]

    self.zgoda = 1
    self.ip = "192.168.10.2" #ip do połączenia z manipulatorem
    self.mode = 0

async def move_to_point(move_axis_vec): async with techmanpy.connect_sct(robot_ip=ac.ip) as conn: conn.add_broadcast_callback(print)

await conn.stop_motion()

    await conn.move_to_joint_angles_ptp(move_axis_vec, 0.5, 10)#
    await conn.set_queue_tag(1)
    tag_status=1

async def listen(): async with techmanpy.connect_svr(robot_ip=ac.ip) as conns: conns.add_broadcast_callback(print) await keep_alive()

ac=ArmControl() czas = 5

while(1): asyncio.run(move_to_point([135,-32,69,-37,94,-15])) time.sleep(czas) asyncio.run(move_to_point([150, -32, 69, -37, 94, -15])) time.sleep(czas) asyncio.run(listen()) time.sleep(czas)


i got that issue:

Traceback (most recent call last): File "listner.py", line 54, in asyncio.run(listen()) File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete return future.result() File "listner.py", line 42, in listen async with techmanpy.connect_svr(robot_ip=ac.ip) as conns: File "/home/raptors/.local/lib/python3.8/site-packages/techmanpy/clients/techman_client.py", line 24, in aenter except asyncio.TimeoutError: raise TMConnectError(None, msg=f'Opening connection timed out after {self._conn_timeout} seconds') from None techmanpy.exceptions.TMConnectError: TMConnectError: Opening connection timed out after 3 seconds

What can be wrong, i trying solve this problem 5 days?