olsonk / pyRosita

0 stars 0 forks source link

check_timing function's purpose is unclear #5

Closed olsonk closed 6 years ago

olsonk commented 6 years ago

Document what the function does and why.

olsonk commented 6 years ago

Added documentation to explain its implementation and use. See this commit.

I'm still not 100% happy with this function, though. Different parts take different amounts of time to move, and they each have different ranges. This function does not account for these differences. For example, Torso.turn does not have a big range, but it also moves very slowly. Its timing will never be 1.5 or 2 sec with this function, although it really should be for movements from min to max.

I think the best way to address this is to make this function into a class method for each class, and accept a parameter for the attribute being changed. This way, you can check the range and adjust timing based on the attribute being changed, and what percent of its range is being requested.

olsonk commented 6 years ago

I believe this function is improved now - see this commit.

check_timing() now asks for range and determines timing based on the percent of the component's full range of motion. Moves no longer overlap as severely.