loco-3d / crocoddyl

Crocoddyl is an optimal control library for robot control under contact sequence. Its solver is based on various efficient Differential Dynamic Programming (DDP)-like algorithms
BSD 3-Clause "New" or "Revised" License
858 stars 174 forks source link

SIGABRT in ActionModelFull #1142

Closed psclklnk closed 1 year ago

psclklnk commented 1 year ago

Hello everyone,

this is a follow up on a previous issue, in which I asked about a SIGABRT that I was facing in my custom DifferentialActionModel.

I tried following the suggestion of @cmastalli, however, without any success. Trying to reduce my problem to a minimal example, I started from this example. The full script runs without any problems in my conda environment with crocoddyl 1.8.1 on a M1 Mac. If I, however, add this snippet

actuation_data = actuation.createData()
u0 = pinocchio.utils.zero(robot_model.nv)
actuation.calc(actuation_data, q0, u0)

after line 27 (i.e. after the actuation model and q0 is defined), I receive a SIGABRT. Checking the C++ code of the ActuationModelFull

virtual void calc(const boost::shared_ptr<Data>& data,
                    const Eigen::Ref<const VectorXs>& /*x*/,
                    const Eigen::Ref<const VectorXs>& u) {
    if (static_cast<std::size_t>(u.size()) != nu_) {
      throw_pretty("Invalid argument: "
                   << "u has wrong dimension (it should be " +
                          std::to_string(nu_) + ")");
    }
    data->tau = u;
  };

I tried to provoke an exception by feeding in an actuation that is too large. More precisely, I replaced the above snippet with

actuation_data = actuation.createData()
u0 = pinocchio.utils.zero(robot_model.nv + 20)
actuation.calc(actuation_data, q0, u0)

However, the SIGABRT error still appears and no exception is thrown. Is there a possibility that the issue that I am experiencing has to do with the Python interface around croccoddyl?

Best Pascal

cmastalli commented 1 year ago

Hi @psclklnk

Your test works on my M1 Mac using the latest release. Your problem is not related to Crocoddyl. Instead, it could be related to a "dirty" installation setup.

I can't tell you more than just "clean up your conda setup or try a docker".

psclklnk commented 1 year ago

Hi @cmastalli

you are correct it works without a problem with the newest version. Thanks for this info! The issue was probably caused by me fixing an eigenpy error after installing crocoddyl-1.8.1 via

conda install -c condo-forge crocoddyl=1.8.1

in a fresh conda environment. The error was

Symbol not found: (__ZN7eigenpy9NumpyType7getTypeEv)

and I avoided this error by running

conda install eigenpy=2.9.2

assuming that conda avoids compatibility issues. However, I can exactly reproduce the error with this"fix". Given that the project I am working on was built on 1.8.1 (and we faced some very unexpected behavior with 2.0), is there a way to keep using version 1.8.1, i.e. fix the eigenpy issue without causing the SIGABRTs?

Best Pascal