code: def wp_slope(self):
          '''show slope of waypoints'''
          last_w = None
          for i in range(1, self.wploader.count()):
              w = self.wploader.wp(i)
              if w.command not in [mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, mavutil.mavlink.MAV_CMD_NAV_LAND]:
                  continue
              if last_w is not None:
                  if last_w.frame != w.frame:
                      print("WARNING: frame change %u -> %u at %u" % (last_w.frame, w.frame, i))
                  delta_alt = last_w.z - w.z
                  if delta_alt == 0:
                      slope = "Level"
                  else:
                      delta_xy = mp_util.gps_distance(w.x, w.y, last_w.x, last_w.y)
                      slope = "%.1f" % (delta_xy / delta_alt)
                  print("WP%u: slope %s" % (i, slope))
              last_w = f wp_slope(self):
          '''show slope of waypoints'''
          last_w = None
          for i in range(1, self.wploader.count()):
              w = self.wploader.wp(i)
              if w.command not in [mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, mavutil.mavlink.MAV_CMD_NAV_LAND]:
                  continue
              if last_w is not None:
                  if last_w.frame != w.frame:
                      print("WARNING: frame change %u -> %u at %u" % (last_w.frame, w.frame, i))
                  delta_alt = last_w.z - w.z
                  if delta_alt == 0:
                      slope = "Level"
                  else:
                      delta_xy = mp_util.gps_distance(w.x, w.y, last_w.x, last_w.y)
                      slope = "%.1f" % (delta_xy / delta_alt)
                  print("WP%u: slope %s" % (i, slope))
              last_w = w
docs: show slope of waypoints