ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

guodi's profile - activity

2021-07-21 06:48:00 -0500 received badge  Famous Question (source)
2018-01-26 08:25:13 -0500 received badge  Famous Question (source)
2017-01-18 01:31:08 -0500 received badge  Famous Question (source)
2017-01-06 18:41:54 -0500 received badge  Famous Question (source)
2017-01-06 18:41:54 -0500 received badge  Notable Question (source)
2017-01-06 18:41:54 -0500 received badge  Popular Question (source)
2016-08-05 13:51:36 -0500 received badge  Popular Question (source)
2016-08-05 13:51:36 -0500 received badge  Notable Question (source)
2016-05-23 05:09:08 -0500 received badge  Notable Question (source)
2016-05-08 15:59:14 -0500 received badge  Notable Question (source)
2016-05-08 15:59:14 -0500 received badge  Popular Question (source)
2016-05-08 15:34:29 -0500 marked best answer How to subsribe to a ROS topic for several seperate times?

I have a scanlist of 5 positions for the robot to go. And for each position, I hope to subscribe to a topic to get the sensor data and add a marker in the rviz. Here is my code:

def addMarkerCallback(msg):
    draw_functions = DrawFunctions('visualisation_marker')
    if msg.data:
        draw_functions.draw_rviz_sphere(0.02)
    else:
        print 'no data'
rospy.init_node("sensor_marker", anonymous = True)

for item in scanlist:    
    moveit_cmd.go(item, wait=True)
    sub1 = rospy.Subscriber('sensor/right', SensorData, addMarkerCallback)   
    rospy.spin()
    print 'go finished'

However when I run the code, the problem is the loop will always stay in the first iteration, so the robot will not go to the other positions in the scanlist. I guess it is the problem of rospy.spin(). Could anyone please tell me how to solve this problem...Thanks a lot!

2016-04-21 09:20:20 -0500 asked a question UR5 Kinect2 calibration problem

I have got a UR5 robotic arm and a Kinect2 which is placed in a fixed position. How could I get the transformation matrix between the arm base and the Kinect coordinates?

Thank you!

2016-04-13 03:47:14 -0500 received badge  Popular Question (source)
2016-04-09 03:57:27 -0500 commented answer Import UR5 urdf to Moveit!

Thanks for your reply! If so, is it possible that I could add a Barrett hand urdf file to the ur5 urdf file. Actually, I would like to connect the arm to a robotic hand.

2016-04-08 23:57:19 -0500 asked a question Import UR5 urdf to Moveit!

I am trying to import UR5 arm using the setupAssistant in moveit! When I load the ur5.urdf.xacro file, it says

URDF/COLLADA file is not a valid robot model.

The urdf file I used is from here. Does anyone know how to fix it? I use a 14.04 Ubuntu and ROS Indigo.

Thank you!

2016-03-21 22:25:35 -0500 asked a question kinect connect problem... No matching device found....

I installed the openni_launch package in hydro version and plugged in the Kinect. I did as what is said on the wiki (link text). However, when I input the roslaunch openni_launch openni.launch, I got the following problems. We have tried many times. Does anyone know what the problem is? Could you please kindly help us. Thank you!

[ INFO] [1458615947.941740063]: Number devices connected: 1
[ INFO] [1458615947.941947313]: 1. device on bus 003:13 is a SensorKinect (2ae) from PrimeSense (45e) with serial id 'A00362A01776150A'
[ INFO] [1458615947.942802259]: Searching for device with index = 1
[ INFO] [1458615947.946537349]: No matching device found.... waiting for devices. Reason: openni_wrapper::OpenNIDevice::OpenNIDevice(xn::Context&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&) @ /tmp/buildd/ros-hydro-openni-camera-1.9.2-0precise-20150515-0510/src/openni_device.cpp @ 61 : creating depth generator failed. Reason: Xiron OS failed to wait on event!
2015-02-17 19:11:30 -0500 commented answer couldn't rosrun new executable after changing the source code

That works. There is a copy of it in another package ... Thank you!

2015-02-17 18:10:52 -0500 commented answer couldn't rosrun new executable after changing the source code

I've checked the ROS_PACKAGE_PATH and ~/catkin_ws/src is in it. And when I roscd simple_head, it goes to the correct package. while I don't have a ~/catkin_ws/install folder....

2015-02-17 16:57:38 -0500 asked a question couldn't rosrun new executable after changing the source code

I am trying to sending head move command to pr2 robot, and in my CMakeLists.txt file, I have add_executable(point_head src/point_head.cpp), after catkin_make, I can use rosrun simple_head point_head to move the head of pr2.

Then I changed the head position in point_head.cpp and catkin_make again. But when I rosrun simple_head point_head again, the head of pr2 stills goes to the position unchanged. While when I manually run point_head in ~/catkin_ws/devel/lib/simple_head/, it goes to the new position correctly.

Is there anyone know why I couldn't run the new changed executable? Thanks a lot!

