utility
Utility functions for Walkers
Also known as WalkerUtility.
This module aims to standardize and simplify the study of walking mechanisms.
It contains useful functions that make study of planar mechanisms easy.
Created on Sat Nov 17 2018 20:35:39.
@author: HugoFara
- leggedsnake.utility.ggb_extractor(file_path)
Take data from GeoGebra file, and return them as a dictionary.
Each element of the dictionary is a slider in the file. Name and value of items are the same as in the GeoGebra file.
- leggedsnake.utility.step(points, height, width, return_res=False, y_min=None, acc=[])
Return if a step can cross an obstacle during locus.
- Parameters:
points (
list
oflist
offloat
) – locus as a list of point coordinates.height (float) – obstacle’s height
width (float) – obstacle’s width
return_res (bool, optional) – If True: return the set of points that pass obstacle (slower). If False: return if the obstacle can be passed. The default is False.
y_min (float, optional) – Lowest ordinate in the locus (faster if provided).
acc (list, optional) – A subset of this locus that is able to cross. For internal use only.
- Returns:
If return_res is False, return True if the locus can cross, False otherwise. If return_res is True, return the subset of point that is able to cross, and False if we can’t cross.
- Return type:
Union[bool, list[list[float]]]]
- leggedsnake.utility.stride(point, height)
Return length of higher “step” in the locus.
A step is a set of points of the locus, adjacents, with limited height difference, and containing the lowest point of the locus.
Please not that a step cannot be inclined. The result can be irrelevant for locus containing Diracs.