Class Device

  • Direct Known Subclasses:
    JointDevice, MobileDevice, SE3Device

    public class Device
    extends java.lang.Object
    An abstract device class

    The Device class is the basis for all other devices. It is assumed that all devices
    have a configuration which can be encoded by a Q, that all have a base frame
    representing where in the work cell they are located and a primary end frame. Notice that
    some devices may have multiple end-frames.
    • Constructor Summary

      Constructors 
      Constructor Description
      Device​(long cPtr, boolean cMemoryOwn)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Jacobian baseJend​(State state)
      Calculates the jacobian matrix of the end-effector described
      in the robot base frame ^{base}_{end}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

      Jacobian baseJframe​(Frame frame, State state)
      Calculates the jacobian matrix of a frame f described in the
      robot base frame ^{base}_{frame}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

      Jacobian baseJframes​(FrameVector frames, State state)
      The Jacobian for a sequence of frames.

      A Jacobian is computed for each of the frames and the Jacobians are
      stacked on top of eachother.
      Transform3Dd baseTend​(State state)
      Calculates the homogeneous transform from base to the end frame
      \robabx{base}{end}{\mathbf{T}}
      Transform3Dd baseTframe​(Frame f, State state)
      Calculates the homogeneous transform from base to a frame f
      \robabx{b}{f}{\mathbf{T}}
      void delete()  
      Q getAccelerationLimits()
      Returns the maximal acceleration of the joints
      \mathbf{\ddot{q}}_{max}\in \mathbb{R}^n

      It is assumed that \ddot{\mathbf{q}}_{min}=-\ddot{\mathbf{q}}_{max}

      Frame getBase()
      a method to return the frame of the base of the device.
      PairQ getBounds()
      Returns the upper \mathbf{q}_{min} \in \mathbb{R}^n and
      lower \mathbf{q}_{max} \in \mathbb{R}^n bounds of the joint space

      static long getCPtr​(Device obj)  
      long getDOF()
      Returns number of active joints
      Frame getEnd()
      a method to return the frame of the end of the device
      java.lang.String getName()
      Returns the name of the device
      PropertyMap getPropertyMap()
      Miscellaneous properties of the device.

      The property map of the device is provided to let the user store
      various settings for the device.
      Q getQ​(State state)
      Gets configuration vector \mathbf{q}\in \mathbb{R}^n

      Q getVelocityLimits()
      Returns the maximal velocity of the joints
      \mathbf{\dot{q}}_{max}\in \mathbb{R}^n

      It is assumed that \dot{\mathbf{q}}_{min}=-\dot{\mathbf{q}}_{max}

      void setAccelerationLimits​(Q acclimits)
      Sets the maximal acceleration of the joints
      \mathbf{\ddot{q}}_{max}\in \mathbb{R}^n

      It is assumed that \ddot{\mathbf{q}}_{min}=-\ddot{\mathbf{q}}_{max}

      void setBounds​(PairQ bounds)
      Sets the upper \mathbf{q}_{min} \in \mathbb{R}^n and
      lower \mathbf{q}_{max} \in \mathbb{R}^n bounds of the joint space

      void setName​(java.lang.String name)
      Sets the name of the Device
      void setQ​(Q q, State state)
      Sets configuration vector \mathbf{q} \in \mathbb{R}^n

      void setVelocityLimits​(Q vellimits)
      Sets the maximal velocity of the joints
      \mathbf{\dot{q}}_{max}\in \mathbb{R}^n

      It is assumed that \dot{\mathbf{q}}_{min}=-\dot{\mathbf{q}}_{max}

      Transform3Dd worldTbase​(State state)
      Calculates the homogeneous transform from world to base \robabx{w}{b}{\mathbf{T}}

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Device

        public Device​(long cPtr,
                      boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(Device obj)
      • delete

        public void delete()
      • setQ

        public void setQ​(Q q,
                         State state)
        Sets configuration vector \mathbf{q} \in \mathbb{R}^n

        Parameters:
        q - [in] configuration vector \mathbf{q}
        state - [in] state into which to set \mathbf{q}

      • getQ

        public Q getQ​(State state)
        Gets configuration vector \mathbf{q}\in \mathbb{R}^n

        Parameters:
        state - [in] state from which which to get \mathbf{q}
        Returns:
        configuration vector \mathbf{q}
      • getBounds

        public PairQ getBounds()
        Returns the upper \mathbf{q}_{min} \in \mathbb{R}^n and
        lower \mathbf{q}_{max} \in \mathbb{R}^n bounds of the joint space

        Returns:
        std::pair containing (\mathbf{q}_{min}, \mathbf{q}_{max})
      • setBounds

        public void setBounds​(PairQ bounds)
        Sets the upper \mathbf{q}_{min} \in \mathbb{R}^n and
        lower \mathbf{q}_{max} \in \mathbb{R}^n bounds of the joint space

        Parameters:
        bounds - [in] std::pair containing
        (\mathbf{q}_{min}, \mathbf{q}_{max})
      • getVelocityLimits

        public Q getVelocityLimits()
        Returns the maximal velocity of the joints
        \mathbf{\dot{q}}_{max}\in \mathbb{R}^n

        It is assumed that \dot{\mathbf{q}}_{min}=-\dot{\mathbf{q}}_{max}

        Returns:
        the maximal velocity
      • setVelocityLimits

        public void setVelocityLimits​(Q vellimits)
        Sets the maximal velocity of the joints
        \mathbf{\dot{q}}_{max}\in \mathbb{R}^n

        It is assumed that \dot{\mathbf{q}}_{min}=-\dot{\mathbf{q}}_{max}

        Parameters:
        vellimits - [in] rw::math::Q with the maximal velocity
      • getAccelerationLimits

        public Q getAccelerationLimits()
        Returns the maximal acceleration of the joints
        \mathbf{\ddot{q}}_{max}\in \mathbb{R}^n

        It is assumed that \ddot{\mathbf{q}}_{min}=-\ddot{\mathbf{q}}_{max}

        Returns:
        the maximal acceleration
      • setAccelerationLimits

        public void setAccelerationLimits​(Q acclimits)
        Sets the maximal acceleration of the joints
        \mathbf{\ddot{q}}_{max}\in \mathbb{R}^n

        It is assumed that \ddot{\mathbf{q}}_{min}=-\ddot{\mathbf{q}}_{max}

        Parameters:
        acclimits - [in] the maximal acceleration
      • getDOF

        public long getDOF()
        Returns number of active joints
        Returns:
        number of active joints n
      • getName

        public java.lang.String getName()
        Returns the name of the device
        Returns:
        name of the device
      • setName

        public void setName​(java.lang.String name)
        Sets the name of the Device
        Parameters:
        name - [in] the new name of the frame
      • getBase

        public Frame getBase()
        a method to return the frame of the base of the device.
        Returns:
        the base frame
      • getEnd

        public Frame getEnd()
        a method to return the frame of the end of the device
        Returns:
        the end frame
      • baseTframe

        public Transform3Dd baseTframe​(Frame f,
                                       State state)
        Calculates the homogeneous transform from base to a frame f
        \robabx{b}{f}{\mathbf{T}}
        Returns:
        the homogeneous transform \robabx{b}{f}{\mathbf{T}}
      • baseTend

        public Transform3Dd baseTend​(State state)
        Calculates the homogeneous transform from base to the end frame
        \robabx{base}{end}{\mathbf{T}}
        Returns:
        the homogeneous transform \robabx{base}{end}{\mathbf{T}}
      • worldTbase

        public Transform3Dd worldTbase​(State state)
        Calculates the homogeneous transform from world to base \robabx{w}{b}{\mathbf{T}}

        Returns:
        the homogeneous transform \robabx{w}{b}{\mathbf{T}}
      • baseJend

        public Jacobian baseJend​(State state)
        Calculates the jacobian matrix of the end-effector described
        in the robot base frame ^{base}_{end}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

        Parameters:
        state - [in] State for which to calculate the Jacobian

        Returns:
        the 6*ndof jacobian matrix: {^{base}_{end}}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

        This method calculates the jacobian relating joint velocities ( \mathbf{\dot{q}} ) to the end-effector velocity seen from
        base-frame ( \nu^{ase}_{end} )

        \nu^{base}_{end} = {^{base}_{end}}\mathbf{J}_\mathbf{q}(\mathbf{q})\mathbf{\dot{q}}


        The jacobian matrix {^{base}_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q})
        is defined as:

        {^{base}_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) = \frac{\partial ^{base}\mathbf{x}_n}{\partial \mathbf{q}}

        Where:
        {^{base}_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) = \left[ \begin{array}{cccc} {^{base}_1}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) {^{base}_2}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) \cdots {^b_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) \\ \end{array} \right]
        where {^{base}_i}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) is defined by
        {^{base}_i}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) = \begin{array}{cc} \left[ \begin{array}{c} {^{base}}\mathbf{z}_i \times {^{i}\mathbf{p}_n} \\ {^{base}}\mathbf{z}_i \\ \end{array} \right] \textrm{revolute joint} \end{array}
        {^{base}_i}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) = \begin{array}{cc} \left[ \begin{array}{c} {^{base}}\mathbf{z}_i \\ \mathbf{0} \\ \end{array} \right] \textrm{prismatic joint} \\ \end{array}

        By default the method forwards to baseJframe().
      • baseJframe

        public Jacobian baseJframe​(Frame frame,
                                   State state)
        Calculates the jacobian matrix of a frame f described in the
        robot base frame ^{base}_{frame}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

        Parameters:
        frame - [in] Frame for which to calculate the Jacobian
        state - [in] State for which to calculate the Jacobian

        Returns:
        the 6*ndof jacobian matrix: {^{base}_{frame}}\mathbf{J}_{\mathbf{q}}(\mathbf{q})

        This method calculates the jacobian relating joint velocities ( \mathbf{\dot{q}} ) to the frame f velocity seen from base-frame
        ( \nu^{base}_{frame} )

        \nu^{base}_{frame} = {^{base}_{frame}}\mathbf{J}_\mathbf{q}(\mathbf{q})\mathbf{\dot{q}}


        The jacobian matrix {^{base}_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q})
        is defined as:

        {^{base}_n}\mathbf{J}_{\mathbf{q}}(\mathbf{q}) = \frac{\partial ^{base}\mathbf{x}_n}{\partial \mathbf{q}}

        By default the method forwards to baseJframes().
      • baseJframes

        public Jacobian baseJframes​(FrameVector frames,
                                    State state)
        The Jacobian for a sequence of frames.

        A Jacobian is computed for each of the frames and the Jacobians are
        stacked on top of eachother.
        Parameters:
        frames - [in] the frames to calculate the frames from
        state - [in] the state to calculate in
        Returns:
        the jacobian
      • getPropertyMap

        public PropertyMap getPropertyMap()
        Miscellaneous properties of the device.

        The property map of the device is provided to let the user store
        various settings for the device. The settings are typically loaded
        from setup files.

        The low-level manipulations of the property map can be cumbersome. To
        ease these manipulations, the PropertyAccessor utility class has been
        provided. Instances of this class are provided for a number of common
        settings, however it is undecided if these properties are a public
        part of RobWork.

        Returns:
        The property map of the device.