2014-12-29 10:56:25 -0500 received badge  Student (source)
2014-12-26 17:43:13 -0500 asked a question relax a subset of PR2 controllers

After bringing up a PR2 robot, the controllers are all fixed. I wonder is there a way that I can relax one arm and have other controllers still fixed. Anyone who knows how to do this? Thanks a lot!

2014-09-12 21:52:20 -0500 received badge  Enthusiast
2014-09-05 10:01:03 -0500 received badge  Famous Question (source)
2014-09-03 14:50:24 -0500 received badge  Scholar (source)
2014-09-02 16:38:40 -0500 received badge  Notable Question (source)
2014-09-02 02:16:11 -0500 received badge  Popular Question (source)
2014-09-01 16:04:38 -0500 asked a question Is there a way to find the definition of a class or function quickly in ROS?

In my project, there are several packages and some classes use inheritance... Is there a way to quickly find class and function instead of open all the related source files one by one in ROS?........... Thanks!

2014-08-29 01:41:25 -0500 received badge  Notable Question (source)
2014-08-28 12:31:20 -0500 commented answer Subscribe to a topic with flag

Yes, you are right. I just tried to simply the code to make it clearer, however it may be more confused. I am sorry for that...Here I modify the codes. Actually they are from two files....Could you please help me see if there are some problems now. Thank you !

2014-08-28 12:27:59 -0500 received badge  Editor (source)
2014-08-28 08:57:04 -0500 received badge  Popular Question (source)
2014-08-28 03:17:18 -0500 asked a question Subscribe to a topic with flag

I have a gripper embedded with a sensor in the finger. The sensor will tell if there is something between the gripper by True/False in 500 Hz. So I hope the gripper to go to successive positions to detect if there is something between the gripper, if there the sensor data is true, a marker is drawn in the rviz. I imitate some codes and modified as follows(I write it in a general way). While it seems scan_sub can't subscribe the data properly, I am confused with when the scan_sub begins to subscribe and when it is shut down. I have also write some notes in the following code which I am confused about.....Hope some one could kindly help me with that ...

import scan_execute
class PlanServer:
    def __init__(self):
        ......
    rospy.Service('scan_object', Empty, scan_object_callback)
    self.sc = scan_execute.ScanExecute()

    def scan_object_callback(self, req):
        result = False
        result = self.sc.pretouch_scan()

***the scan_execute file***
class ScanExecute:
    def __init__(self):
        ......
    def pretouch_scan(self):
        self.detected = False
        self.start_time = rospy.Time.now()
        self.scan_sub = rospy.Subcsriber("sensor/data", SensorData, sensor_callback)
        # what does this *while* mean for ....
        while not self.detected:
            rospy.sleep(0.5)
        return True

    def sensor_callback(msg):
        time_limit = rospy.Duration(10.0)
        time_past = rospy.Time.now() - self.start_time

        if time_past > time_limit:
            self.detected = True  # when *detected* is True, will the *scan_object_callback* return True?
            self.count = 0
            self.scan_sub.unregister()
        else:
            self.count += 1

        # I hope the gripper of robot will go to the successively position for 5 times.
        # and when it detect the sensor data, a marker is drawn in rviz
            self.current_mat = self.current_mat * self.step_mat
            self.moveit_cmd.go(current_mat, wait = True)
            if msg.data
                self.detected = True
                self.draw_marker()
                if self.count > 5:
                    self.detected = True
2014-08-27 00:07:47 -0500 received badge  Famous Question (source)
2014-08-26 23:57:28 -0500 commented answer How to subsribe to a ROS topic for several seperate times?

I've tried..but still if there is no rospy.spin(), the node doesn't subscribe to the topic ......

2014-08-26 23:55:37 -0500 commented answer How to subsribe to a ROS topic for several seperate times?

Thanks a lot! Actually I am trying to let the robot gripper pass the five positions in the scanlist successively. And the sensor embedded in the finger are giving sensor data continuously in 500Hz. I would like to check the sensor data in each position and draw a marker in the rviz...so do you know how to do that then....Thank you!

2014-08-26 12:52:09 -0500 commented answer How to subsribe to a ROS topic for several seperate times?

I've tried your method, I do like this:

def addMarkerCallback(msg):
    ...
    sub1.unregister()
global sub1
for item in scanlist:
    sub1 = ...  
    rospy.spin()
    print 'go finished'

However it never goes to the 'print' and other items in scan list...

2014-08-26 12:06:54 -0500 received badge  Notable Question (source)
2014-08-26 00:46:33 -0500 commented answer How to subsribe to a ROS topic for several seperate times?

Thanks! It may not work... I just add a separate node to subscribe to that topic. It works then:)

2014-08-26 00:44:18 -0500 received badge  Popular Question (source)
2014-04-20 13:42:29 -0500 marked best answer difficulty to create a sandbox directory for new packages

all former setting has been done. after 'rosws set ~/fuerte_workspace/sandbox' it comes to 'rosws: error: No scm or localname provided' I do not know why need your kind help.....