Package org.robwork.sdurw
Class QState
- java.lang.Object
-
- org.robwork.sdurw.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 QStateQState(long cPtr, boolean cMemoryOwn)
QState(StateSetupPtr setup)
A configuration state.
This constructor is not available for use outside of RobWork.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QState
add(QState b)
Addition of configuration states.void
delete()
QState
divide(double scale)
Scaling of a configuration state by divisiondouble
get(long i)
static long
getCPtr(QState obj)
StateSetupPtr
getStateSetup()
returns the StateSetupQState
multiply(double scale)
Scaling of a configuration state by a scalar.QState
negate()
Unary minus operator.void
set(long i, double d)
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().
long
size()
The dimension of the state vector.QState
subtract(QState b)
Subtraction of configuration states.java.lang.String
toString()
-
-
-
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
-
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 classjava.lang.Object
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
-