示例#1
0
def main():

    # rospy gets first crack at sys.argv
    rospy.myargv(argv=sys.argv)
    (options,args) = getopt.getopt(sys.argv[1:], 'v:f:s:t:', ['vm=','feedback=','source=','target='])

    rospy.init_node('pr2_driver')

    source_frameid = rospy.get_param("/r_cart/root_name","torso_lift_link")
    target_frameid = rospy.get_param("/r_cart/tip_name","r_gripper_tool_frame")
    vm = rospy.get_param("/pr2_driver/velocity_multiplier", 10.0)
    feedback = rospy.get_param("/pr2_driver/feedback", 'hard')

    for o,a in options:
        if o in ('-v','--vm'):
            vm = float(a)
        elif o in ('-f','--feedback'):
            assert a in ('none','hard','adaptive')
            feedback = a
        elif o in ('-s','--source'):
            source_frameid = a
        elif o in ('-t','--target'):
            target_frameid = a

    driver = PR2Driver("pr2_driver", vm, feedback, 100, source_frameid, target_frameid, False) # start node
    driver.spin()
示例#2
0
def main():

    # rospy gets first crack at sys.argv
    rospy.myargv(argv=sys.argv)
    (options, args) = getopt.getopt(sys.argv[1:], "v:f:", ["vm=", "feedback="])

    rospy.init_node("omnirob_driver")

    vm = rospy.get_param("/omnirob_driver/velocity_multiplier", 1.0)
    feedback = rospy.get_param("/omnirob_driver/feedback", "none")

    for o, a in options:
        if o in ("-v", "--vm"):
            vm = float(a)
        elif o in ("-f", "--feedback"):
            assert a in ("none", "hard", "adaptive")
            feedback = a

    driver = OmnirobDriver("omnirob_driver", vm, feedback, 500)  # start node
    driver.spin()
示例#3
0
def main():

    # rospy gets first crack at sys.argv
    rospy.myargv(argv=sys.argv)
    (options,args) = getopt.getopt(sys.argv[1:], 'v:f:', ['vm=','feedback='])

    rospy.init_node('wam_driver')

    vm = rospy.get_param("/wam_driver/velocity_multiplier", 1.0)
    feedback = rospy.get_param("/wam_driver/feedback", 'none')

    for o,a in options:
        if o in ('-v','--vm'):
            vm = float(a)
        elif o in ('-f','--feedback'):
            assert a in ('none','hard','adaptive')
            feedback = a

    driver = WAMDriver('wam_driver', vm, feedback, 500) # start node
    driver.spin()
示例#4
0
def main():

    # rospy gets first crack at sys.argv
    rospy.myargv(argv=sys.argv)
    (options,args) = getopt.getopt(sys.argv[1:], 'v:f:s:t:a:', ['vm=','feedback=','source=','target=','athresh='])

    rospy.init_node('pr2_driver')

    rsource_frameid = rospy.get_param("/r_cart/root_name","torso_lift_link")
    rtarget_frameid = rospy.get_param("/r_cart/tip_name","r_gripper_tool_frame")
    lsource_frameid = rospy.get_param("/l_cart/root_name","torso_lift_link")
    ltarget_frameid = rospy.get_param("/l_cart/tip_name","l_gripper_tool_frame")
    #both left and right hands must be in the same reference frame
    assert lsource_frameid == rsource_frameid
    
    vm = rospy.get_param("/pr2_driver/velocity_multiplier", 1)
    feedback = rospy.get_param("/pr2_driver/feedback", 'adaptive')
    msfid=""
    mtfid=""
    adaptive_threshold=0.1

    for o,a in options:
        if o in ('-v','--vm'):
            vm = float(a)
        elif o in ('-f','--feedback'):
            assert a in ('none','hard','adaptive')
            feedback = a
        elif o in ('-s','--source'):
            msfid = a
        elif o in ('-t','--target'):
            mtfid = a
        elif o in ('-a','--athresh'):
            adaptive_threshold = float(a)

    driver = PR2Driver("pr2_driver", vm, feedback, 100, adaptive_threshold, rsource_frameid, rtarget_frameid, msfid, mtfid,False) # start node
    #driver.adaptive_threshold=adaptive_threshold
    driver.ltfid=ltarget_frameid
    driver.rtfid=rtarget_frameid
    driver.spin()