Class QState


  • public class QState
    extends java.lang.Object
    The configuration state of a work cell.

    The configuration state contains state data values for all
    valid StateData in a StateStructure. The validity is defined by the
    StateSetup.

    See Frame::getTransform() for the calculation of the relative transform
    of a frame for a given configuration state.

    Configuration states can be freely copied and assigned.

    The configuration state is a part of the StateStructure state (see
    State).
    • Constructor Summary

      Constructors 
      Constructor Description
      QState()
      Constructs an empty QState
      QState​(long cPtr, boolean cMemoryOwn)  
      QState​(StateSetupPtr setup)
      A configuration state.

      This constructor is not available for use outside of RobWork.
    • Constructor Detail

      • QState

        public QState​(long cPtr,
                      boolean cMemoryOwn)
      • QState

        public QState()
        Constructs an empty QState
      • QState

        public QState​(StateSetupPtr setup)
        A configuration state.

        This constructor is not available for use outside of RobWork. Instead
        your configuration states should be constructed via the copy
        constructor.

        Parameters:
        setup - [in] The shared setup for configuration states.
    • Method Detail

      • getCPtr

        public static long getCPtr​(QState obj)
      • delete

        public void delete()
      • setQ

        public void setQ​(StateData data,
                         double[] vals)
        Assign for frame the frame.getDOF() joint values of the
        array vals.

        The array vals must be of length at least frame.getDOF().

        Parameters:
        data - [in] The StateData for which the joint values are assigned.

        vals - [in] The joint values to assign.

        setQ() and getQ() are related as follows:
        q_state.setQ(frame, q_in); const double* q_out = q_state.getQ(frame); for (int i = 0; i frame.getDOF(); i++) q_in[i] == q_out[i];
      • multiply

        public QState multiply​(double scale)
        Scaling of a configuration state by a scalar.
      • divide

        public QState divide​(double scale)
        Scaling of a configuration state by division
      • add

        public QState add​(QState b)
        Addition of configuration states.
      • subtract

        public QState subtract​(QState b)
        Subtraction of configuration states.
      • negate

        public QState negate()
        Unary minus operator.
      • getStateSetup

        public StateSetupPtr getStateSetup()
        returns the StateSetup
      • size

        public long size()
        The dimension of the state vector.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • get

        public double get​(long i)
      • set

        public void set​(long i,
                        double d)