def main(): motionProxy = init_robot.start_motion() rospy.init_node('walker', anonymous=True) if rospy.get_param('lower'): sys.exit() ball = rospy.wait_for_message('pos', Point) while ball.x > 0.45: move_robot(motionProxy, ball) ball = rospy.wait_for_message('pos', Point) # Una vez hemos concluido el acercamiento con el walker... rospy.set_param('lower', True)
def main(): motionProxy = init_robot.start_motion() rospy.init_node('set_position', anonymous=True) while not rospy.get_param('lower'): time.sleep(0.5) # Cuando otro módulo hace lower True... videoDeviceProxy = camera.init_camera() camera.low_camera(videoDeviceProxy) ball = rospy.wait_for_message('pos', Point) while not inrange(ball.x, TARGET_X-ERROR_X, TARGET_X+ERROR_X) or \ not inrange(ball.y, TARGET_Y-ERROR_Y, TARGET_Y+ERROR_Y): set_position(motionProxy, ball) ball = rospy.wait_for_message('pos', Point) rospy.set_param('kick_now', True)
def main(): rospy.init_node('goal_pos') motionProxy = init_robot.start_motion() postureProxy = init_robot.start_posture() markProxy = init_robot.start_mark_detection() memProxy = init_robot.start_memory() launcher(motionProxy, postureProxy, markProxy) pub = rospy.Publisher('goal', Point, queue_size=1) rate = rospy.Rate(5) #5Hz while not rospy.is_shutdown(): publish_goal(memProxy, pub) rate.sleep() redgoalTrackerProxy.stopTracker() postureProxy.goToPosture('StandInit', 1.0)
def main(): motionProxy = init_robot.start_motion() postureProxy = init_robot.start_posture() rospy.init_node('kicker', anonymous=True) if not rospy.has_param('frames'): rospy.set_param('frames', 10) #valor default frames = rospy.get_param('frames') target_x = calculate_target_x(frames) target_y = calculate_target_y(frames) prepare_kick(motionProxy) basic_kick.basic_kick(motionProxy) #kick(motionProxy, target_x, target_y, deviation) trajectory = get_trajectory() rospy.loginfo('Ball trajectory: ' + str(trajectory)) trajectory_to_csv(trajectory, alpha) # print_trajectory(trajectory) init_robot.init_pos(postureProxy)