edowson / sjtu_drone

ROS Gazebo quadcopter simulator.
Other
13 stars 7 forks source link

Running catkin_make -j4 failed #1

Closed caomxin closed 4 years ago

caomxin commented 5 years ago

Untill here:

[ 92%] Built target drone_keyboard
/home/mxin/sjtu_drone_recent_ws/src/sjtu_drone/src/spawn_drone.cpp:7:37: fatal error: ignition/math/Inertial.hh: No such file or directory
compilation terminated.
sjtu_drone/CMakeFiles/spawn_drone.dir/build.make:62: recipe for target 'sjtu_drone/CMakeFiles/spawn_drone.dir/src/spawn_drone.cpp.o' failed
make[2]: *** [sjtu_drone/CMakeFiles/spawn_drone.dir/src/spawn_drone.cpp.o] Error 1
CMakeFiles/Makefile2:888: recipe for target 'sjtu_drone/CMakeFiles/spawn_drone.dir/all' failed
make[1]: *** [sjtu_drone/CMakeFiles/spawn_drone.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4" failed

Besides, do the warnings for the deprecated APIs not matters? Thank you!

edowson commented 5 years ago

It appears that the ignition math libraries are not installed. These come with Gazebo. Can you provide the following information:

This version was tested using the above versions. If you're on Ubuntu-16.04, you can type the following commands to find out which packages are missing:

sudo apt update
rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -r -y -s

After that, type the same command without the -s parameter to install on your host system:

sudo apt update
rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -r -y

The best way to work with ROS on a host running a different version of the OS (e.g. Ubuntu-18.04) or distro (e.g. CentOS 7.6) is to use docker with support for NVIDIA gpu acceleration from within the containers.

If you're using Ubuntu-16.04, I can attach a setup script to install all the pre-requisites on your host system. Else, I can provide you with a set of docker scripts to run the example in a docker container.

edowson commented 5 years ago

Besides, do the warnings for the deprecated APIs not matters?

I have fixed the warnings for the deprecated APIs for Gazebo 7.

edowson commented 5 years ago

@caomxin Were you able to get past the issues you were facing?

swrdZWJ commented 5 years ago

hi , I have the same problem with you

[ 81%] Linking CXX executable /home/zhu/catkin_ws1/src/sjtu_drone/bin/drone_keyboard //usr/lib/x86_64-linux-gnu/libapr-1.so.0:对‘uuid_generate@UUID_1.0’未定义的引用 collect2: error: ld returned 1 exit status sjtu_drone/CMakeFiles/drone_keyboard.dir/build.make:240: recipe for target '/home/zhu/catkin_ws1/src/sjtu_drone/bin/drone_keyboard' failed make[2]: [/home/zhu/catkin_ws1/src/sjtu_drone/bin/drone_keyboard] Error 1 CMakeFiles/Makefile2:526: recipe for target 'sjtu_drone/CMakeFiles/drone_keyboard.dir/all' failed make[1]: [sjtu_drone/CMakeFiles/drone_keyboard.dir/all] Error 2 make[1]: 正在等待未完成的任务.... [ 85%] Linking CXX shared library /home/zhu/catkin_ws1/src/sjtu_drone/plugins/libplugin_ros_init.so [ 85%] Built target plugin_ros_init [ 88%] Linking CXX shared library /home/zhu/catkin_ws1/src/sjtu_drone/plugins/libplugin_ros_cam.so [ 88%] Built target plugin_ros_cam Makefile:138: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j4 -l4" failed

In addition, the environment is:

OS version :Ubuntu-16.04 ROS distro : Kinetic Gazebo version :Gazebo 7

how to solve the problem , can you help me ? 谢谢! @edowson @caomxin

edowson commented 5 years ago

Step 01: Can you first try to make sure you have installed all the required packages?

# set environment variables
export ROS_ROS_DISTRO=kinetic

# install packages
apt-get update \
    && apt-get install -q -y \
    dirmngr \
    gnupg2 \
    lsb-release

# setup keys: ros, gazebo
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116 \
    && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743

# setup sources.list
RUN echo "deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted \n\
deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-updates main restricted \n\
deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse \n\
deb-src http://security.ubuntu.com/ubuntu $(lsb_release -cs)-security main restricted" \
    > /etc/apt/sources.list.d/official-source-repositories.list \
    && echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" \
    > /etc/apt/sources.list.d/ros-latest.list \
    && echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -sc` main" \
    > /etc/apt/sources.list.d/gazebo-latest.list

# install build tools
DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
    apt-transport-https \
    apt-utils \
    bash-completion \
    build-essential \
    ca-certificates \
    clang \
    clang-format \
    cmake \
    cmake-curses-gui \
    curl \
    gconf2 \
    gconf-service \
    gdb \
    git-core \
    git-gui \
    gvfs-bin \
    inetutils-ping \
    llvm \
    llvm-dev \
    nano \
    net-tools \
    pkg-config \
    pulseaudio-utils \
    shared-mime-info \
    software-properties-common \
    sudo \
    tzdata \
    udev \
    unzip \
    wget \
    xdg-user-dirs \
    xdg-utils \
    x11-xserver-utils 

# install libraries
DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install -q -y \
    ffmpeg \
    libasound2-dev \
    libassimp-dev \
    libeigen3-dev \
    libgl1-mesa-dev \
    libgl1-mesa-glx \
    libglew-dev \
    libopencv-dev \
    libosmesa6-dev \
    libqt5opengl5-dev \
    libtinyxml-dev \
    libyaml-cpp-dev

# install python packages
DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
    # python-minimal install python2.7 \
    python-minimal \
    python-pip \
    python3-pip \
    # python development libraries \
    libpython-dev \
    libpython3-dev \
    libboost-python-dev \
    # upgrade pip \
    && sudo pip install --upgrade pip \
    && sudo pip3 install --upgrade pip \
    && DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
    # python packages \
    python-catkin-tools \
    python-opencv \
    python-lxml \
    python-rosdep \
    python-rosinstall \
    python-rosinstall-generator \
    python-setuptools \
    python-vcstools \
    python-wstool \
    python3-dev \
    python3-defusedxml \
    python3-setuptools \
    pylint3 \
    pyqt5-dev \
    pyqt5-dev-tools

# install ros base packages
DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
    ros-$ROS_DISTRO-ros-core \
    ros-$ROS_DISTRO-ros-base \
    ros-$ROS_DISTRO-xacro

# install additional ros packages
DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
    # common_pkgs \
    ros-$ROS_DISTRO-ecto \
    ros-$ROS_DISTRO-eigen-conversions \
    ros-$ROS_DISTRO-rospy-message-converter \
    ros-$ROS_DISTRO-ros-numpy \
    # image
    ros-$ROS_DISTRO-rgbd-launch \
    ros-$ROS_DISTRO-image-proc \
    ros-$ROS_DISTRO-image-transport \
    ros-$ROS_DISTRO-depth-image-proc \
    ros-$ROS_DISTRO-stereo-image-proc \
    # interactive marker
    ros-$ROS_DISTRO-interactive-marker-proxy \
    ros-$ROS_DISTRO-interactive-marker-twist-server \
    # octomap \
    ros-$ROS_DISTRO-octomap \
    ros-$ROS_DISTRO-octomap-mapping \
    ros-$ROS_DISTRO-octomap-msgs \
    ros-$ROS_DISTRO-octomap-pa \
    ros-$ROS_DISTRO-octomap-ros \
    ros-$ROS_DISTRO-octomap-rviz-plugins \
    ros-$ROS_DISTRO-octomap-server \
    ros-$ROS_DISTRO-octovis \
    # opencv \
    ros-$ROS_DISTRO-opencv-candidate \
    ros-$ROS_DISTRO-cv-bridge \
    # slam
    ros-$ROS_DISTRO-openslam-gmapping \
    ros-$ROS_DISTRO-slam-gmapping \
    ros-$ROS_DISTRO-slam-karto \
    # teleop
    ros-$ROS_DISTRO-joy-teleop \
    ros-$ROS_DISTRO-teleop-twist-joy \
    ros-$ROS_DISTRO-teleop-twist-keyboard \
    ros-$ROS_DISTRO-twist-mux \
    # tf \
    ros-$ROS_DISTRO-tf \
    ros-$ROS_DISTRO-tf-conversions \
    ros-$ROS_DISTRO-tf2 \
    ros-$ROS_DISTRO-tf2-eigen \
    ros-$ROS_DISTRO-tf2-ros \
    ros-$ROS_DISTRO-tf2-web-republisher \
    # robot \
    ros-$ROS_DISTRO-robot-calibration \
    ros-$ROS_DISTRO-robot-localization \
    ros-$ROS_DISTRO-robot-state-publisher \
    # pcl \
    ros-$ROS_DISTRO-pcl-ros \
    ros-$ROS_DISTRO-pcl-conversions \
    # robot-controllers \
    ros-$ROS_DISTRO-robot-controllers \
    ros-$ROS_DISTRO-robot-controllers-interface \
    # ros-bridge \
    ros-$ROS_DISTRO-rosbridge-server \
    # ros-controllers \
    ros-$ROS_DISTRO-ros-control \
    ros-$ROS_DISTRO-ros-controllers \
    ros-$ROS_DISTRO-effort-controllers \
    ros-$ROS_DISTRO-joint-state-controller \
    ros-$ROS_DISTRO-joint-state-publisher \
    ros-$ROS_DISTRO-joint-states-settler \
    # ros-motion-playbak \
    ros-$ROS_DISTRO-play-motion \
    ros-$ROS_DISTRO-play-motion-msgs \
    # ros-navigation \
    ros-$ROS_DISTRO-navigation \
    ros-$ROS_DISTRO-humanoid-nav-msgs \
    # ros-perception \
    ros-$ROS_DISTRO-perception \
    ros-$ROS_DISTRO-object-recognition-core \
    # ros-planners \
    ros-$ROS_DISTRO-costmap-2d \
    ros-$ROS_DISTRO-costmap-converter \
    ros-$ROS_DISTRO-costmap-prohibition-layer \
    ros-$ROS_DISTRO-dwa-local-planner \
    ros-$ROS_DISTRO-eband-local-planner \
    ros-$ROS_DISTRO-teb-local-planner \
    # ros-trackers \
    ros-$ROS_DISTRO-people-velocity-tracker \
    # ros-tagging \
    # AR tag tracking library \
    ros-$ROS_DISTRO-ar-track-alvar \
    ros-$ROS_DISTRO-ar-track-alvar-msgs \
    # sensors \
    ros-$ROS_DISTRO-laser-filters \
    ros-$ROS_DISTRO-map-laser \
    ros-$ROS_DISTRO-pointcloud-to-laserscan \
    # moveit \
    ros-$ROS_DISTRO-moveit-commander \
    ros-$ROS_DISTRO-moveit-core \
    ros-$ROS_DISTRO-moveit-fake-controller-manager \
    ros-$ROS_DISTRO-moveit-kinematics \
    ros-$ROS_DISTRO-moveit-msgs \
    ros-$ROS_DISTRO-moveit-planners \
    ros-$ROS_DISTRO-moveit-planners-ompl \
    ros-$ROS_DISTRO-moveit-plugins \
    ros-$ROS_DISTRO-moveit-python \
    ros-$ROS_DISTRO-moveit-ros-benchmarks \
    ros-$ROS_DISTRO-moveit-ros-move-group \
    ros-$ROS_DISTRO-moveit-ros-planning \
    ros-$ROS_DISTRO-moveit-ros-planning-interface \
    ros-$ROS_DISTRO-moveit-ros-visualization \
    ros-$ROS_DISTRO-moveit-setup-assistant \
    ros-$ROS_DISTRO-moveit-simple-controller-manager \
    ros-$ROS_DISTRO-moveit-visual-tools \
    # rqt \
    ros-$ROS_DISTRO-rqt-gui \
    ros-$ROS_DISTRO-rqt-gui-py \
    ros-$ROS_DISTRO-rqt-graph \
    ros-$ROS_DISTRO-rqt-tf-tree \
    # rviz \
    ros-$ROS_DISTRO-rviz \
    ros-$ROS_DISTRO-rviz-imu-plugin \
    ros-$ROS_DISTRO-jsk-rviz-plugins \
    # urdf \
    ros-$ROS_DISTRO-urdf-geometry-parser \
    ros-$ROS_DISTRO-urdf-test \
    # robots \
    # wheeled robots \
    ros-$ROS_DISTRO-four-wheel-steering-msgs

Step 02: Run rosdep in your workspace.

In your catkin workspace, you will have to run rosdep to check for any missing dependencies:

sudo apt update
rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -r -y -s

and install the missing dependencies with the following command (without the -s to install):

rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -r -y

If you still have any problems, please let me know.

swrdZWJ commented 5 years ago

I have solved my problem by : conda install -c conda-forge libuuid

and I guess this problem is due to the incompatibility between anaconda and ros

thank you very much!

akashnambiarr commented 4 years ago

I have followed your instructions to run rosdep but I still have the same error. I am using kinetic and Gazebo 7

edowson commented 4 years ago

@akashnambiarr Try to build a docker container image with all the dependencies mentioned here, it should work.