grvcPerception / pa_powerline_perching

A NLP solver for generating perception-aware powerline perching trajectories for multirotors
Other
29 stars 11 forks source link

ForcesPro version issue #2

Closed t-thanh closed 1 year ago

t-thanh commented 1 year ago

Hi, at the moment of writing ForcesPro client has version 6.0.1 and since version 6.0 they has changed from casadi2forces to adtool2forces. Therefore, compile the solver_interface doesn't work anymore.

I can't download the client version 5.1.0 - I'm asking for support from Embotech at the moment, however, the server for version 5.1.0 will close soon (31/03/2023)

Adapting the solver_interface code doesn't work with me: replace all the casadi with adtool, and PerchingSolver_adtool2forces return solver_int32_default instead of void, but it still has error while compile with g++

src/perch_recovery_planner.cpp: In member function ‘const int PerchPlanner::planPerchAndRecovery()’:
src/perch_recovery_planner.cpp:303:128: error: cannot convert ‘PerchingSolver_extfunc’ {aka ‘int (*)(double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, int, int, int)’} to ‘FILE*’ {aka ‘_IO_FILE*’}
  303 | s_, &(perching_output.output_vector), &perching_info_, NULL, forces_extfunc_eval_);
      |                                                              ^~~~~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              PerchingSolver_extfunc {aka int (*)(double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, int, int, int)}

In file included from include/math_types.h:31,
                 from src/../include/perch_recovery_planner.hpp:4,
                 from src/perch_recovery_planner.cpp:2:
include/../extern/solver/PerchingSolver/include/PerchingSolver.h:396:170: note:   initializing argument 5 of ‘solver_int32_default PerchingSolver_solve(PerchingSolver_params*, PerchingSolver_output*, PerchingSolver_info*, PerchingSolver_mem*, FILE*, PerchingSolver_extfunc)’
  396 | t, PerchingSolver_info *info, PerchingSolver_mem *mem, FILE *fs, PerchingSolver_extfunc evalextfunctions_PerchingSolver);
      |                                                        ~~~~~~^~

src/perch_recovery_planner.cpp:403:129: error: cannot convert ‘PerchingSolver_extfunc’ {aka ‘int (*)(double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, int, int, int)’} to ‘FILE*’ {aka ‘_IO_FILE*’}
  403 | _, &(recovery_output_.output_vector), &recovery_info_, NULL, forces_extfunc_eval_);
      |                                                              ^~~~~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              PerchingSolver_extfunc {aka int (*)(double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, int, int, int)}

In file included from include/math_types.h:31,
                 from src/../include/perch_recovery_planner.hpp:4,
                 from src/perch_recovery_planner.cpp:2:
include/../extern/solver/PerchingSolver/include/PerchingSolver.h:396:170: note:   initializing argument 5 of ‘solver_int32_default PerchingSolver_solve(PerchingSolver_params*, PerchingSolver_output*, PerchingSolver_info*, PerchingSolver_mem*, FILE*, PerchingSolver_extfunc)’
  396 | t, PerchingSolver_info *info, PerchingSolver_mem *mem, FILE *fs, PerchingSolver_extfunc evalextfunctions_PerchingSolver);
      |                                                        ~~~~~~^~

Can you please adapt your solver_interface with the new ForcesPro version, so your code can survive further than the closing date of version 5.1.0?

JulioLP commented 1 year ago

Hi t-thanh, thanks for pointing this out. Let me renew the license and check it when I have some time. It's probably just a matter of names. Eventually, if open-source alternatives (such as acados) become more numerically stable for this problem, I will update the code to use them instead.

JulioLP commented 1 year ago

Hi again t-thanh. In the meantime, you can try the steps explained in the forces documentation to kep using the legacy C interface: https://forces.embotech.com/Documentation/back_compatibility/index.html#changes-from-version-6-0-0

t-thanh commented 1 year ago

Confirm it works, with some adaptation in the code, I will make a pull request for that.

t-thanh commented 1 year ago

Solved in https://github.com/grvcPerception/pa_powerline_perching/pull/3 - CLOSED the issue