ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Actually, I don't know maybe I am using the get_num_connections wrong but at the end, I have erased it and just making the function simple like that now it's working thank you, I appreciate your help

def publish_once_only(self,req):
    rospy.loginfo("save heading service has been called")
    self.hdg = self.current_heading
    try:
        self.latch_publisher.publish(self.hdg)
        rospy.loginfo("Published")
        self.rate.sleep()
    except rospy.ROSInterruptException:
        raise e

    return EmptyResponse()