class documentation

class DobotSupliment: (source)

View In Hierarchy

Utility class for Dobot-related calculations.

Static Method calculate_pos_on_grid Calculates the absolute position on a grid from a starting point.
Static Method calculate_r Calculates the angle in degrees from the origin to the point (x, y).
def calculate_pos_on_grid(grid: Grid, start_x: float, start_y: float, distance_between_pos: float, dir_x: Direction, dir_y: Direction) -> tuple[float, float]: (source)

Calculates the absolute position on a grid from a starting point.

Combines the starting coordinates with the grid offset to find the resulting position in space.

Parameters
grid:GridThe grid object containing the current x and y positions.
start_x:floatThe starting x-coordinate in physical space. (float)
start_y:floatThe starting y-coordinate in physical space. (float)
distance_between_pos:floatThe distance between each grid cell. (float)
dir_x:DirectionUndocumented
dir_y:DirectionUndocumented
Returns
tuple[float, float]The resulting (x, y) position in physical space. (Tuple[float, float])
def calculate_r(x: float, y: float, offset: float = 0) -> float: (source)

Calculates the angle in degrees from the origin to the point (x, y).

Uses the arctangent function to determine the direction.

Parameters
x:floatThe x-coordinate of the point. (float)
y:floatThe y-coordinate of the point. (float)
offset:floatUndocumented
Returns
floatThe angle in degrees between the x-axis and the point (x, y). (float)