Class ToolRange

Class Documentation

class ToolRange

struct to keep tool range.

Public Types

enum ToolRangeType

This enumerator defines the type of tool range shapes.

Values:

enumerator ToolRangeNone

No Tool Range.

enumerator ToolRangeSquare

square shape

enumerator ToolRangeSphere

sphere shape

enumerator ToolRangeCylinder

cylinder shape

enumerator ToolRangeSquareOutside

invert of square shape

enumerator ToolRangeSphereOutside

invert of sphere shape

enumerator ToolRangeCylinderOutside

invert of cylinder shape

Public Functions

inline ToolRange()

Constructor to initialize an ToolRange object with default parameters.

inline bool SetSquareRange(double minPosX, double maxPosX, double minPosY, double maxPosY, double minPosZ, double maxPosZ, bool isOutSideRange)

Sets a rectangular (cuboid) range for tool motion constraints.

Defines a rectangular boundary in 3D space that constrains the tool’s movement. The range is specified by minimum and maximum coordinates along each axis (X, Y, Z). The function validates that maximum values are greater than minimum values.

Note

The range affects tool motion planning and validation. Motion commands will be constrained according to the defined range and isOutSideRange setting.

Parameters:
  • minPosX[in] Minimum position along X-axis

  • maxPosX[in] Maximum position along X-axis (must be > minPosX)

  • minPosY[in] Minimum position along Y-axis

  • maxPosY[in] Maximum position along Y-axis (must be > minPosY)

  • minPosZ[in] Minimum position along Z-axis

  • maxPosZ[in] Maximum position along Z-axis (must be > minPosZ)

  • isOutSideRange[in] If true, tool is restricted to move outside the defined range. If false, tool is restricted to move inside the defined range.

Returns:

true if range was set successfully (all max values > corresponding min values), false if validation fails (any max value <= corresponding min value)

inline bool SetSphereRange(double centerPosX, double centerPosY, double centerPosZ, double radius, bool isOutSideRange)

Sets a spherical range for tool motion constraints.

Defines a spherical boundary that constrains the tool’s movement. The sphere is defined by its center point in 3D space and its radius. The constraint can be applied either inside or outside the sphere.

Note

The spherical range is useful for creating radial workspace boundaries or for defining spherical keep-out zones around obstacles.

Parameters:
  • centerPosX[in] X-coordinate of the sphere’s center

  • centerPosY[in] Y-coordinate of the sphere’s center

  • centerPosZ[in] Z-coordinate of the sphere’s center

  • radius[in] Radius of the sphere (must be > 0)

  • isOutSideRange[in] If true, tool is restricted to move outside the sphere. If false, tool is restricted to move inside the sphere.

Returns:

true if range was set successfully (radius > 0), false if validation fails (radius <= 0)

inline bool SetCylinderRange(double centerPosX, double centerPosY, double radius, double maxPosZ, double minPosZ, bool isOutSideRange)

Sets a cylindrical range for tool motion constraints.

Defines a cylindrical boundary that constrains the tool’s movement. The cylinder is defined by its central axis (parallel to Z-axis), base center point (X,Y coordinates), radius, and height range (Z limits).

Note

Cylindrical ranges are particularly useful for defining workspace boundaries around circular work areas or for creating cylindrical keep-out zones.

Parameters:
  • centerPosX[in] X-coordinate of the cylinder’s central axis

  • centerPosY[in] Y-coordinate of the cylinder’s central axis

  • radius[in] Radius of the cylinder (must be > 0)

  • maxPosZ[in] Maximum Z-coordinate (upper limit) of the cylinder

  • minPosZ[in] Minimum Z-coordinate (lower limit) of the cylinder (must be < maxPosZ)

  • isOutSideRange[in] If true, tool is restricted to move outside the cylinder. If false, tool is restricted to move inside the cylinder.

Returns:

true if range was set successfully (radius > 0 and maxPosZ > minPosZ), false if validation fails (radius <= 0 or maxPosZ <= minPosZ)

inline void Clear()

Clears all tool range constraints and resets to default state.

Resets all range-related parameters to their default values:

  • Sets tool range type to ToolRangeNone

  • Resets all position points to origin (0,0,0)

  • Sets all dimensional parameters (radii, limits) to 0

Note

This function effectively removes all movement constraints, allowing unrestricted tool motion within the robot’s mechanical limits.

Public Members

ToolRangeType toolRangeType

flag representing shapes contained.

coordinate::Point3d maxToolPosition

corner point of the square (maximum)

coordinate::Point3d minToolPosition

corner point of the square (minimum)

coordinate::Point3d sphereCenterPos

center of the sphere

double sphereRadius

radius of the sphere

coordinate::Point3d cylinderCenterPos

center of the cylinder

double cylinderRadius

radius of the cylinder

double cylinderMaxZ

upper limit of the cylinder z value

double cylinderMinZ

lower limit of the cylinder z value