Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ROS build CI #868

Closed
wants to merge 4 commits into from
Closed

Conversation

AustinDeric
Copy link

fixes this bug which is currently in the master branch's CI: https://github.com/PX4/PX4-SITL_gazebo/runs/6721857960

Errors << mavlink_sitl_gazebo:make /github/home/catkin_ws/logs/mavlink_sitl_gazebo/build.make.000.log
In file included from /github/home/catkin_ws/src/PX4-SITL_gazebo/src/gazebo_camera_manager_plugin.cpp:18:0:
/github/home/catkin_ws/src/PX4-SITL_gazebo/include/gazebo_camera_manager_plugin.h:21:10:fatal error: development/mavlink.h: No such file or directory
 #include <development/mavlink.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/gazebo_camera_manager_plugin.dir/src/gazebo_camera_manager_plugin.cpp.o] Error 1
make[1]: *** [CMakeFiles/gazebo_camera_manager_plugin.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
cd /github/home/catkin_ws/build/mavlink_sitl_gazebo; catkin build --get-env mavlink_sitl_gazebo | catkin env -si  /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << mavlink_sitl_gazebo:make            [ Exited with code 2 ]  

The bug was reproduced in this PRs commit: AustinDeric@3236491.

The next commit fixes this bug: AustinDeric@9b6cdbd

These 2 commits fix the original CI bug identified in the master.


Its notable that there is a different bug that this exposes:

> [ 9/10] RUN source "/opt/ros/galactic/setup.bash" &&     export CPLUS_INCLUDE_PATH=/mavlink/include/mavlink/v2.0 &&     colcon build:                                                                  
#13 1.042 Starting >>> mavlink_sitl_gazebo                                                           
#13 124.3 --- stderr: mavlink_sitl_gazebo                                                            
#13 124.3 CMake Warning:                                                                             
#13 124.3   Manually-specified variables were not used by the project:
#13 124.3 
#13 124.3     CATKIN_INSTALL_INTO_PREFIX_ROOT
#13 124.3 
#13 124.3 
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp: In member function ‘void gazebo::GimbalControllerPlugin::HandleCommandLong(const mavlink_message_t&)’:
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:805:10: error: ‘MAV_CMD_REQUEST_MESSAGE’ was not declared in this scope
#13 124.3   805 |     case MAV_CMD_REQUEST_MESSAGE:
#13 124.3       |          ^~~~~~~~~~~~~~~~~~~~~~~
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_gimbal_controller_plugin.cpp:808:10: error: ‘MAV_CMD_SET_MESSAGE_INTERVAL’ was not declared in this scope; did you mean ‘MAVLINK_MSG_ID_MESSAGE_INTERVAL’?
#13 124.3   808 |     case MAV_CMD_SET_MESSAGE_INTERVAL:
#13 124.3       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3       |          MAVLINK_MSG_ID_MESSAGE_INTERVAL
#13 124.3 make[2]: *** [CMakeFiles/gazebo_gimbal_controller_plugin.dir/build.make:63: CMakeFiles/gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o] Error 1
#13 124.3 make[1]: *** [CMakeFiles/Makefile2:1026: CMakeFiles/gazebo_gimbal_controller_plugin.dir/all] Error 2
#13 124.3 make[1]: *** Waiting for unfinished jobs....
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp: In member function ‘void gazebo::CameraManagerPlugin::_handle_message(mavlink_message_t*, sockaddr*)’:
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:310:18: error: ‘MAV_CMD_IMAGE_START_CAPTURE’ was not declared in this scope
#13 124.3   310 |             case MAV_CMD_IMAGE_START_CAPTURE:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:313:18: error: ‘MAV_CMD_IMAGE_STOP_CAPTURE’ was not declared in this scope
#13 124.3   313 |             case MAV_CMD_IMAGE_STOP_CAPTURE:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:316:18: error: ‘MAV_CMD_REQUEST_CAMERA_INFORMATION’ was not declared in this scope; did you mean ‘MAVLINK_MSG_ID_CAMERA_INFORMATION’?
#13 124.3   316 |             case MAV_CMD_REQUEST_CAMERA_INFORMATION:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3       |                  MAVLINK_MSG_ID_CAMERA_INFORMATION
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:319:18: error: ‘MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS’ was not declared in this scope; did you mean ‘MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS’?
#13 124.3   319 |             case MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3       |                  MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:322:18: error: ‘MAV_CMD_REQUEST_STORAGE_INFORMATION’ was not declared in this scope; did you mean ‘MAVLINK_MSG_ID_STORAGE_INFORMATION’?
#13 124.3   322 |             case MAV_CMD_REQUEST_STORAGE_INFORMATION:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 124.3       |                  MAVLINK_MSG_ID_STORAGE_INFORMATION
#13 124.3 /ros_ws/src/mavlink_sitl_gazebo/src/gazebo_camera_manager_plugin.cpp:325:18: error: ‘MAV_CMD_REQUEST_CAMERA_SETTINGS’ was not declared in this scope
#13 124.3   325 |             case MAV_CMD_REQUEST_CAMERA_SETTINGS:
#13 124.3       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(there are more but its similar, I edited for clarity)

This is the bug that i want to fix, but there was no was to reproduce them. This PR enables reproducing these bugs. So this is the 1st PR of many.

@AustinDeric
Copy link
Author

I didn't realize there were nested submodule locaed at external/OpticalFlow/external/klt_feature_tracker. I'd recommend these external ROS dependencies get installed canonically and not inside this package. This can be done with a apt install, a .repos file using vcstool or a submodule that doesn't install inside this package.

Fixed it and you can see it working here: https://github.com/AustinDeric/PX4-SITL_gazebo/runs/6746720074

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I apologize on myside that the CI has been broken for a while.

I didn't realize there were nested submodule locaed at external/OpticalFlow/external/klt_feature_tracker. I'd recommend these external ROS dependencies get installed canonically and not inside this package. This can be done with a apt install, a .repos file using vcstool or a submodule that doesn't install inside this package.

This is only relevant when building this package as part of ROS. This repository is a submodule of the PX4-Autopilot project, which does not depend on ROS. Therefore we cannot access the ros distributed package


RUN source "/opt/ros/${ROS_DISTRO}/setup.bash" && \
export CPLUS_INCLUDE_PATH=/mavlink/include/mavlink/v2.0 && \
colcon build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not very familiar with colcon, but this is build testing ROS1 versions with colcon, which was not the intention of the catkin build tests. Could you elaborate on what we would gain switching to colcon and whether it would verify also building with catkin?

matrix:
config:
- {rosdistro: 'melodic', container: 'px4io/px4-dev-ros-melodic:2021-05-31'}
- {rosdistro: 'noetic', container: 'px4io/px4-dev-ros-noetic:2021-05-31'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of reasons we want to use this container is to align the CI containers and check whether SITL is functional.

@AustinDeric
Copy link
Author

Thanks for the reviews! unfortunately i don't have the time to address them but i hope the code in this PR can help y'all in the future. The PX4 ignition gazebo framework lines up more closely with my interests so i am going to focus my limited time there: https://github.com/Auterion/px4-simulation-ignition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants