Closed sm3304love closed 7 months ago
Hi, @sm3304love I took a look at the code, and from my side looks correct. Can you get the execution statistics using getExecutionStats()
to check the average return state of the solver? I will be back in my office tomorrow, so I can try to run your repo on my PC. Are you using ROS 1 right?
Yes, I'm using ROS 1(noetic). I'll check execution statistics using getExecutionStats()
and share the results.
As a result of checking the solution states using getExecutionStats()
, I was able to confirm the following results.
@sm3304love in your repo ur20.urdf
is missing, i cannot reproduce your setup.
[rospack] Error: package 'ur20_description' not found
[librospack]: error while executing command
Error: File /urdf/ur20.urdf does not exist
at line 55 in /build/urdfdom-VnCcob/urdfdom-1.0.4+ds/urdf_parser/src/model.cpp
terminate called after throwing an instance of 'std::invalid_argument'
what(): The file /urdf/ur20.urdf does not contain a valid URDF model.
Annullato
@nicolapiccinelli I'm sorry. ur20.urdf is in this package. https://github.com/sm3304love/ur20_description
@sm3304love On my desktop, it's faster, but ofc not as casADi
but if you enable the compiler optimization flag -O3
like that set(CMAKE_CXX_FLAGS "-DEIGEN_STACK_ALLOCATION_LIMIT=0 -O3")
I followed your advice and set the compiler optimization flag, and my code became much faster. Thanks for your help!
Hello. I'm currently trying to solve the manipulator's motion planning with NMPC using the libmpc library. This function was previously implemented using the casADi library, but due to a problem with casADi that external robotics libraries such as Pinocchio cannot be used, So I want to use libmpc.
The NMPC problem I'm currently trying to implement is shown in the image below.
I succeeded in implementing the NMPC problem with libmpc, but the problem occurred that the calculation time was too long. If the calculation time is short, it takes 1 second, and if it is long, it takes up to 5 seconds. Could you please advise on any methods I might try to accelerate NMPC calculations?
The code below is the objective function I set and The horizon used in the calculation is 10.
If you want, you can check my entire algorithm through the link below. Your assistance is greatly appreciated. nonlinear_mpc