当前位置: 首页>>代码示例>>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;未经允许,请勿转载。