def reset_map(self): wait_for_service_wrapper('map_reset', timeout=3) try: map_reset_client = rospy.ServiceProxy('map_reset', Empty) resp1 = map_reset_client() time.sleep(0.3) except rospy.ServiceException as e: print("Service call failed: %s" % e)
def plot_prob_dist(self, data): wait_for_service_wrapper('plot_prob_dist', timeout=3) try: plot_prob_dist_client = rospy.ServiceProxy('plot_prob_dist', ProbDist) resp1 = plot_prob_dist_client(data) time.sleep(0.3) return resp1.result except rospy.ServiceException as e: print("Service call failed: %s" % e)
def visualize_map(self): wait_for_service_wrapper('map_init', timeout=3) try: map_init_client = rospy.ServiceProxy('map_init', MapInit) resp1 = map_init_client(self.loc.mapper.lines[0][:, 0], self.loc.mapper.lines[0][:, 1], self.loc.mapper.lines[1][:, 0], self.loc.mapper.lines[1][:, 1]) time.sleep(0.3) # return resp1.result except rospy.ServiceException as e: print("Service call failed: %s" % e)
def reset(self): self.set_vel(0, 0) print(" | Resetting Robot pose") wait_for_service_wrapper('/reset_positions') try: reset_positions = rospy.ServiceProxy('/reset_positions', Empty) reset_positions() time.sleep(1.5) except rospy.ServiceException as e: print("Service call failed: %s" % e)