I’m working on simulating a very basic pick-and-place application using a python extension and a robot that I’ve rigged from a .stp file and for which I’ve developed my own kinematics functions to determine the joint values. The process should simply involve moving the robot to an object, closing the surface gripper, relocating to a different position, and then opening the gripper. While moving to a single position and closing the gripper with a button works as expected, attempting to execute multiple positions sequentially results in the robot bypassing intermediate points and directly moving to the last position. Is there a straightforward method to ensure that each articulation.apply_pose() operation is fully completed before initiating the next move? I’ve tried to figure it out on my own using BaseTask and asyncio, but I can’t seem to get it right.
I would check against the current pose as the robot has to move to its target pose which you know as you have defined it in your inverse kinematics solver. so make the current position check against the target position once true,
async def execute(self):
for pose in self.poses:
self.articulation.apply_pose(pose)
await self.wait_until_pose_reached(pose)
async def wait_until_pose_reached(self, target_pose, tolerance=0.01):
# Loop until the current pose matches the target pose within the given tolerance
while not self.pose_reached(target_pose, tolerance):
await asyncio.sleep(0.1) # Check every 100ms
this is just GPT fluff but you get the picture. just match the target postion then do the next articulation in the sequence