Closed linzdg closed 4 years ago
On which system are you running this tutorial? If you are on Ubuntu, installing coinor-libipopt-dev
should be enough to run all the iKin related software. There is any specific reason why you compile your own ipopt?
What I suspect is happening is that some libraries or executable are linking the system-installed ipopt, while some other your custom ipopt, and this is creating the segmentation fault errors.
Hi @linzdg
I think @traversaro is right: it's quite likely that a mixed installation is causing the seg-fault. My recommendation is to try installing the system as per the instructions available in our Wiki: https://wiki.icub.org/wiki/ICub_Software_Installation.
You can click on the badge below and get the latest software running on a Cloud IDE. Ipopt is working as expected along with icub-tutorials.
On which system are you running this tutorial? If you are on Ubuntu, installing
coinor-libipopt-dev
should be enough to run all the iKin related software. There is any specific reason why you compile your own ipopt? What I suspect is happening is that some libraries or executable are linking the system-installed ipopt, while some other your custom ipopt, and this is creating the segmentation fault errors.
Now I uninstall IPOPT3.12.12, and installing coinor-libipopt-dev. ICUB_CMAKE_OPTIONS -ICUB_USE_IPOPT = ON, IPOPT_DIR = /usr
It showed that CMake Error at /usr/local/share/cmake-3.16/Modules/FindPackageHandleStandarArgs.cmake:146(could NOT find IPOPT(missing:IPOPT_LIBRARIES))
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: /home/ccc/open/icub-main/src/libraries/iKin/IPOPT_INCLUDE_DIRS used as include directory in directory
Unfortunately, troubleshooting installations is not that easy and tends to be way time consuming as many factors play their role quite silently under the hood.
The golden rule of debugging states that we ought to start from a clean condition and this is also our recommendation. Tracing back the problem on your machine might be a long journey − especially if we don't have access to it − forcing our minds to figure out what sort of problem could be causing this stumbling issue and, most of all, leading you to waste possibly plenty of hours unfruitfully.
The easiest solution then is to try out everything from scratch, either by grabbing a new machine or even better by experimenting with Docker containers.
Here are the instructions to install dependencies for icub-tutorials
correctly:
# Update apt database
apt update
# Install essentials
apt install -y apt-utils software-properties-common apt-transport-https sudo \
psmisc lsb-release nano wget curl build-essential gdb git gitk \
libedit-dev libxml2-dev autoconf
# Install the most recent cmake
apt install -y ca-certificates gnupg
wget -q https://apt.kitware.com/keys/kitware-archive-latest.asc -O- | apt-key add -
apt-add-repository "deb https://apt.kitware.com/ubuntu/ `lsb_release -cs` main"
apt update
apt install -y kitware-archive-keyring
apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA
apt install -y cmake cmake-curses-gui
# Install yarp dependencies
echo "deb http://www.icub.org/ubuntu `lsb_release -cs` contrib/science" > /etc/apt/sources.list.d/icub.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 57A5ACB6110576A6
apt update
apt install -y icub-common
# Download and build Distro 2019.12.feat-02 (see https://wiki.icub.org/wiki/Software_Versioning_Table)
# YCM
git clone https://github.com/robotology/ycm.git -b v0.11.0
cd ycm && mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release
make install
# YARP
git clone https://github.com/robotology/yarp.git -b v3.3.0
cd yarp && mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DYARP_COMPILE_libYARP_math=ON \
-DYARP_COMPILE_CARRIER_PLUGINS=ON \
-DYARP_COMPILE_DEVICE_PLUGINS=ON \
-DYARP_COMPILE_GUIS=ON
make install
# icub-main
git clone https://github.com/robotology/icub-main.git -b v1.14.1
cd icub-main && mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_icubmod_cartesiancontrollerserver=ON \
-DENABLE_icubmod_cartesiancontrollerclient=ON \
-DENABLE_icubmod_gazecontrollerclient=ON
make install
# icub-contrib-common
git clone https://github.com/robotology/icub-contrib-common.git -b v1.14.0
cd icub-contrib-common && mkdir build && cd build
cmake ..
make install
# Set environmental variables
echo "export YARP_DATA_DIRS=/usr/local/share/yarp:/usr/local/share/iCub:/usr/local/share/ICUBcontrib" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/yarp" >> ~/.bashrc
Incidentally, these instructions represent a subset of the Docker recipe I used to construct the image underlying the Gitpod snapshot I pointed you at in my earlier post. If you're not familiar with Docker, just go for the instructions detailed above and run them on the cleanest machine you can get.
I ran them on the new machine and followed the steps. Everything is OK! I really appreciate your help! Thank you very much!
That's great 👍
I Compiled IpOpt 3.12.12, and I haved tested it(~/open/Ipopt-3.12.12/build/Ipopt/examples/WDS$ ./hs071_cpp ) could work.
Environment variable had set: export IPOPT_DIR=/home/ccc/open/Ipopt-3.12.12/build
I run three examples with icub-tutorials/src/
smoke-tests
icub-tutorials/src/iKin/iCubLimbsFwKin which didn't display segmentation fault
icub-tutorials/src/iKin/fwInvKinematics showed segmentation fault at below code // instantiate a IPOPT solver for inverse kinematic // for both translational and rotational part iKinIpOptMin slv(*chain,IKINCTRL_POSE_FULL,1e-3,1e-6,100);
How can I solve this problem? Thanks in advance.