jvdtoorn / techmanpy

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

Getting Current Positions of Robot during and after the movement #4

Closed NipunGoel1999 closed 1 year ago

NipunGoel1999 commented 1 year ago

Hi, can you help in providing some guidance on how I can call the robots current position while in motion and once after the motion in completed.

Secondly can you also provide insights on how we can cancel a motion while it is in progress and resume from a safe position.

Your help is appreciated.

jvdtoorn commented 1 year ago

Hi Nipun! I expect that you can listen for the robots' current position through the TMFlow server:

#!/usr/bin/env python

import asyncio
import techmanpy

async def listen():
   async with techmanpy.connect_svr(robot_ip='<robot IP address>') as conn:
      conn.add_broadcast_callback(print)
      await conn.keep_alive()

asyncio.run(listen())

If I remember correctly, once you send a command to move, the function call will block until the movement has finished. So you can just listen to this TMFlow server as soon as the function returns. Lastly, in order to cancel an ongoing motion you can use the stop_motion function in tmsct_client.py.

NipunGoel1999 commented 1 year ago

Thanks so much for your response helps a lot, Btw is there a way to remove robot from alert mode/warning mode if it goes into one using python,?

I have to press play manually on the stick again and again to restart robot if it is warning/Alert.

jvdtoorn commented 1 year ago

Not sure about that. It’s been over a year since I last interacted with a Techman robot myself, and I also don’t have access to one anymore. Hope you can figure out a way; I recommend to have a close read through their technical documentation.

NipunGoel1999 commented 1 year ago

Thanks for you help