當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。