ethz-asl / mav_active_3d_planning

Modular framework for online informative path planning.
BSD 3-Clause "New" or "Revised" License
552 stars 110 forks source link

[Build Fails] Buildling mavros package fails with `catkin build` command; some variables does not name a type #56

Closed GAEUNYIM closed 1 year ago

GAEUNYIM commented 1 year ago

Hi!

I am trying to build mav_active_3d_planning package with the given installation steps. But it seems to have an error with building mavros package with catkin build command.

I created a docker container with Ubuntu 18.04 image, and installed ROS1 (melodic) inside. Please let me know if I missed some useful information here.

Below errors are the messages I had.

Thank you in advance!


Errors << mavros:make /root/catkin_ws/logs/mavros/build.make.000.log
In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_sensor_orientation.cpp:17:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_AUTOPILOT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: error: 'MAV_AUTOPILOT' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_AUTOPILOT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_sensor_orientation.cpp:17: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:34:12: note: 'mavlink::minimal::MAV_AUTOPILOT' enum class MAV_AUTOPILOT : uint8_t ^~~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_sensor_orientation.cpp:17:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: error: 'MAV_TYPE' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: note: suggested alternative: 'AIS_TYPE' std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ AIS_TYPE /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: error: 'MAV_STATE' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: note: suggested alternative: 'MAV_FRAME' std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ MAV_FRAME /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: error: 'MAV_COMPONENT' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: note: suggested alternative: 'MAV_MODE' std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ MAV_MODE /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:114:18: error: 'MAV_TYPE' in namespace 'mavlink::common' does not name a type mavlink::common::MAV_TYPE mav_type_from_str(const std::string &mav_type); ^~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_AUTOPILOT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: error: 'MAV_AUTOPILOT' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_AUTOPILOT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:70:40: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:34:12: note: 'mavlink::minimal::MAV_AUTOPILOT' enum class MAV_AUTOPILOT : uint8_t ^~~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: error: 'MAV_TYPE' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:71:40: note: suggested alternative: 'AIS_TYPE' std::string to_string(mavlink::common::MAV_TYPE e); ^~~~ AIS_TYPE /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: error: 'MAV_STATE' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:72:40: note: suggested alternative: 'MAV_FRAME' std::string to_string(mavlink::common::MAV_STATE e); ^~~~~ MAV_FRAME /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:68:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::MAV_SENSOR_ORIENTATION)' std::string to_string(mavlink::common::MAV_SENSOR_ORIENTATION e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: error: 'MAV_COMPONENT' is not a member of 'mavlink::common' std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:73:40: note: suggested alternative: 'MAV_MODE' std::string to_string(mavlink::common::MAV_COMPONENT e); ^~~~~ MAV_MODE /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:114:18: error: 'MAV_TYPE' in namespace 'mavlink::common' does not name a type mavlink::common::MAV_TYPE mav_type_from_str(const std::string &mav_type); ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:24:24: error: 'mavlink::common::MAV_AUTOPILOT' has not been declared using mavlink::common::MAV_AUTOPILOT; ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:25:24: error: 'mavlink::common::MAV_TYPE' has not been declared using mavlink::common::MAV_TYPE; ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:26:24: error: 'mavlink::common::MAV_STATE' has not been declared using mavlink::common::MAV_STATE; ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:27:24: error: 'mavlink::common::MAV_COMPONENT' has not been declared using mavlink::common::MAV_COMPONENT; ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:131:23: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(MAV_AUTOPILOT e) ^~~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:80:13: note: previous declaration 'std::__cxx11::string mavros::utils::to_string(mavlink::common::LANDING_TARGET_TYPE)' std::string to_string(mavlink::common::LANDING_TARGET_TYPE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:131:23: error: 'MAV_AUTOPILOT' was not declared in this scope std::string to_string(MAV_AUTOPILOT e) ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:131:23: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:34:12: note: 'mavlink::minimal::MAV_AUTOPILOT' enum class MAV_AUTOPILOT : uint8_t ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:192:23: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(MAV_TYPE e) ^~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:80:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::LANDING_TARGET_TYPE)' std::string to_string(mavlink::common::LANDING_TARGET_TYPE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:192:23: error: 'MAV_TYPE' was not declared in this scope std::string to_string(MAV_TYPE e) ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:192:23: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:63:12: note: 'mavlink::minimal::MAV_TYPE' enum class MAV_TYPE : uint8_t ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:243:21: error: 'MAV_TYPE' was not declared in this scope std::string to_name(MAV_TYPE e) ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:243:21: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:63:12: note: 'mavlink::minimal::MAV_TYPE' enum class MAV_TYPE : uint8_t ^~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:244:1: error: expected ',' or ';' before '{' token { ^ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:280:23: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(MAV_STATE e) ^~~~~ In file included from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19:0: /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:80:13: note: previous declaration 'std::__cxx11::string mavros::utils::to_string(mavlink::common::LANDING_TARGET_TYPE)' std::string to_string(mavlink::common::LANDING_TARGET_TYPE e); ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:280:23: error: 'MAV_STATE' was not declared in this scope std::string to_string(MAV_STATE e) ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:280:23: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:146:12: note: 'mavlink::minimal::MAV_STATE' enum class MAV_STATE : uint8_t ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:584:23: error: 'std::cxx11::string mavros::utils::to_string' redeclared as different kind of symbol std::string to_string(MAV_COMPONENT e) ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:431:13: note: previous declaration 'std::cxx11::string mavros::utils::to_string(mavlink::common::GPS_FIX_TYPE)' std::string to_string(GPS_FIX_TYPE e) ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:584:23: error: 'MAV_COMPONENT' was not declared in this scope std::string to_string(MAV_COMPONENT e) ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:584:23: note: suggested alternative: In file included from /opt/ros/melodic/include/mavlink/v2.0/common/../standard/standard.hpp:42:0, from /opt/ros/melodic/include/mavlink/v2.0/common/common.hpp:2674, from /root/catkin_ws/src/mavros/libmavconn/include/mavconn/mavlink_dialect.h:26, from /root/catkin_ws/src/mavros/mavros_msgs/include/mavros_msgs/mavlink_convert.h:18, from /root/catkin_ws/src/mavros/mavros/include/mavros/utils.h:22, from /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:19: /opt/ros/melodic/include/mavlink/v2.0/common/../standard/../minimal/minimal.hpp:165:12: note: 'mavlink::minimal::MAV_COMPONENT' enum class MAV_COMPONENT ^~~~~ /root/catkin_ws/src/mavros/mavros/src/lib/enum_to_string.cpp:608:1: error: 'MAV_TYPE' does not name a type; did you mean 'LC_CTYPE'? MAV_TYPE mav_type_from_str(const std::string &mav_type) ^~~~ LC_CTYPE make[2]: [CMakeFiles/mavros.dir/src/lib/enum_sensor_orientation.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... make[2]: [CMakeFiles/mavros.dir/src/lib/enum_to_string.cpp.o] Error 1 make[1]: [CMakeFiles/mavros.dir/all] Error 2 make: *** [all] Error 2

GAEUNYIM commented 1 year ago

Hi again,

I solved this issue, by manually installing mavros package.

  1. Install mavros package with following instructions. (https://docs.px4.io/main/ko/ros/mavros_installation.html)
  2. Before running wstool update command, remove following line for mavros package in ./mav_active_3d_planning/mav_active_3d_planning_https.rosinstall file. following line : - git: {local-name: mavros, uri: 'https://github.com/ethz-asl/mavros.git'}

I don't understand why this solution works, because both mavros was developed from ethz-asl. BTW now I am happy to go into next step.

Thank you!

Schmluk commented 1 year ago

Thanks for the patience and great that you got it running! Unfortunately not all versions of all packages are equally maintained and compatible, and while mavros is a huge project active_3d_planning uses only a minimal part of it. Closing this as solved.