tesseract-robotics / trajopt

Trajectory Optimization Motion Planner for ROS
381 stars 103 forks source link

Build fails on Noetic #261

Closed RaduCorcodel closed 3 years ago

RaduCorcodel commented 3 years ago

I'm trying to build Trajopt and it throwing me this error:

_______________________________________________________________________________
Errors     << trajopt_ifopt:make /homes/corcodel/ws_motion_planning/logs/trajopt_ifopt/build.make.004.log
/homes/corcodel/ws_motion_planning/src/trajopt_ros/trajopt_ifopt/src/squared_cost.cpp: In member function ‘virtual void trajopt::SquaredCost::FillJacobianBlock(std::string, ifopt::Component::Jacobian&) const’:
/homes/corcodel/ws_motion_planning/src/trajopt_ros/trajopt_ifopt/src/squared_cost.cpp:76:56: error: ‘virtual void ifopt::ConstraintSet::FillJacobianBlock(std::string, ifopt::Component::Jacobian&) const’ is private within this context
   76 |   constraint_->FillJacobianBlock(var_set, cnt_jac_block);
      |                                                        ^
In file included from /opt/ros/noetic/include/ifopt/cost_term.h:33,
                 from /homes/corcodel/ws_motion_planning/src/trajopt_ros/trajopt_ifopt/include/trajopt_ifopt/costs/squared_cost.h:31,
                 from /homes/corcodel/ws_motion_planning/src/trajopt_ros/trajopt_ifopt/src/squared_cost.cpp:26:
/opt/ros/noetic/include/ifopt/constraint_set.h:109:16: note: declared private here
  109 |   virtual void FillJacobianBlock(std::string var_set, Jacobian& jac_block) const = 0;
      |                ^~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/trajopt_ifopt.dir/build.make:141: CMakeFiles/trajopt_ifopt.dir/src/squared_cost.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/trajopt_ifopt.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /homes/corcodel/ws_motion_planning/build/trajopt_ifopt; catkin build --get-env trajopt_ifopt | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -

...............................................................................
Failed     << trajopt_ifopt:make                              [ Exited with code 2 ]
Failed    <<< trajopt_ifopt                                   [ 3.6 seconds ]  
Abandoned <<< trajopt_sqp                                     [ Unrelated job failed ]
[build] Summary: 20 of 22 packages succeeded.                                  
[build]   Ignored:   None.                                                     
[build]   Warnings:  13 packages succeeded with warnings.                      
[build]   Abandoned: 1 packages were abandoned.                                
[build]   Failed:    1 packages failed.                                        
[build] Runtime: 26.1 seconds total.

Any thoughts what might be causing it?

Thank you

RaduCorcodel commented 3 years ago

OK I figured it out myself. A little oversight on my end, I installed the dependencies with rosdep which installed the ros-noetic version of ifopt. Sure enough when I'm running apt-cache search ifopt I'm seeing it installed as ros-noetic-ifopt (which is where the error was pointing to).

So long story short, I removed it with sudo apt remove ros-noetic-ifopt then use wstools:

wstool init src src/trajopt_ros/dependencies.rosinstall

which also pulls Tesseract and all it's dependencies. Then build everything with:

catkin build --force-cmake -DTESSERACT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_TESTING=ON

I'm closing but it would be good to update the Installation instructions with how to properly add the dependencies.

Radu,