Package 

Class LinkageManager

  • All Implemented Interfaces:
    se.cpacsystems.assist.common.Sqi , se.cpacsystems.assist.linkage.LaserSqi , se.cpacsystems.assist.sensor.SensorSqi

    
    public class LinkageManager
    extends LinkageSupport implements LaserSqi
                        

    Manager for interaction with the linkage service.

    To start listening for updates on linkage data: create an instance of this class LinkageManager, register a listener registerOnChangeListener, and connect to the underlying service connect.

    Note! The connection towards the underlying service is asynchronous. This means that data is not ready immediately after connect. Data should be retrieved in the OnChangeListener callbacks.

    • Constructor Detail

      • LinkageManager

        LinkageManager(Context appC)
        Constructor used for creating an instance of this object.
    • Method Detail

      • getLinkageConfigData

         List<LinkageConfigData> getLinkageConfigData()

        Retrieve linkage configuration. Returns a list containing a LinkageConfigData object for eachof the links in the linkage.

        Depending on linkage configuration, the following permissions can be requiredto access the linkage configuration:

        • se.cpacsystems.permission.LINKAGE_CONFIG
        • se.cpacsystems.permission.LINKAGE_CONFIG_EXTENDED
      • getLinkageConfigData

         LinkageConfigData getLinkageConfigData(int link)

        Retrieve a linkage configuration data for a specific linkage.i.e. linkageManager.getLinkageConfigData(LinkageManager.BASE).

        Parameters:
        link - the identifier of the linkage
      • getLinkageSqi

         int getLinkageSqi()

        Return linkage configuration status.

      • getHeadingDrift

         double getHeadingDrift()

        Return estimated heading drift between body IMU and tilt IMU.Used for tilt angle estimation.

      • registerOnChangeListener

         void registerOnChangeListener(LinkageManager.OnChangeListener listener)

        Register listening to linkage data change and linkage configuration change.

        Without this listener the configuration data and linkage position data will not be updated.So you most likely want to register a listener.

        Will try to post the listener events on the looper associated with the thread this method wascalled on. If looper not available will resort to the main looper.

        Parameters:
        listener - the listener
      • registerOnChangeListener

         void registerOnChangeListener(LinkageManager.OnChangeListener listener, Handler handler)

        Register listening to linkage data change and linkage configuration change

        Without this listener the configuration data and linkage position data will not be updated.So you most likely want to register a listener.

        Parameters:
        listener - the listener
        handler - the handler where the listener events will be delivered to.If null will try to post the listener events on the looper associated with the thread this methodwas called on.
      • unregisterOnChangeListener

         void unregisterOnChangeListener()

        Unregister listening to linkage data change and linkage configuration change

      • connect

         void connect(int updateRate)

        Connect to Linkage Service to start receiving linkage updates

        Parameters:
        updateRate - requested update rate.
      • connect

         void connect()

        Connect to Linkage Service to start receiving linkage updates

      • disconnect

         void disconnect()

        Disconnect Linkage Service

      • getMainLinkageAngles

         List<AngleData> getMainLinkageAngles(int angleFormat)

        Return angles of main linkages.Sorted from Body to tool, if no tool is mounted, last link will be tool mount.

      • getAngleData

         AngleData getAngleData(int link, int angleFormat, int axis)

        Retrieves the angle data of a specific link. Angles can be requested in degrees or radians,either relative the previous link (angleFormat requested as RADIANS_RELATIVE orDEGREES_RELATIVE) or relative the local coordinate system (angleFormat requested asRADIANS_ABSOLUTE or DEGREES_ABSOLUTE). Angles can be requested for one of the threecoordinate axes x, y, or z. Angles are returned as AngleData objects AngleData

        The following permissions are required to access angle data:

        • se.cpacsystems.permission.LINKAGE_ANGLE
        • se.cpacsystems.permission.LINKAGE_ANGLE_EXTENDED
        Parameters:
        link - the identifier of the requested link (see inherited fields from LinkageManager)
        angleFormat - an int with the format of the requested angle, RADIANS_RELATIVE,DEGREES_RELATIVE, RADIANS_ABSOLUTE or DEGREES_ABSOLUTE
        axis - an int with the requested axis of the angle, AXIS_X, AXIS_Y or AXIS_Z.
      • getAngleDataList

         List<AngleData> getAngleDataList(int angleFormat)

        Retrieves a List of AngleData objects, three (x-, y- and z-angles) for each link in thelinkage. The link order of the list is identical to that in the list returned from getLinkageConfigData, however all three angles of one link is grouped together. That is, theorder of the list is [link 1 x-angle, link 1 y-angle, link 1 z-angle, link 2 x-angle, ...link n x-angle, link n y-angle, link n z-angle].

        The following permissions are required to access angle data:

        • se.cpacsystems.permission.LINKAGE_ANGLE
        • se.cpacsystems.permission.LINKAGE_ANGLE_EXTENDED
        Parameters:
        angleFormat - an int with the format of the requested angle, RADIANS_RELATIVE,DEGREES_RELATIVE, RADIANS_ABSOLUTE or DEGREES_ABSOLUTE
      • getAngleDataList

         List<AngleData> getAngleDataList(int start, int stop, int angleFormat)

        Return angles in part of linkage.Sorted from inner to outer with three AngleData per link (X, Y, Z).

        Parameters:
        start - Start link.
        stop - Stop link.
        angleFormat - Format to return angle in, RADIANS_ABSOLUTE, RADIANS_RELATIVE, DEGREES_ABSOLUTE, DEGREES_RELATIVE
      • getLinkagePosition

         Point3D getLinkagePosition(int link)

        Returns the coordinates of the origin of the requested link in the local coordinate system.This is returned as a Point3D object, in which the following fields are defined:

        • x - (double) the x-coordinate in meters
        • y - (double) the y-coordinate in meters
        • z - (double) the z-coordinate in meters
        • sqi - (integer) the SQI of the point data

        Depending on linkage configuration, the following permissions can be requiredlinkage positions:

        • se.cpacsystems.permission.LINKAGE_POSITION_MAIN
        • se.cpacsystems.permission.LINKAGE_POSITION_GNSS
        • se.cpacsystems.permission.LINKAGE_POSITION_LASER
        • se.cpacsystems.permission.LINKAGE_POSITION_OTHER
        Parameters:
        link - the identifier of the requested link
      • getLinkagePositionList

         List<Point3D> getLinkagePositionList()

        Retrieves a List of Point3D objects, one for each link in the linkage. The link order of thelist is identical to that in the list returned from getLinkageConfigData.

      • getLinkagePositions

         List<Point3D> getLinkagePositions(int start, int stop)

        Return positions in part of linkage.Sorted from inner to outer.

        Parameters:
        start - Start link
        stop - Stop link
      • getLinkageIndex

         int getLinkageIndex(int link)

        Method to get a link's index in the lists from its identifier. This can be used to get a specifics link's datafrom the list i.e. getLinkageConfigDataList().get(getLinkageIndex(link)).

        Parameters:
        link - the linkage identifier, e.g.
      • setLaserMounted

         boolean setLaserMounted(boolean mounted)

        Set laser status