当前位置: 首页>>代码示例>>Python>>正文


Python srv.EmptyResponse方法代码示例

本文整理汇总了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() 
开发者ID:dougsm,项目名称:mvp_grasp,代码行数:21,代码来源:grasp_entropy_node.py

示例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 
开发者ID:ros-naoqi,项目名称:nao_robot,代码行数:7,代码来源:nao_walker.py

示例3: handleNeedsStartWalkPoseSrv

# 需要导入模块: from std_srvs import srv [as 别名]
# 或者: from std_srvs.srv import EmptyResponse [as 别名]
def handleNeedsStartWalkPoseSrv(self, data):
        self.needsStartWalkPose = True
        return EmptyResponse() 
开发者ID:ros-naoqi,项目名称:nao_robot,代码行数:5,代码来源:nao_walker.py

示例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() 
开发者ID:ros-naoqi,项目名称:nao_robot,代码行数:10,代码来源:nao_walker.py

示例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() 
开发者ID:jhu-lcsr,项目名称:costar_plan,代码行数:11,代码来源:manager.py

示例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() 
开发者ID:jhu-lcsr,项目名称:costar_plan,代码行数:6,代码来源:tom_sim.py

示例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 
开发者ID:ros-naoqi,项目名称:naoqi_bridge,代码行数:10,代码来源:pose_controller.py

示例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 
开发者ID:ros-naoqi,项目名称:naoqi_bridge,代码行数:10,代码来源:pose_controller.py

示例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 
开发者ID:ros-naoqi,项目名称:naoqi_bridge,代码行数:10,代码来源:pose_controller.py

示例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 
开发者ID:ros-naoqi,项目名称:naoqi_bridge,代码行数:10,代码来源:pose_controller.py

示例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 
开发者ID:ros-naoqi,项目名称:naoqi_bridge,代码行数:10,代码来源:pose_controller.py

示例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() 
开发者ID:OTL,项目名称:ros_book_programs,代码行数:5,代码来源:service_server.py


注:本文中的std_srvs.srv.EmptyResponse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。