Wrapper class to manage the Burst IK calculator with persistent NativeArrays. More...
Public Member Functions | |
| void | EnsureArraySize () |
| Resizes the NativeArrays if TotalSeedCount has grown beyond the allocated size. | |
| float | GetSolution (int solution, int axis) |
| void | SetSolution (int solution, int axis, float value) |
| bool | IsNotReachable (int solution) |
| void | SetNotReachable (int solution, bool value) |
| void | CalcPosition (Vector3 position, Quaternion rotation) |
| Calculate IK solutions using Burst-compiled job. | |
| JobHandle | ScheduleCalcPosition (Vector3 position, Quaternion rotation, JobHandle dependency=default) |
| Schedule IK calculation as a job (for async execution). | |
| void | SetWarmStart (float[] angles) |
| Sets the warm-start joint angles from the previous frame's best solution. | |
| void | ClearWarmStart () |
| Clears the warm-start state, forcing Pieper as initial guess on the next solve. | |
| float[] | GetSolutionAngles (int solution) |
| Returns the 6 joint angles (degrees) for the given solution index. | |
| Vector3 Quaternion rot | ComputeTCPPosition (float[] jointAngles) |
| void | Dispose () |
Public Attributes | |
| double | alpha1 |
| double | alpha2 |
| double | b |
| double | c1 |
| double | c2 |
| double | c3 |
| double | c4 |
| bool | ElbowInUnityX |
| Vector3 | ToolOffset |
| bool | IsNonSphericalWrist |
| Enable Newton-Raphson refinement for non-spherical wrist cobots. | |
| int | NRMaxIterations |
| Maximum Newton-Raphson iterations. | |
| float | NRTolerance |
| Position tolerance in meters for NR convergence (0.01mm) | |
| float | NRDamping |
| DLS damping factor lambda. | |
| float | NRAngularWeight |
| Weight for orientation vs position in NR solver. | |
| float | NROrientationTolerance |
| Orientation convergence tolerance in radians (0.57 degrees) | |
| int | NumMirrorSeeds |
| Number of mirrored wrist-flip seeds (0 or 8); set by RobotIK based on MirrorSeeds checkbox. | |
| int | NumHaltonSeeds |
| Number of Halton low-discrepancy fallback seeds (0..K); set by RobotIK. | |
| float[] | HaltonMin |
| Minimum joint angle per axis for Halton seed range. | |
| float[] | HaltonMax |
| Maximum joint angle per axis for Halton seed range. | |
| bool | HasWarmStart |
| True after first successful solve, enables warm-start path. | |
| Vector3[] | AxisHomePos |
| Home local positions per axis. | |
| Quaternion[] | AxisHomeRot |
| Home local rotations per axis. | |
| Vector3[] | AxisDir |
| Rotation axis direction per axis (sign-corrected) | |
| Vector3 | TCPLocalOffset |
| TCP offset relative to axis 5 in axis 5 local frame. | |
| Quaternion | TCPLocalRot |
| TCP rotation relative to axis 5. | |
| bool | EnableDiagnostics |
| Enable NR convergence logging. | |
| double | d4 |
| double | d5 |
| double | a5 |
| double | a6 |
| Vector3 | pos |
| Computes TCP position and rotation from joint angles using numerical FK. | |
Properties | |
| Vector3 | LastPosition [get] |
| Last input position for debug logging. | |
| int | TotalSeedCount [get] |
Detailed Description
Wrapper class to manage the Burst IK calculator with persistent NativeArrays.
Provides a managed interface to the Burst-compiled IKCalculatorJob, handling allocation and lifetime of NativeArrays. Supports both synchronous (Run) and asynchronous (Schedule) execution. For non-spherical wrist robots, the Pieper solution is refined with Newton-Raphson iterations.
Key Features:
- Persistent NativeArray allocation (allocated once, reused across frames)
- Direct accessor methods to avoid managed array copies
- Support for both synchronous and asynchronous IK calculation
- Newton-Raphson refinement for non-spherical cobot wrists
For detailed documentation see: https://doc.realvirtual.io/components-and-scripts/motion/robot-inverse-kinematics
Member Function Documentation
◆ CalcPosition()
| void realvirtual.IKCalculatorBurst.CalcPosition | ( | Vector3 | position, |
| Quaternion | rotation | ||
| ) |
Calculate IK solutions using Burst-compiled job.
◆ ClearWarmStart()
| void realvirtual.IKCalculatorBurst.ClearWarmStart | ( | ) |
Clears the warm-start state, forcing Pieper as initial guess on the next solve.
◆ EnsureArraySize()
| void realvirtual.IKCalculatorBurst.EnsureArraySize | ( | ) |
Resizes the NativeArrays if TotalSeedCount has grown beyond the allocated size.
Must be called when NumMirrorSeeds or NumHaltonSeeds changes, BEFORE scheduling a job. Completes any pending job first to ensure safe disposal of existing arrays.
◆ GetSolutionAngles()
| float[] realvirtual.IKCalculatorBurst.GetSolutionAngles | ( | int | solution | ) |
Returns the 6 joint angles (degrees) for the given solution index.
◆ ScheduleCalcPosition()
| JobHandle realvirtual.IKCalculatorBurst.ScheduleCalcPosition | ( | Vector3 | position, |
| Quaternion | rotation, | ||
| JobHandle | dependency = default |
||
| ) |
Schedule IK calculation as a job (for async execution).
EnsureArraySize() must be called by the caller BEFORE scheduling (cannot be called after Schedule because that would require completing the pending job first).
◆ SetWarmStart()
| void realvirtual.IKCalculatorBurst.SetWarmStart | ( | float[] | angles | ) |
Sets the warm-start joint angles from the previous frame's best solution.
These angles will be used as initial guess for Newton-Raphson on the next frame.
Member Data Documentation
◆ AxisDir
| Vector3 [] realvirtual.IKCalculatorBurst.AxisDir |
Rotation axis direction per axis (sign-corrected)
◆ AxisHomePos
| Vector3 [] realvirtual.IKCalculatorBurst.AxisHomePos |
Home local positions per axis.
◆ AxisHomeRot
| Quaternion [] realvirtual.IKCalculatorBurst.AxisHomeRot |
Home local rotations per axis.
◆ EnableDiagnostics
| bool realvirtual.IKCalculatorBurst.EnableDiagnostics |
Enable NR convergence logging.
◆ HaltonMax
| float [] realvirtual.IKCalculatorBurst.HaltonMax |
Maximum joint angle per axis for Halton seed range.
◆ HaltonMin
| float [] realvirtual.IKCalculatorBurst.HaltonMin |
Minimum joint angle per axis for Halton seed range.
◆ HasWarmStart
| bool realvirtual.IKCalculatorBurst.HasWarmStart |
True after first successful solve, enables warm-start path.
◆ IsNonSphericalWrist
| bool realvirtual.IKCalculatorBurst.IsNonSphericalWrist |
Enable Newton-Raphson refinement for non-spherical wrist cobots.
◆ NRAngularWeight
| float realvirtual.IKCalculatorBurst.NRAngularWeight |
Weight for orientation vs position in NR solver.
◆ NRDamping
| float realvirtual.IKCalculatorBurst.NRDamping |
DLS damping factor lambda.
◆ NRMaxIterations
| int realvirtual.IKCalculatorBurst.NRMaxIterations |
Maximum Newton-Raphson iterations.
◆ NROrientationTolerance
| float realvirtual.IKCalculatorBurst.NROrientationTolerance |
Orientation convergence tolerance in radians (0.57 degrees)
◆ NRTolerance
| float realvirtual.IKCalculatorBurst.NRTolerance |
Position tolerance in meters for NR convergence (0.01mm)
◆ NumHaltonSeeds
| int realvirtual.IKCalculatorBurst.NumHaltonSeeds |
Number of Halton low-discrepancy fallback seeds (0..K); set by RobotIK.
Total seed count = 8 (Pieper base) + NumMirrorSeeds + NumHaltonSeeds
◆ NumMirrorSeeds
| int realvirtual.IKCalculatorBurst.NumMirrorSeeds |
Number of mirrored wrist-flip seeds (0 or 8); set by RobotIK based on MirrorSeeds checkbox.
◆ pos
| Vector3 realvirtual.IKCalculatorBurst.pos |
Computes TCP position and rotation from joint angles using numerical FK.
Wraps the Burst job's ComputeFK for test verifiability.
◆ TCPLocalOffset
| Vector3 realvirtual.IKCalculatorBurst.TCPLocalOffset |
TCP offset relative to axis 5 in axis 5 local frame.
◆ TCPLocalRot
| Quaternion realvirtual.IKCalculatorBurst.TCPLocalRot |
TCP rotation relative to axis 5.
Property Documentation
◆ LastPosition
|
get |
Last input position for debug logging.