I’m running a clean version of Ubuntu 18.04 LTS on a Mac. I’m trying to follow the instructions at PX4/sitl_gazebo, but I’m running into an error during make:
[ 71%] Built target gazebo_geotagged_images_plugin
Scanning dependencies of target gazebo_multirotor_base_plugin
/home/sean/src/sitl_gazebo/src/gazebo_mavlink_interface.cpp: In member function ‘void gazebo::GazeboMavlinkInterface::LidarCallback(gazebo::LidarPtr&, const int&)’:
/home/sean/src/sitl_gazebo/src/gazebo_mavlink_interface.cpp:1048:14: error: ‘mavlink_distance_sensor_t {aka struct __mavlink_distance_sensor_t}’ has no member named ‘signal_quality’
sensor_msg.signal_quality = lidar_message->signal_quality();
^~~~~~~~~~~~~~
/home/sean/src/sitl_gazebo/src/gazebo_mavlink_interface.cpp: In member function ‘void gazebo::GazeboMavlinkInterface::SonarCallback(gazebo::SonarPtr&, const int&)’:
/home/sean/src/sitl_gazebo/src/gazebo_mavlink_interface.cpp:1120:14: error: ‘mavlink_distance_sensor_t {aka struct __mavlink_distance_sensor_t}’ has no member named ‘signal_quality’
sensor_msg.signal_quality = sonar_message->signal_quality();
^~~~~~~~~~~~~~
[ 72%] Building CXX object CMakeFiles/gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-address-of-packed-member’
CMakeFiles/gazebo_mavlink_interface.dir/build.make:62: recipe for target ‘CMakeFiles/gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o’ failed
make[2]: *** [CMakeFiles/gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o] Error 1
CMakeFiles/Makefile2:865: recipe for target ‘CMakeFiles/gazebo_mavlink_interface.dir/all’ failed
make[1]: *** [CMakeFiles/gazebo_mavlink_interface.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 73%] Linking CXX shared library libgazebo_wind_plugin.so
Depends: is this being buily inside the PX4 Firmware build system, or inside a catkin workspace? If it is the former, then the current upstream master already has the correct Mavlink headers submodule up to date. If it is the latest, then no, it’s not up-to-date, since it depends on the releases of Mavlink to the ROS build farm (mavlink-gbp-release).
When I do this and try to build with catkin_make I get the error:
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
'catkin_make_isolated' command instead.
Call Stack (most recent call first):
CMakeLists.txt:67 (catkin_workspace)
-- Configuring incomplete, errors occurred!
See also "/home/gus/Documents/git/jason_ros_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/gus/Documents/git/jason_ros_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
Thus, I tried building with catkin build but I get the error:
Something I think is worth highlighting, to run something within your workspace together with px4 you must first source your workspace and then px4 (as far as I know). I think it is worth adding the commands for source in the correct order in your ~ / .bashrc