RoboDK Plug-In Interface
Loading...
Searching...
No Matches
Joints Class Reference

The Joints class represents a joint position of a robot (robot axes). More...

#include <joints.h>

Public Member Functions

 Joints ()
 Joints.
 
 Joints (int ndofs)
 Joints.
 
 Joints (const double *joints, int ndofs=0)
 Set joint values given a double array and the number of joint values.
 
 Joints (const float *joints, int ndofs=0)
 Set joint values given a float array and the number of joint values.
 
 Joints (const Joints &joints)=default
 Create a copy of an object.
 
Jointsoperator= (const Joints &joints)=default
 
 Joints (const legacy::Matrix2D *mat2d, int column=0, int ndofs=-1)
 Create joint values given a 2D matrix and the column selecting the desired values.
 
 Joints (const QString &str)
 Convert a string to joint values.
 
const double * ValuesD () const
 Joint values.
 
const float * ValuesF () const
 Joint values.
 
const double * Values () const
 Joint values.
 
double Compare (const Joints &other) const
 
double * Data ()
 
int Length () const
 Number of joint axes of the robot (or degrees of freedom)
 
void setLength (int new_length)
 Set the length of the array (only shrinking the array is allowed)
 
bool Valid ()
 Check if the joints are valid. For example, when we request the Inverse kinematics and there is no solution the joints will not be valid. (for example, an invalid result after calling class: IItem::SolveIK returns a non valid joints)
 
int GetValues (double *joints)
 GetValues.
 
void SetValues (const double *joints, int ndofs=-1)
 Set the joint values in deg or mm. You can also important provide the number of degrees of freedom (6 for a 6 axis robot).
 
void SetValues (const float *joints, int ndofs=-1)
 Set the joint values in deg or mm (floats). You can also important provide the number of degrees of freedom (6 for a 6 axis robot).
 

Public Attributes

int _dofCount
 number of degrees of freedom
 
double _joints [MaximumJoints]
 joint values (doubles, used to store the joint values)
 
float _jointsFloat [MaximumJoints]
 joint values (floats, used to return a copy as a float pointer)
 

Static Public Attributes

static constexpr int MaximumJoints = 12
 

Detailed Description

The Joints class represents a joint position of a robot (robot axes).

Definition at line 50 of file joints.h.

Constructor & Destructor Documentation

◆ Joints() [1/7]

Joints ( )

Joints.

Definition at line 43 of file joints.cpp.

◆ Joints() [2/7]

Joints ( int ndofs)
explicit

Joints.

Parameters
ndofsnumber of robot joint axes or degrees of freedom

Definition at line 50 of file joints.cpp.

◆ Joints() [3/7]

Joints ( const double * joints,
int ndofs = 0 )

Set joint values given a double array and the number of joint values.

Parameters
jointsPointer to the joint values
ndofsNumber of joints

Definition at line 59 of file joints.cpp.

◆ Joints() [4/7]

Joints ( const float * joints,
int ndofs = 0 )

Set joint values given a float array and the number of joint values.

Parameters
jointsPointer to the joint values
ndofsNumber of joints

Definition at line 64 of file joints.cpp.

◆ Joints() [5/7]

Joints ( const Joints & joints)
default

Create a copy of an object.

Parameters
jnts

◆ Joints() [6/7]

Joints ( const legacy::Matrix2D * mat2d,
int column = 0,
int ndofs = -1 )

Create joint values given a 2D matrix and the column selecting the desired values.

Parameters
mat2d
column
ndofs

Definition at line 76 of file joints.cpp.

◆ Joints() [7/7]

Joints ( const QString & str)

Convert a string to joint values.

Parameters
strComma separated joint values (spaces or tabs are also accepted)

Definition at line 92 of file joints.cpp.

Member Function Documentation

◆ Compare()

double Compare ( const Joints & other) const

Definition at line 125 of file joints.cpp.

◆ Data()

double * Data ( )
Returns
Data same as Values. The only difference is that the array pointer is not const. This is provided for backwards compatibility.

Definition at line 135 of file joints.cpp.

◆ GetValues()

int GetValues ( double * joints)

GetValues.

Parameters
jointsjoint values in deg or mm
Returns
returns the number of degrees of freedom

Definition at line 184 of file joints.cpp.

◆ Length()

int Length ( ) const

Number of joint axes of the robot (or degrees of freedom)

Returns

Definition at line 140 of file joints.cpp.

◆ setLength()

void setLength ( int new_length)

Set the length of the array (only shrinking the array is allowed)

Definition at line 145 of file joints.cpp.

◆ SetValues() [1/2]

void SetValues ( const double * joints,
int ndofs = -1 )

Set the joint values in deg or mm. You can also important provide the number of degrees of freedom (6 for a 6 axis robot).

Parameters
jointsjoint values in deg or mm
ndofsnumber of degrees of freedom (number of axes or joints)

Definition at line 158 of file joints.cpp.

◆ SetValues() [2/2]

void SetValues ( const float * joints,
int ndofs = -1 )

Set the joint values in deg or mm (floats). You can also important provide the number of degrees of freedom (6 for a 6 axis robot).

Parameters
jointsjoint values in deg or mm
ndofsnumber of degrees of freedom (number of axes or joints)

Definition at line 171 of file joints.cpp.

◆ Valid()

bool Valid ( )

Check if the joints are valid. For example, when we request the Inverse kinematics and there is no solution the joints will not be valid. (for example, an invalid result after calling class: IItem::SolveIK returns a non valid joints)

Returns
true if it has 1 degree of freedom or more

Definition at line 153 of file joints.cpp.

◆ Values()

const double * Values ( ) const

Joint values.

Returns
Returns a pointer to the joint data array (doubles or floats if ROBODK_API_FLOATS is defined)

Definition at line 119 of file joints.cpp.

◆ ValuesD()

const double * ValuesD ( ) const

Joint values.

Returns
Returns a pointer to the joint data array (doubles)

Definition at line 98 of file joints.cpp.

◆ ValuesF()

const float * ValuesF ( ) const

Joint values.

Returns
Returns a pointer to the joint data array (floats)

Definition at line 103 of file joints.cpp.

Member Data Documentation

◆ _dofCount

int _dofCount

number of degrees of freedom

Definition at line 162 of file joints.h.

◆ _joints

double _joints[MaximumJoints]

joint values (doubles, used to store the joint values)

Definition at line 165 of file joints.h.

◆ _jointsFloat

float _jointsFloat[MaximumJoints]
mutable

joint values (floats, used to return a copy as a float pointer)

Definition at line 168 of file joints.h.

◆ MaximumJoints

int MaximumJoints = 12
staticconstexpr

Definition at line 159 of file joints.h.


The documentation for this class was generated from the following files: