修改物料放下时的方法,如果选择

修改物料放下时的方法,
如果选择drop_trash,则删除物料显示
如果选择drop,则让其解除连接
This commit is contained in:
zhangshixiang
2025-05-20 19:08:22 +08:00
parent aa85a1f3a2
commit 554766924e
2 changed files with 18 additions and 13 deletions

View File

@@ -165,9 +165,6 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode):
goal_handle.abort()
result.success = False
print('='*20)
print(result)
print('='*20)
return result
def inverse_kinematics(self, x, y, z,
parent_id,
@@ -251,6 +248,9 @@ class LiquidHandlerJointPublisher(BaseROS2DeviceNode):
link_name = f'{parent_id}_{link_name}'
self.resource_move(resource_name_, link_name, [0,1,2,3,4,5,6,7])
time.sleep(1)
elif option == "drop_trash":
self.resource_move(resource_name_, "__trash", [0,1,2,3,4,5,6,7])
time.sleep(1)
elif option == "drop":
self.resource_move(resource_name_, "world", [0,1,2,3,4,5,6,7])
time.sleep(1)
@@ -345,7 +345,7 @@ class JointStatePublisher(Node):
try:
# 创建新的executor
executor = rclpy.executors.SingleThreadedExecutor()
executor = rclpy.executors.MultiThreadedExecutor()
executor.add_node(self)
# 发送目标