code: def target_location(self, roi):
          
          # set gimbal to targeting mode
          msg = self._vehicle.message_factory.mount_configure_encode(
              0, 1,    # target system, target component
              mavutil.mavlink.MAV_MOUNT_MODE_GPS_POINT,  # mount_mode
              1,  # stabilize roll
              1,  # stabilize pitch
              1,  # stabilize yaw
          )
          self._vehicle.send_mavlink(msg)
  
          # Get altitude relative to home irrespective of Location object passed in.
          if isinstance(roi, LocationGlobalRelative):
              alt = roi.alt
          elif isinstance(roi, LocationGlobal):
              if not self.home_location:
                  self.commands.download()
                  self.commands.wait_ready()
              alt = roi.alt - self.home_location.alt
          else:
              raise ValueError('Expecting location to be LocationGlobal or LocationGlobalRelative.')
  
          # set the ROI
          msg = self._vehicle.message_factory.command_long_encode(
              0, 1,    # target system, target component
              mavutil.mavlink.MAV_CMD_DO_SET_ROI,  # command
              0,  # confirmation
              0, 0, 0, 0,  # params 1-4
              roi.lat,
              roi.lon,
              alt
          )
          self._vehicle.send_mavlink(msg)
docs: Point the gimbal at a specific region of interest (ROI).
  
          .. code-block:: python
  
              #Set the camera to track the current home location.
              vehicle.gimbal.target_location(vehicle.home_location)
  
          The target position must be defined in a :py:class:`LocationGlobalRelative` or :py:class:`LocationGlobal`.
  
          This function can be called in AUTO or GUIDED mode.
  
          In order to clear an ROI you can send a location with all zeros (e.g. ``LocationGlobalRelative(0,0,0)``).
  
          :param roi: Target location in global relative frame.