本文整理汇总了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()