Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorExecutionTimeCalculation #69

Closed
Danielxyz123 opened this issue Aug 25, 2021 · 4 comments
Closed

ErrorExecutionTimeCalculation #69

Danielxyz123 opened this issue Aug 25, 2021 · 4 comments

Comments

@Danielxyz123
Copy link

Hi Pantor,

i got an "ErrorExecutionTimeCalculation" with the following Code.

`
#include

#include <ruckig/ruckig.hpp>

using namespace ruckig;

int main() {
// Create instances: the ruckig otg as well as input and output parameters
Ruckig<2> otg{ 0.002 };
InputParameter<2> input;
OutputParameter<2> output;

ruckig::Result  resultOnline = ruckig::Result::Working;
unsigned int counterError = 0;
bool newPosInitDone = false;

// Set input parameters
input.max_velocity      = { 32.34, 19.60 };
input.max_acceleration  = { 245.0, 98.0 };
input.max_jerk          = { 2450.0, 2450.0 };


input.current_position = { 5.0, 0.0 };
input.current_velocity = { 0, 0 };
input.current_acceleration = { 0, 0 };

input.target_position = { 0.1, -3.35 };
input.target_velocity = { 0.0, 0.0 };
input.target_acceleration = { 0.0, 0.0 };


// Generate trajectory
while ((resultOnline = otg.update(input, output)) == Result::Working) {

    if ((output.new_position[0] < 2.5) && (newPosInitDone == false))
    {
        newPosInitDone = true;
        std::cout << "set new pos!!!!" << std::endl;
        input.target_position[0] = 0.0;
    }

    input.current_position = output.new_position;
    input.current_velocity = output.new_velocity;
    input.current_acceleration = output.new_acceleration;

    auto& p = output.new_position;
    auto& v = output.new_velocity;
    auto& a = output.new_acceleration;

    std::cout << "p: " << output.time << " " << p[0] << ' ' << p[1] << std::endl;

}

std::cout << " Error count : " << counterError << std::endl;
if (resultOnline != Result::Finished)
{
    std::cout << " Last Error  : " << resultOnline << std::endl;
}

}
`

@pantor
Copy link
Owner

pantor commented Aug 25, 2021

Hi @Danielxyz123,

this does seem to work on my hardware again. Could you replace Ruckig<2> with Ruckig<2, true> and post the exact thrown error message here?

@Danielxyz123
Copy link
Author

Hi,

i had to modify your code to get the message in my Win10 VS System. Or do you mean another message?

Error message:

[ruckig] error in step 1, dof: 1 input:
inp.current_position = [2.46105171562071, -1.740571215512525]
inp.current_velocity = [-22.05435743108223, -16.24482629348391]
inp.current_acceleration = [0, 9.881190028331117]
inp.target_position = [0, -3.35]
inp.target_velocity = [0, 0]
inp.target_acceleration = [0, 0]
inp.max_velocity = [32.34, 19.6]
inp.max_acceleration = [245, 98]
inp.max_jerk = [2450, 2450]

Error count : 0
Last Error : -110

Without try catch block, it throws no error message...

grafik

@Danielxyz123
Copy link
Author

Now, i used the last commit... It works fine!

@pantor
Copy link
Owner

pantor commented Aug 25, 2021

That's great to hear! Then it was probably caused by the same issue as #68. Feel free to open new issues if you get more ExecutionTimeCalculation errors.

@pantor pantor closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants