pantor / ruckig

Motion Generation for Robots and Machines. Real-time. Jerk-constrained. Time-optimal.
https://ruckig.com
MIT License
728 stars 164 forks source link

ErrorExecutionTimeCalculation #130

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi @pantor,

Thanks for the great work on Ruckig :+1:

I'm running into an issue where Ruckig often throws an ErrorExecutionTimeCalculation in a mostly reproducable scenario (decelerating one joint while accelerating another).

The target is updated often, as are the joint limits, so the current state is not always valid. However, I ensure that the target state is valid and reachable.

Here's the error printout:

[ruckig] error in step 1, dof: 3 input: 
inp.current_position = [0.1720894642466409, 3.62255615705579, 1.675754445058354, 2.181127634157466, 0.7829547024446563, 0]
inp.current_velocity = [0, -0.06422550797049381, -0.006910864193129071, 0.1207111377965507, 0, 0]
inp.current_acceleration = [0, 0, 0, -0.3999999999978001, 0, 0]
inp.target_position = [0.1703441349946466, 3.587689540855463, 1.671344092861895, 2.271916653384632, 0.7826056365942573, -0.003141592653589793]
inp.target_velocity = [0, -0.06423623454575711, -0.007006078877926925, 0.1187909578397501, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.06423623454575711, 0.007006078877926925, 0.1187909578397501, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]

For reference, the input is initalised as

inp.enabled.at(0) = false;
inp.enabled.at(4) = false;
inp.enabled.at(5) = false;
inp.control_interface = ruckig::ControlInterface::Position;
inp.synchronization = ruckig::Synchronization::None;
inp.duration_discretization = ruckig::DurationDiscretization::Continuous;

Any help is much appreciated!

ghost commented 2 years ago

Here are a few additional error printouts for the same configuration:

[ruckig] error in step 1, dof: 2 input: 
inp.current_position = [0.176976386152225, 3.132575577974852, 1.610048759879563, 1.358099999999995, 0.7827801695194568, 0]
inp.current_velocity = [0, -0.01605065781778588, -0.01433020148495358, 0.7, 0, 0]
inp.current_acceleration = [0, 0.261799388, 0.0436332309978, 0, 0, 0]
inp.target_position = [0.176976386152225, 3.134093327046441, 1.600105431892089, 3.462364941311066, 0.7829547024446563, 0.003316125578789226]
inp.target_velocity = [0, 0.01213961632346518, -0.01423842594431767, 0.7, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.0314159265, 0.01423842594431767, 0.7, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]
ruckig] error in step 1, dof: 2 input: 
inp.current_position = [0.1762782544514273, 3.79001296074384, 1.677009736370837, 2.873169362614821, 0.7878416243502403, 0]
inp.current_velocity = [0, -0.1158356714253153, -0.0118069066638053, -0.2034580304547194, 0, 0]
inp.current_acceleration = [0, 0.2617993879978, 0.0436332309978, 0.3999999999978, 0, 0]
inp.target_position = [0.1761037215262279, 3.704655340203287, 1.672480315390623, 2.685142311447863, 0.7850490975470494, 0.004537856055185257]
inp.target_velocity = [0, -0.1062998736367618, -0.01101034771159209, -0.1859922274092355, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.1062998736367618, 0.01101034771159209, 0.1859922274092355, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]
inp.current_position = [0.1752310569002307, 2.788448085641997, 1.549972469661004, 0.2619544804311611, 0.7829547024446563, 0]
inp.current_velocity = [0, 0.08560183686796563, 0.01518075748356093, 0.2611445330894205, 0, 0]
inp.current_acceleration = [0, 0, 0, -0.3999999999978001, 0, 0]
inp.target_position = [0.1745329251994329, 2.827485751362566, 1.556327711444667, 5.655681656010978, 0.7853981633974483, 0.002792526803190927]
inp.target_velocity = [0, 0.08519340478274263, 0.01506320014789829, 0.2571604032870958, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.08519340478274263, 0.01506320014789829, 0.2571604032870958, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]
inp.current_position = [0.1740093264238347, 2.864553858682786, 1.560579532936934, 4.70481631514054, 0.7827801695194568, 0]
inp.current_velocity = [0, -0.05352436681015414, -0.008045018215055721, 0.4905484381091656, 0, 0]
inp.current_acceleration = [0, 0.2617993879978, 0.0436332309978, -0.3999999999978, 0, 0]
inp.target_position = [0.1738347934986352, 2.814974483118835, 1.554760324386171, 5.322261245452188, 0.7853981633974483, -0.004886921905584123]
inp.target_velocity = [0, -0.04827947908515216, -0.007327383285184718, 0.4279387062528196, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.04827947908515216, 0.007327383285184718, 0.4279387062528196, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]
[ruckig] error in step 1, dof: 3 input: 
inp.current_position = [0.1745329251994329, 3.84563124088855, 1.691462121703242, 2.429353638224054, 0.7878416243502403, 0]
inp.current_velocity = [0, 0.1234987527378386, 0.01005405201184207, 0.1891816213597431, 0, 0]
inp.current_acceleration = [0, -0.2617993879978, 0.043633231, -0.3999999999978001, 0, 0]
inp.target_position = [0.1745329251994329, 3.927804839774294, 1.694841555160344, 2.738160711643639, 0.790110552377833, -0]
inp.target_velocity = [0, 0.1130692396483227, 0.0126706630205588, 0.175, 0, 0]
inp.target_acceleration = [0, 0, 0, 0, 0, 0]
inp.max_velocity = [0.06981316999999999, 0.1130692396483227, 0.0126706630205588, 0.175, 6.981317008, 34.90658504]
inp.max_acceleration = [0.034906585, 0.261799388, 0.043633231, 0.4, 4.01425728, 34.90658504]
inp.max_jerk = [100, 100, 100, 100, 100, 100]
ghost commented 2 years ago

Hi @pantor, Do you have any expectation for when this bug might be fixed? Is there any additional information I can provide?

pantor commented 2 years ago

Hey! This should be fixed now with the latest commit on the master branch. Can you confirm this?

ghost commented 2 years ago

I have not observed this since the latest commit, so it seems to have been fixed. Thank you :champagne: