本文整理汇总了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!")
示例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]
示例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()
示例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
示例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()