def Visualize_Path(path): #Function to publish path print "visualizing path" Path = rospy.Publisher('/Path', GridCells) Path_GridCells = GridCells() Path_GridCells.header = HEADER Path_GridCells.cell_width = RESOLUTION Path_GridCells.cell_height = RESOLUTION Path_GridCells.cells = path Path.publish(Path_GridCells)