本文整理匯總了Python中std_srvs.srv.EmptyResponse方法的典型用法代碼示例。如果您正苦於以下問題:Python srv.EmptyResponse方法的具體用法?Python srv.EmptyResponse怎麽用?Python srv.EmptyResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類std_srvs.srv
的用法示例。
在下文中一共展示了srv.EmptyResponse方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: reset_gridworld
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def reset_gridworld(self, req):
"""
Reset gridworld to initial conditions.
:param req: Ignored (trigger)
:return: Empty Response
"""
self.gw = GridWorld(self.gw_bounds, self.gw_res)
self.gw.add_grid('visited', 0.0)
self.gw.add_grid('hist', 1.0, extra_dims=(self.hist_bins_a, self.hist_bins_q))
self.gw.add_grid('depth_mean', 0.0)
self.gw.add_grid('depth_var', 0.0)
self.gw.add_grid('width_mean', 0.0)
self.gw.add_grid('width_var', 0.0)
self.gw.add_grid('count', 0.0)
self.gw.add_grid('hist_p_prev', 1.0/self.hist_bins_q, extra_dims=(self.hist_bins_q, ))
self.position_history = []
self.no_viewpoints = 0
self.counter = 0
return EmptySrvResponse()
示例2: handleStopWalkSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleStopWalkSrv(self, req):
if self.stopWalk():
return EmptyResponse()
else:
return None
示例3: handleNeedsStartWalkPoseSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleNeedsStartWalkPoseSrv(self, data):
self.needsStartWalkPose = True
return EmptyResponse()
示例4: handleReadFootGaitConfigSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleReadFootGaitConfigSrv(self, data):
self.useFootGaitConfig = rospy.get_param('~use_foot_gait_config', False)
rospy.loginfo("useFootGaitConfig = %d" % self.useFootGaitConfig)
if self.useFootGaitConfig:
self.footGaitConfig = rospy.get_param('~foot_gait_config', self.motionProxy.getFootGaitConfig("Default"))
else:
self.footGaitConfig = self.motionProxy.getFootGaitConfig("Default")
return EmptyResponse()
示例5: reset_srv_cb
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def reset_srv_cb(self, msg):
'''
Reset the robot's position to its start state. Create new objects to
manipulate based on experimental parameters.
'''
self.pause()
self.experiment.reset()
self.resume()
return EmptySrvResponse()
示例6: reset_cb
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def reset_cb(self, msg):
for name, q in zip(self.joint_names, self.default_pose):
self.qs[name] = q
return EmptyResponse()
示例7: handleStiffnessSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleStiffnessSrv(self, req):
try:
self.motionProxy.stiffnessInterpolation("Body", 1.0, 0.5)
rospy.loginfo("Body stiffness enabled")
return EmptyResponse()
except RuntimeError,e:
rospy.logerr("Exception caught:\n%s", e)
return None
示例8: handleStiffnessOffSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleStiffnessOffSrv(self, req):
try:
self.motionProxy.stiffnessInterpolation("Body", 0.0, 0.5)
rospy.loginfo("Body stiffness removed")
return EmptyResponse()
except RuntimeError,e:
rospy.logerr("Exception caught:\n%s", e)
return None
示例9: handleWakeUpSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleWakeUpSrv(self, req):
try:
self.motionProxy.wakeUp()
rospy.loginfo("Wake Up")
return EmptyResponse()
except RuntimeError,e:
rospy.logerr("Exception caught:\n%s", e)
return None
示例10: handleRestSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleRestSrv(self, req):
try:
self.motionProxy.rest()
rospy.loginfo("Rest")
return EmptyResponse()
except RuntimeError,e:
rospy.logerr("Exception caught:\n%s", e)
return None
示例11: handleLifeSrv
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handleLifeSrv(self, req):
try:
self.lifeProxy.setState("solitary")
rospy.loginfo("set life state to solitary")
return EmptyResponse()
except RuntimeError, e:
rospy.logerr("Exception while setting life state:\n%s", e)
return None
示例12: handle_service
# 需要導入模塊: from std_srvs import srv [as 別名]
# 或者: from std_srvs.srv import EmptyResponse [as 別名]
def handle_service(req):
rospy.loginfo('called!')
return EmptyResponse()