def __init__(self,name): action_spec=TestAction ActionServer.__init__(self,name,action_spec,self.goalCallback,self.cancelCallback, False); self.start() rospy.loginfo("Creating ActionServer [%s]\n", name); self.saved_goals=[]
def __init__(self, name): self.server_name = name action_spec = Robot_binpickingAction ActionServer.__init__( self, name, action_spec, self.goalCallback, self.cancelCallback, False) self.start() # como metemos o ultimo parametro a False, damos o start aqui rospy.loginfo("Creating ActionServer [%s]\n", name) self.saved_goals = [] self._feedback = Robot_binpickingFeedback() self._result = Robot_binpickingResult() # Publisher of pointStamped of the grasping point grasping_point_pub = rospy.Publisher( '/graspingPoint', PointStamped, queue_size=10) # Publisher of pointStamped of the grasping point self.io_pub = rospy.Publisher( '/io_client_messages', ios, queue_size=10) self.continue_move = False #variable to confirm planning for picking self.cancellAction_var=False rospy.Subscriber("/joy", Joy, self.joyCallback)
def __init__(self, name): action_spec = TestAction ActionServer.__init__(self, name, action_spec, self.goalCallback, self.cancelCallback, False) self.start() rospy.loginfo("Creating ActionServer [%s]\n", name) self.saved_goals = []
def __init__(self, name): ActionServer.__init__(self, name, DockAction, self.__goal_callback, self.__cancel_callback, False) self.__docked = False self.__dock_speed = rospy.get_param('~dock/dock_speed', 0.05) self.__dock_distance = rospy.get_param('~dock/dock_distance', 1.0) self.__map_frame = rospy.get_param('~map_frame', 'map') self.__odom_frame = rospy.get_param('~odom_frame', 'odom') self.__base_frame = rospy.get_param('~base_frame', 'base_footprint') self.__dock_ready_pose = Pose() self.__dock_ready_pose.position.x = rospy.get_param('~dock/pose_x') self.__dock_ready_pose.position.y = rospy.get_param('~dock/pose_y') self.__dock_ready_pose.position.z = rospy.get_param('~dock/pose_z') self.__dock_ready_pose.orientation.x = rospy.get_param( '~dock/orientation_x') self.__dock_ready_pose.orientation.y = rospy.get_param( '~dock/orientation_y') self.__dock_ready_pose.orientation.z = rospy.get_param( '~dock/orientation_z') self.__dock_ready_pose.orientation.w = rospy.get_param( '~dock/orientation_w') self.__dock_ready_pose_2 = PoseStamped() rospy.loginfo('param: dock_spped, %s, dock_distance %s' % (self.__dock_speed, self.__dock_distance)) rospy.loginfo('param: map_frame %s, odom_frame %s, base_frame %s' % (self.__map_frame, self.__odom_frame, self.__base_frame)) rospy.loginfo('dock_pose:') rospy.loginfo(self.__dock_ready_pose) self.__movebase_client = SimpleActionClient('move_base', MoveBaseAction) rospy.loginfo('wait for movebase server...') self.__movebase_client.wait_for_server() rospy.loginfo('movebase server connected') self.__cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) rospy.Subscriber('dock_pose', PoseStamped, self.__dock_pose_callback) self.__tf_listener = tf.TransformListener() self.__docked = False # self.__saved_goal = MoveBaseGoal() self.__no_goal = True self.__current_goal_handle = ServerGoalHandle() self.__exec_condition = threading.Condition() self.__exec_thread = threading.Thread(None, self.__exec_loop) self.__exec_thread.start() rospy.loginfo('Creating ActionServer [%s]\n', name)
def __init__(self, name): self.server_name = name action_spec = Robot_binpickingAction ActionServer.__init__(self, name, action_spec, self.goalCallback, self.cancelCallback, False) self.start( ) # como metemos o ultimo parametro a False, damos o start aqui rospy.loginfo("Creating ActionServer [%s]\n", name) self.saved_goals = [] self._feedback = Robot_binpickingFeedback() self._result = Robot_binpickingResult()
def __init__(self, name): ActionServer.__init__(self, name, DockAction, self.__goal_callback, self.__cancel_callback, False) self.__docked = False self.__dock_speed = rospy.get_param("~dock/dock_speed", 0.05) self.__dock_distance = rospy.get_param("~dock/dock_distance", 1.0) self.__map_frame = rospy.get_param("~map_frame", "map") self.__odom_frame = rospy.get_param("~odom_frame", "odom") self.__base_frame = rospy.get_param("~base_frame", "base_footprint") self.__dock_ready_pose = Pose() self.__dock_ready_pose.position.x = rospy.get_param("~dock/pose_x") self.__dock_ready_pose.position.y = rospy.get_param("~dock/pose_y") self.__dock_ready_pose.position.z = rospy.get_param("~dock/pose_z") self.__dock_ready_pose.orientation.x = rospy.get_param( "~dock/orientation_x") self.__dock_ready_pose.orientation.y = rospy.get_param( "~dock/orientation_y") self.__dock_ready_pose.orientation.z = rospy.get_param( "~dock/orientation_z") self.__dock_ready_pose.orientation.w = rospy.get_param( "~dock/orientation_w") self.__dock_ready_pose_2 = PoseStamped() rospy.loginfo("param: dock_spped, %s, dock_distance %s" % (self.__dock_speed, self.__dock_distance)) rospy.loginfo("param: map_frame %s, odom_frame %s, base_frame %s" % (self.__map_frame, self.__odom_frame, self.__base_frame)) rospy.loginfo("dock_pose:") rospy.loginfo(self.__dock_ready_pose) self.__movebase_client = SimpleActionClient('move_base', MoveBaseAction) rospy.loginfo("wait for movebase server...") self.__movebase_client.wait_for_server() rospy.loginfo("movebase server connected") self.__cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) rospy.Subscriber("dock_pose", PoseStamped, self.__dock_pose_callback) self.__tf_listener = tf.TransformListener() self.__docked = False self.__saved_goal = MoveBaseGoal() rospy.loginfo("Creating ActionServer [%s]\n", name)
def __init__(self, name): self.server_name = name action_spec = Robot_binpickingAction ActionServer.__init__(self, name, action_spec, self.goalCallback, self.cancelCallback, False) self.start( ) # como metemos o ultimo parametro a False, damos o start aqui rospy.loginfo("Creating ActionServer [%s]\n", name) self.saved_goals = [] self._feedback = Robot_binpickingFeedback() self._result = Robot_binpickingResult() # construtor para moveit # This RobotCommander object is an interface to the robot as a whole. robot = moveit_commander.RobotCommander() # This PlanningSceneInterface object is an interface to the world surrounding the robot. scene = moveit_commander.PlanningSceneInterface() # MoveGroupCommander object. This object is an interface to one group of joints. # In this case the group is the joints in the manipulator. This interface can be used # to plan and execute motions on the manipulator. self.group = moveit_commander.MoveGroupCommander("manipulator") # Publisher of pointStamped of the grasping point grasping_point_pub = rospy.Publisher('/graspingPoint', PointStamped, queue_size=10) # Publisher of pointStamped of the grasping point self.io_pub = rospy.Publisher('/io_client_messages', ios, queue_size=10) self.markerPub = rospy.Publisher('robotMarker', Marker, queue_size=1) self.continue_move = False #variable to confirm planning for picking self.cancellAction_var = False rospy.Subscriber("/joy", Joy, self.joyCallback)
def __init__(self, name): self.server_name = name action_spec = Robot_statusAction ActionServer.__init__( self, name, action_spec, self.goalCallback, self.cancelCallback, False) self.start() # como metemos o ultimo parametro a False, damos o start aqui rospy.loginfo("Creating ActionServer [%s]\n", name) self.saved_goals = [] self._feedback = Robot_statusFeedback() self._result = Robot_statusResult() # construtor para moveit # This RobotCommander object is an interface to the robot as a whole. robot = moveit_commander.RobotCommander() # This PlanningSceneInterface object is an interface to the world surrounding the robot. scene = moveit_commander.PlanningSceneInterface() # MoveGroupCommander object. This object is an interface to one group of joints. # In this case the group is the joints in the manipulator. This interface can be used # to plan and execute motions on the manipulator. self.group = moveit_commander.MoveGroupCommander("manipulator")