Package org.robwork.sdurw_math
Class Wrench6D
- java.lang.Object
-
- org.robwork.sdurw_math.Wrench6D
-
public class Wrench6D extends java.lang.Object
Class for representing 6 degrees of freedom wrenches.
\mathbf{\nu} = \left[ \begin{array}{c} f_x\\ f_y\\ f_z\\ \tau_x\\ \tau_y\\ \tau_z \end{array} \right]
A Wrench is the description of a frames linear force and rotational torque
with respect to some reference frame.
-
-
Constructor Summary
Constructors Constructor Description Wrench6D()
Default Constructor.Wrench6D(double fx, double fy, double fz, double tx, double ty, double tz)
Constructs a 6 degrees of freedom velocity screw
Wrench6D(long cPtr, boolean cMemoryOwn)
Wrench6D(Vector3D force, Vector3D torque)
Constructs a wrench from a force and torque
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Wrench6D
add(Wrench6D rhs)
Adds two wrenches together \mathbf{w}_{12}=\mathbf{w}_1+\mathbf{w}_2
Wrench6D
addAssign(Wrench6D wrench)
Adds the wrench given as a parameter to the wrench.
Assumes the wrenches are represented in the same coordinate system.
void
delete()
EigenVector6d
e()
Converter to Eigen data typeboolean
equals(Wrench6D b)
Compares a and b for equality.Vector3D
force()
Extracts the force
double
get(long i)
static long
getCPtr(Wrench6D obj)
Wrench6D
multiply(double s)
Scales wrench and returns scaled versionWrench6D
multiplyAssign(double s)
Scales wrench with s
double
norm1()
Takes the 1-norm of the wrench.double
norm2()
Takes the 2-norm of the wrench.double
normInf()
Takes the infinite norm of the wrench.boolean
notEqual(Wrench6D b)
Compares a and b for inequality.void
set(long i, double d)
void
setForce(Vector3D force)
Sets the force component
void
setTorque(Vector3D torque)
Sets the torque component
Wrench6D
subtract(Wrench6D rhs)
Subtracts two velocity screws
\mathbf{\nu}_{12}=\mathbf{\nu}_1-\mathbf{\nu}_2
Wrench6D
subtractAssign(Wrench6D wrench)
Subtracts the wrench given as a parameter from the wrench.
Assumes the wrenches are represented in the same coordinate system.
Vector3D
torque()
Extracts the torque and represents it using an Vector3D<T>
java.lang.String
toString()
-
-
-
Constructor Detail
-
Wrench6D
public Wrench6D(long cPtr, boolean cMemoryOwn)
-
Wrench6D
public Wrench6D(double fx, double fy, double fz, double tx, double ty, double tz)
Constructs a 6 degrees of freedom velocity screw
- Parameters:
fx
- [in] f_xfy
- [in] f_yfz
- [in] f_ztx
- [in] \tau_xty
- [in] \tau_ytz
- [in] \tau_z
-
Wrench6D
public Wrench6D()
Default Constructor. Initialized the wrench to 0
-
-
Method Detail
-
getCPtr
public static long getCPtr(Wrench6D obj)
-
delete
public void delete()
-
setForce
public void setForce(Vector3D force)
Sets the force component
- Parameters:
force
- [in] linear force
-
setTorque
public void setTorque(Vector3D torque)
Sets the torque component
- Parameters:
torque
- [in] angular torque
-
force
public Vector3D force()
Extracts the force
- Returns:
- the force
-
torque
public Vector3D torque()
Extracts the torque and represents it using an Vector3D<T>
- Returns:
- the torque
-
get
public double get(long i)
-
set
public void set(long i, double d)
-
addAssign
public Wrench6D addAssign(Wrench6D wrench)
Adds the wrench given as a parameter to the wrench.
Assumes the wrenches are represented in the same coordinate system.
- Parameters:
wrench
- [in] Wrench to add
- Returns:
- reference to the Wrench6D to support additional assignments.
-
subtractAssign
public Wrench6D subtractAssign(Wrench6D wrench)
Subtracts the wrench given as a parameter from the wrench.
Assumes the wrenches are represented in the same coordinate system.
- Parameters:
wrench
- [in] Velocity screw to subtract
- Returns:
- reference to the Wrench6D to support additional
assignments.
-
multiplyAssign
public Wrench6D multiplyAssign(double s)
Scales wrench with s
- Parameters:
s
- [in] scaling value
- Returns:
- reference to the Wrench6D to support additional
assigments
-
multiply
public Wrench6D multiply(double s)
Scales wrench and returns scaled version- Parameters:
s
- [in] scaling value- Returns:
- Scaled wrench
-
add
public Wrench6D add(Wrench6D rhs)
Adds two wrenches together \mathbf{w}_{12}=\mathbf{w}_1+\mathbf{w}_2
- Parameters:
rhs
- [in] \mathbf{\nu}_1
- Returns:
- the wrench \mathbf{w}_{12}
-
subtract
public Wrench6D subtract(Wrench6D rhs)
Subtracts two velocity screws
\mathbf{\nu}_{12}=\mathbf{\nu}_1-\mathbf{\nu}_2
- Parameters:
rhs
- [in] \mathbf{w}_1- Returns:
- the wrench \mathbf{w}_{12}
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
norm1
public double norm1()
Takes the 1-norm of the wrench. All elements both
force and torque are given the same weight.- Returns:
- the 1-norm
-
norm2
public double norm2()
Takes the 2-norm of the wrench. All elements both
force and torque are given the same weight- Returns:
- the 2-norm
-
normInf
public double normInf()
Takes the infinite norm of the wrench. All elements
both force and torque are given the same weight.
- Returns:
- the infinite norm
-
e
public EigenVector6d e()
Converter to Eigen data type
-
equals
public boolean equals(Wrench6D b)
Compares a and b for equality.- Parameters:
b
- [in] other wrench to compare with.- Returns:
- True if a equals b, false otherwise.
-
notEqual
public boolean notEqual(Wrench6D b)
Compares a and b for inequality.- Parameters:
b
- [in] other wrench to compare with.- Returns:
- True if a and b are different, false otherwise.
-
-