Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get_grasps.py with gpd_ros #26

Open
2000222 opened this issue Jun 8, 2022 · 4 comments
Open

Get_grasps.py with gpd_ros #26

2000222 opened this issue Jun 8, 2022 · 4 comments

Comments

@2000222
Copy link

2000222 commented Jun 8, 2022

Hello, on Ubuntu 18.04 ROS melodic I've successfully build "gpd_ros" and finish the GPD perception part. Then I'd like to get the cluttered grasps to execute motion planning for my robot with python. So followed by the tutorial in the "forward_version" gpd, I run the following get_grasps.py script:

import rospy
from gpd_ros.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/plot_grasps', GraspConfigList, callback)

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

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

However, I could not get any cluttered grasps. So could u pls help me 😢 and update new tutorials based on "gpd_ros" ? Thank u very much~

@2000222
Copy link
Author

2000222 commented Jun 8, 2022

Also after run "roslaunch gpd_ros ur5.launch" and "python get_grasps.py", we even find the following error in the terminal of "roslaunch gpd_ros ur5.launch" which has visualized the plotted grasps.

Found 19 clusters.
======== Selected grasps ========
Grasp 0: 654.025
Grasp 1: 342.477
Grasp 2: 256.556
Grasp 3: 250.038
Grasp 4: 240.67
Grasp 5: 65.842
Grasp 6: 11.6773
Grasp 7: -31.8433
Grasp 8: -46.0592
Grasp 9: -204.369
Grasp 10: -247.152
Grasp 11: -465.28
Grasp 12: -484.593
Grasp 13: -639.863
Grasp 14: -685.56
Grasp 15: -704.879
Grasp 16: -705.161
Grasp 17: -767.18
Grasp 18: -906.707
Selected the 19 best grasps.
======== RUNTIMES ========
 1. Candidate generation: 23.7171s
 2. Descriptor extraction: 22.8874s
 3. Classification: 38.4952s
==========
 TOTAL: 85.1642s
[ERROR] [1654656901.111600444]: Client [/get_grasps] wants topic /detect_grasps/plot_grasps to have datatype/md5sum [gpd_ros/GraspConfigList/b023d624ebdc1464392309d191c14641], but our version has [visualization_msgs/MarkerArray/d155b9ce5188fbaf89745847fd5882d7]. Dropping connection.

Hope to solve this problem 😭

@atenpas
Copy link
Owner

atenpas commented Oct 17, 2022

Apologies for the late reply.

The plot_grasps topic contains visualization marker messages which can be used to display the grasps in RViz. The grasps are found on the topic /detect_grasps/clustered_grasps (as a GraspConfigList.)

@gtatiya
Copy link

gtatiya commented Sep 27, 2023

I am also facing this issue. rostopic echo detect_grasps/clustered_grasps does not output anything. I can see the grasp poses when I launch this: roslaunch gpd_ros ur5.launch, how can I access those poses using python code? Please help

@gtatiya
Copy link

gtatiya commented Sep 28, 2023

I was able to fix this issue by doing following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants