机器人 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()