當前位置: 首頁>>代碼示例>>Python>>正文


Python msg.MoveBaseAction方法代碼示例

本文整理匯總了Python中move_base_msgs.msg.MoveBaseAction方法的典型用法代碼示例。如果您正苦於以下問題:Python msg.MoveBaseAction方法的具體用法?Python msg.MoveBaseAction怎麽用?Python msg.MoveBaseAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在move_base_msgs.msg的用法示例。


在下文中一共展示了msg.MoveBaseAction方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: move

# 需要導入模塊: from move_base_msgs import msg [as 別名]
# 或者: from move_base_msgs.msg import MoveBaseAction [as 別名]
def move(self, goal):
            # Send the goal pose to the MoveBaseAction server
            self.move_base.send_goal(goal)
            
            # Allow 1 minute to get there
            finished_within_time = self.move_base.wait_for_result(rospy.Duration(60)) 
            
            # If we don't get there in time, abort the goal
            if not finished_within_time:
                self.move_base.cancel_goal()
                rospy.loginfo("Timed out achieving goal")
            else:
                # We made it!
                state = self.move_base.get_state()
                if state == GoalStatus.SUCCEEDED:
                    rospy.loginfo("Goal succeeded!") 
開發者ID:EAIBOT,項目名稱:dashgo,代碼行數:18,代碼來源:move_base_square.py

示例2: __init__

# 需要導入模塊: from move_base_msgs import msg [as 別名]
# 或者: from move_base_msgs.msg import MoveBaseAction [as 別名]
def __init__(self, position, orientation):
        State.__init__(self, outcomes=['success'])

        # Get an action client
        self.client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
        self.client.wait_for_server()

        # Define the goal
        self.goal = MoveBaseGoal()
        self.goal.target_pose.header.frame_id = 'map'
        self.goal.target_pose.pose.position.x = position[0]
        self.goal.target_pose.pose.position.y = position[1]
        self.goal.target_pose.pose.position.z = 0.0
        self.goal.target_pose.pose.orientation.x = orientation[0]
        self.goal.target_pose.pose.orientation.y = orientation[1]
        self.goal.target_pose.pose.orientation.z = orientation[2]
        self.goal.target_pose.pose.orientation.w = orientation[3] 
開發者ID:osrf,項目名稱:rosbook,代碼行數:19,代碼來源:patrol_fsm.py

示例3: __init__

# 需要導入模塊: from move_base_msgs import msg [as 別名]
# 或者: from move_base_msgs.msg import MoveBaseAction [as 別名]
def __init__(self, goalFrameId = '/map'):
		self._GoalFrameId = goalFrameId
		
		# Initializes a rospy node so that the SimpleActionClient can publish and subscribe over ROS.
		rospy.init_node('goalsSequencer')
		
		self._Client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
		# Waits until the action server has started up and started listening for goals.
		self._Client.wait_for_server() 
開發者ID:PacktPublishing,項目名稱:ROS-Programming-Building-Powerful-Robots,代碼行數:11,代碼來源:GoalsSequencer.py

示例4: __init__

# 需要導入模塊: from move_base_msgs import msg [as 別名]
# 或者: from move_base_msgs.msg import MoveBaseAction [as 別名]
def __init__(self, pr2):
        self.pr2 = pr2
        self.action_client = actionlib.SimpleActionClient('move_base', mbm.MoveBaseAction)
        self.command_pub = rospy.Publisher('base_controller/command', gm.Twist)
        self.traj_pub = rospy.Publisher("base_traj_controller/command", tm.JointTrajectory)
        self.vel_limits = [.2, .2, .3]
        self.acc_limits = [2, 2, 2]  # note: I didn't think these thru
        self.n_joints = 3 
開發者ID:alexlee-gk,項目名稱:visual_dynamics,代碼行數:10,代碼來源:PR2.py

示例5: __init__

# 需要導入模塊: from move_base_msgs import msg [as 別名]
# 或者: from move_base_msgs.msg import MoveBaseAction [as 別名]
def __init__(self):
    self.move_base = actionlib.SimpleActionClient('move_base', MoveBaseAction)
    self.move_base.wait_for_server()
    self.tf_listener = tf.TransformListener()
    self.head_client = actionlib.SimpleActionClient("head_controller/point_head", PointHeadAction)
    self.head_client.wait_for_server() 
開發者ID:osrf,項目名稱:rosbook,代碼行數:8,代碼來源:dock_with_bin.py


注:本文中的move_base_msgs.msg.MoveBaseAction方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。