本文整理汇总了Python中flexbe_core.proxy.ProxyActionClient类的典型用法代码示例。如果您正苦于以下问题:Python ProxyActionClient类的具体用法?Python ProxyActionClient怎么用?Python ProxyActionClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ProxyActionClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
super(SpeechOutputState, self).__init__(outcomes=["done", "failed"], input_keys=["text"])
self._topic = "/speak"
self._client = ProxyActionClient({self._topic: maryttsAction})
self._error = False
示例2: __init__
def __init__(self, desired_tilt):
'''Constructor'''
super(TiltHeadState, self).__init__(outcomes=['done', 'failed'])
if not rospy.has_param("behavior/joint_controllers_name"):
Logger.logerr("Need to specify parameter behavior/joint_controllers_name at the parameter server")
return
controller_namespace = rospy.get_param("behavior/joint_controllers_name")
# self._configs['flor']['same'] = {
# 20: {'joint_name': 'neck_ry', 'joint_values': [+0.00], 'controller': 'neck_traj_controller'}, # max -40 degrees
# 21: {'joint_name': 'neck_ry', 'joint_values': [-40.0], 'controller': 'neck_traj_controller'},
# 22: {'joint_name': 'neck_ry', 'joint_values': [-20.0], 'controller': 'neck_traj_controller'},
# 23: {'joint_name': 'neck_ry', 'joint_values': [+20.0], 'controller': 'neck_traj_controller'},
# 24: {'joint_name': 'neck_ry', 'joint_values': [+40.0], 'controller': 'neck_traj_controller'},
# 25: {'joint_name': 'neck_ry', 'joint_values': [+60.0], 'controller': 'neck_traj_controller'} # max +60 degrees
# }
self._action_topic = "/" + controller_namespace + \
"/neck_traj_controller" + "/follow_joint_trajectory"
self._client = ProxyActionClient({self._action_topic: FollowJointTrajectoryAction})
# Convert desired position to radians
self._desired_tilt = math.radians(desired_tilt)
self._failed = False
示例3: __init__
def __init__(self, config_name, move_group="", action_topic = '/move_group', robot_name=""):
'''
Constructor
'''
super(SrdfStateToMoveit, self).__init__(outcomes=['reached', 'planning_failed', 'control_failed', 'param_error'])
self._config_name = config_name
self._move_group = move_group
self._robot_name = robot_name
self._action_topic = action_topic
self._client = ProxyActionClient({self._action_topic: MoveGroupAction})
self._planning_failed = False
self._control_failed = False
self._success = False
self._srdf_param = None
if rospy.has_param("/robot_description_semantic"):
self._srdf_param = rospy.get_param("/robot_description_semantic")
else:
Logger.logerror('Unable to get parameter: /robot_description_semantic')
self._param_error = False
self._srdf = None
示例4: __init__
def __init__(self, direction):
'''
Constructor
'''
super(FootstepPlanRelativeState, self).__init__(outcomes=['planned', 'failed'],
input_keys=['distance'],
output_keys=['plan_header'])
if not rospy.has_param("behavior/step_distance_forward"):
Logger.logerr("Need to specify parameter behavior/step_distance_forward at the parameter server")
return
if not rospy.has_param("behavior/step_distance_sideward"):
Logger.logerr("Need to specify parameter behavior/step_distance_sideward at the parameter server")
return
self._step_distance_forward = rospy.get_param("behavior/step_distance_forward")
self._step_distance_sideward = rospy.get_param("behavior/step_distance_sideward")
self._action_topic = '/vigir/footstep_manager/step_plan_request'
self._client = ProxyActionClient({self._action_topic: StepPlanRequestAction})
self._done = False
self._failed = False
self._direction = direction
示例5: __init__
def __init__(self, controllers = ["left_arm_traj_controller", "right_arm_traj_controller"]):
'''Constructor'''
super(ExecuteTrajectoryBothArmsState, self).__init__(outcomes = ['done', 'failed'],
input_keys = ['trajectories'])
self._controllers = controllers
self._controllers = ["left_arm_traj_controller", "right_arm_traj_controller"] if not(controllers) else controllers
self._client = ProxyActionClient()
self._client_topics = dict()
self._active_topics = list()
for controller in self._controllers:
if "left_arm" in controller:
action_topic_left = "/trajectory_controllers/" + controller + "/follow_joint_trajectory"
self._client.setupClient(action_topic_left, FollowJointTrajectoryAction)
self._client_topics['left_arm'] = action_topic_left
elif "right_arm" in controller:
action_topic_right = "/trajectory_controllers/" + controller + "/follow_joint_trajectory"
self._client.setupClient(action_topic_right, FollowJointTrajectoryAction)
self._client_topics['right_arm'] = action_topic_right
else:
Logger.logwarn('The controller is neither a left nor a right arm trajectory controller!? %s' % str(controller))
self._failed = False
示例6: __init__
def __init__(self):
super(StartExploration, self).__init__(outcomes = ['succeeded', 'failed'])
self._action_topic = '/move_base'
self._move_client = ProxyActionClient({self._action_topic: MoveBaseAction})
self._succeeded = False
self._failed = False
示例7: __init__
def __init__(self):
super(SpeechOutputState, self).__init__(outcomes = ['done', 'failed'],
input_keys = ['text'])
self._topic = '/speak'
self._client = ProxyActionClient({self._topic: maryttsAction})
self._error = False
示例8: __init__
def __init__(self, sweep_type):
super(MetricSweepState, self).__init__(outcomes = ['sweeped', 'failed'])
self._sweep_type = sweep_type
self._topic = '/do_sweep'
self._client = ProxyActionClient({self._topic: SweepAction})
self._error = False
示例9: __init__
def __init__(self):
super(Explore, self).__init__(outcomes = ['succeeded', 'failed'], input_keys =['speed'])
self._action_topic = '/move_base'
self._move_client = ProxyActionClient({self._action_topic: MoveBaseAction})
self._dynrec = Client("/vehicle_controller", timeout = 10)
self._defaultspeed = 0.1
self._succeeded = False
self._failed = False
示例10: __init__
def __init__(self):
# See example_state.py for basic explanations.
super(MoveCameraState, self).__init__(outcomes = ['done', 'failed'],
input_keys = ['pan', 'tilt'])
self._topic = 'SetPTUState'
self._client = ProxyActionClient({self._topic: PtuGotoAction})
self._error = False
示例11: __init__
def __init__(self):
super(FootstepPlanRealignCenterState, self).__init__(outcomes=['planned','failed'],
output_keys=['plan_header'])
self._action_topic = '/vigir/footstep_manager/step_plan_request'
self._client = ProxyActionClient({self._action_topic: StepPlanRequestAction})
self._failed = False
self._done = False
示例12: __init__
def __init__(self):
"""
Constructor
"""
super(LookAtWaypoint, self).__init__(outcomes=["reached", "failed"], input_keys=["waypoint"])
self._action_topic = "/pan_tilt_sensor_head_joint_control/look_at"
self._client = ProxyActionClient({self._action_topic: hector_perception_msgs.msg.LookAtAction})
self._failed = False
self._reached = False
示例13: __init__
def __init__(self, controller):
'''
Constructor
'''
super(ExecuteTrajectoryState, self).__init__(outcomes=['done', 'failed'],
input_keys=['joint_trajectory'])
self._action_topic = controller + "/follow_joint_trajectory"
self._client = ProxyActionClient({self._action_topic: FollowJointTrajectoryAction})
self._failed = False
示例14: __init__
def __init__(self):
'''
Constructor
'''
super(ExecuteStepPlanActionState , self).__init__(outcomes=['finished','failed'],
input_keys=['plan_header'])
self._action_topic = "/vigir/footstep_manager/execute_step_plan"
self._client = ProxyActionClient({self._action_topic: ExecuteStepPlanAction})
self._failed = False
示例15: MetricSweepState
class MetricSweepState(EventState):
'''
Robot performs a metric sweep at its current location.
-- sweep_type string Type of the sweep to do (select one of the provided options).
<= sweeped Sweep has been completed.
<= failed There has been an error when sweeping.
'''
COMPLETE = 'complete'
MEDIUM = 'medium'
SHORT = 'short'
SHORTEST = 'shortest'
def __init__(self, sweep_type):
super(MetricSweepState, self).__init__(outcomes = ['sweeped', 'failed'])
self._sweep_type = sweep_type
self._topic = '/do_sweep'
self._client = ProxyActionClient({self._topic: SweepAction})
self._error = False
def execute(self, userdata):
if self._error:
return 'failed'
if self._client.has_result(self._topic):
result = self._client.get_result(self._topic)
if result.success:
return 'sweeped'
else:
return 'failed'
def on_enter(self, userdata):
goal = SweepGoal()
goal.type = self._sweep_type
self._error = False
try:
self._client.send_goal(self._topic, goal)
except Exception as e:
Logger.logwarn('Failed to send the Sweep command:\n%s' % str(e))
self._error = True
def on_exit(self, userdata):
if not self._client.has_result(self._topic):
self._client.cancel(self._topic)
Logger.loginfo('Cancelled active action goal.')