Auterion / px4-jsbsim-bridge

JSBSim bridge for PX4 SITL/HITL simulations
BSD 3-Clause "New" or "Revised" License
26 stars 38 forks source link

Declare FGInitialCondition as shared_ptr #43

Closed bresch closed 3 years ago

bresch commented 3 years ago

While trying JSBSim (built from source on Linux), I got this error:

 error: cannot convert ‘std::shared_ptr<JSBSim::FGInitialCondition>’ to ‘JSBSim::FGInitialCondition*’ in initialization
  146 |     JSBSim::FGInitialCondition *initial_condition = _fdmexec->GetIC();
      |                                                     ~~~~~~~~~~~~~~~^~
      |                                                                    |
      |                                                                    std::shared_ptr<JSBSim::FGInitialCondition>

After this change I was able to run build and run a SITL test successfully.

bresch commented 3 years ago

Interesting, now CI complains about:

error: conversion from ‘JSBSim::FGInitialCondition*’ to non-scalar type ‘std::shared_ptr<JSBSim::FGInitialCondition>’ requested
  146 |     std::shared_ptr<JSBSim::FGInitialCondition> initial_condition = _fdmexec->GetIC();
      |                                                                     ~~~~~~~~~~~~~~~^~

EDIT: that was recently changed in https://github.com/JSBSim-Team/jsbsim/commit/87c9782b61ca1121c917f827f3f320944b2894e3 -> changing to auto so everyone can be happy

bresch commented 3 years ago

Which system were you using?

Manjaro

Should we add building jsbsim from source to the CI?

Could be a good thing, yes, but only if we want to support it explicitly. The problem is that CI will fail every time the upstream interface changes, but the good thing is that we can fix them gradually instead of discovering them when changing to a new release.