code: def cmd_set_homepos(self, args):
          '''called when user selects "Set Home" on map'''
          (lat, lon) = (self.click_position[0], self.click_position[1])
          print("Setting home to: ", lat, lon)
          self.master.mav.command_int_send(
              self.settings.target_system, self.settings.target_component,
              mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT,
              mavutil.mavlink.MAV_CMD_DO_SET_HOME,
              1, # current
              0, # autocontinue
              0, # param1
              0, # param2
              0, # param3
              0, # param4
              int(lat*1e7), # lat
              int(lon*1e7), # lon
              0f cmd_set_homepos(self, args):
          '''called when user selects "Set Home" on map'''
          (lat, lon) = (self.click_position[0], self.click_position[1])
          print("Setting home to: ", lat, lon)
          self.master.mav.command_int_send(
              self.settings.target_system, self.settings.target_component,
              mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT_INT,
              mavutil.mavlink.MAV_CMD_DO_SET_HOME,
              1, # current
              0, # autocontinue
              0, # param1
              0, # param2
              0, # param3
              0, # param4
              int(lat*1e7), # lat
              int(lon*1e7), # lon
              0)
docs: called when user selects "Set Home" on map