机器人 Grasp Pose Detection (GPD) 更改 get_grasps.py问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/flyfish1986/article/details/86020923

机器人 Grasp Pose Detection (GPD) 更改 get_grasps.py问题

flyfish

更该源文件,使其可运行

import rospy
#from grasp_candidates_classifier.msg import GraspConfigList
from gpd.msg import GraspConfigList

grasps = []

def callback(msg):
    global grasps
    grasps = msg.grasps


# Create a ROS node.
rospy.init_node('get_grasps')

# Subscribe to the ROS topic that contains the grasps.
sub = rospy.Subscriber('/detect_grasps/clustered_grasps', GraspConfigList, callback)

# Wait for grasps to arrive.
rate = rospy.Rate(1)

while not rospy.is_shutdown():    
    if len(grasps) > 0:
        rospy.loginfo('Received %d grasps.', len(grasps))
        break
    rate.sleep()

猜你喜欢

转载自blog.csdn.net/flyfish1986/article/details/86020923
今日推荐