ethz-asl / mav_trajectory_generation

Polynomial trajectory generation and optimization, especially for rotary-wing MAVs.
Apache License 2.0
528 stars 222 forks source link

Fix/installation #116

Closed rikba closed 3 years ago

rikba commented 3 years ago

This should resolve https://github.com/ethz-asl/mav_trajectory_generation/pull/106 https://github.com/ethz-asl/mav_trajectory_generation/issues/79 https://github.com/ethz-asl/mav_trajectory_generation/issues/102

But longterm yaml_cpp_catkin dependency should be removed in favor of system yaml-cpp since on ROS melodic the current version of yaml_cpp_catkin creates problems.

Errors     << mav_trajectory_generation:make /tmp/mav_ws/logs/mav_trajectory_generation/build.make.000.log                           
/tmp/mav_ws/devel/lib/libmav_trajectory_generation.so: undefined reference to `YAML::detail::node_data::push_back(YAML::detail::node&, boost::shared_ptr<YAML::detail::memory_holder>)'
/tmp/mav_ws/devel/lib/libmav_trajectory_generation.so: undefined reference to `YAML::detail::node_data::convert_to_map(boost::shared_ptr<YAML::detail::memory_holder>)'
collect2: error: ld returned 1 exit status
make[2]: *** [/tmp/mav_ws/devel/lib/mav_trajectory_generation/polynomial_timing_evaluation] Error 1
make[1]: *** [CMakeFiles/polynomial_timing_evaluation.dir/all] Error 2
make: *** [all] Error 2
rikba commented 3 years ago

test this please

aseligmann commented 3 years ago

The change introduced in 0941351c731ce8088ff9d8e01a7009a85775917e does not compile in my Melodic environment, and results in the same error mentioned in https://github.com/ethz-asl/mav_trajectory_generation/issues/115.

Reverting to <depend>yaml_cpp_catkin</depend> solves the problem, and the package compiles without errors.

rikba commented 3 years ago

It seems like the error you are mentioning is an issue of the specific yaml-cpp configuration on your system and the interoperability with other packages.

Explicitely depending on yaml_cpp_catkin in the package.xml is not an option, because this would prevent using system yaml-cpp, i.e., you would always need yaml_cpp_catkin in your workspace.

We just tried installing the package in a clean melodic catkin workspace with no errors.

This is the workspace configuration. Note that we explicitely include yaml_cpp_catkin which your workspace seems to contain as well.

wstool info
workspace:

 Localname                 S SCM Version (Spec) UID  (Spec)  URI  (Spec) [http(s)://...]
 ---------                 - --- -------------- -----------  ---------------------------
 yaml_cpp_catkin             git master  (-)    6cad108c4d5a github.com/ethz-asl/yaml_cpp_catkin
 nlopt                       git master  (-)    04ae2f544b2c github.com/ethz-asl/nlopt.git
 mav_trajectory_generation   git master  (-)    7aeebd9f8192 github.com/ethz-asl/mav_trajectory_generation
 mav_comm                    git master  (-)    46e4d40a13a3 github.com/ethz-asl/mav_comm.git
 glog_catkin                 git master  (-)    1b8eab2d0710 github.com/ethz-asl/glog_catkin.git
 eigen_checks                git master  (-)    22a6247a3df1 github.com/ethz-asl/eigen_checks.git
 eigen_catkin                git master  (-)    3323b388540f github.com/ethz-asl/eigen_catkin.git
 catkin_simple               git master  (-)    0e62848b12da github.com/catkin/catkin_simple.git

This was the installation order

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-melodic-desktop-full python-wstool python-catkin-tools ros-melodic-cmake-modules -y
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
catkin config --extend /opt/ros/melodic
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin config --merge-devel
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source /opt/ros/melodic/setup.bash 
cd src
wstool init
wstool set --git mav_trajectory_generation https://github.com/ethz-asl/mav_trajectory_generation -y
wstool update
wstool merge mav_trajectory_generation/install/mav_trajectory_generation_https.rosinstall
wstool set yaml_cpp_catkin --git https://github.com/ethz-asl/yaml_cpp_catkin -y
wstool update -j8
catkin build
aseligmann commented 3 years ago

Hmm, interesting. It seems I have some cleaning up to do in my environment.

Out of curiosity, since I have not delved into the inner workings of this package, does this commit limit backwards-compatibility? (Assuming that another package has been developed with mav_trajectory_generation pre-https://github.com/ethz-asl/mav_trajectory_generation/pull/116 in mind.)

rikba commented 3 years ago

If you post the packages in your workspace, maybe we can reproduce the error and find a solution. Maybe catkin clean sorts out all issues already.

https://github.com/ethz-asl/mav_trajectory_generation/pull/116 did not change the API so no backwards-compatibility issues are expected. It only tries to fix the yaml_cpp dependency problem.

aseligmann commented 3 years ago

I am working in a fairly large workspace at the moment, and do not have the time to narrow down on the relevant packages at the moment. I will attempt to report back in the coming week.