nav2_simple_commander.line_iterator module
This is a Python3 API for a line iterator.
It provides the ability to iterate through the points of a line.
- class nav2_simple_commander.line_iterator.LineIterator(x0: float, y0: float, x1: float, y1: float, step_size: float = 1.0)
Bases:
objectLineIterator.
LineIterator Python3 API for iterating along the points of a given line
- advance() → None
Advance to the next point in the line.
- clamp(n: float, min_n: float, max_n: float) → float
Clamp n to be between min_n and max_n.
Args
n (float): input value min_n (float): minimum value max_n (float): maximum value
Returns
n (float): input value clamped between given min and max
- getX() → float
Get the abscissa of the current point.
- getX0() → float
Get the abscissa of the initial point.
- getX1() → float
Get the abscissa of the final point.
- getY() → float
Get the ordinate of the current point.
- getY0() → float
Get the ordinate of the initial point.
- getY1() → float
Get the ordinate of the final point.
- get_line_length() → complex
Get the length of the line.
- isValid() → bool
Check if line is valid.