osrf / vrx

Virtual RobotX (VRX) resources.
Apache License 2.0
421 stars 189 forks source link

`generate_wamv.py` should not produce a compliance error on an empty WAMV #658

Closed M1chaelM closed 1 year ago

M1chaelM commented 1 year ago

This fixes issue #640

To test, follow this tutorial: https://github.com/osrf/vrx/wiki/empty_wamv_tutorial

Make sure there is no error message in the output; i.e. after running

ros2 launch vrx_gazebo generate_wamv.launch.py component_yaml:=`pwd`/empty_component_config.yaml thruster_yaml:=`pwd`/empty_thruster_config.yaml wamv_target:=`pwd`/wamv_target.urdf wamv_locked:=False

you should NOT see:

[generate_wamv.py-1] [ERROR] [1683911879.733853761] [configure_wamv]: 
[generate_wamv.py-1] This component/thruster configuration is NOT compliant with the (current) VRX constraints. A urdf file will be created, but please note that the above errors must be fixed for this to be a valid configuration for the VRX competition.
M1chaelM commented 1 year ago

:confused: Testing is failing with the following error:

--- stderr: ros_gz_bridge
CMake Error at CMakeLists.txt:81 (find_package):
  By not providing "Findactuator_msgs.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "actuator_msgs", but CMake did not find one.

  Could not find a package configuration file provided by "actuator_msgs"
  with any of the following names:

    actuator_msgsConfig.cmake
    actuator_msgs-config.cmake

  Add the installation prefix of "actuator_msgs" to CMAKE_PREFIX_PATH or set
  "actuator_msgs_DIR" to a directory containing one of the above files.  If
  "actuator_msgs" provides a separate development package or SDK, be sure it
  has been installed.

I don't think this was produced by the 4 character change introduced in the PR. @caguero Are you aware of anything changing on the backend?

M1chaelM commented 1 year ago

It seems that the checkout action has deprecated version 2.4.0, and we should update to v3. I did this, but it produces a new error:

Run actions/checkout@v3
/usr/bin/docker exec  2134273f20e92c767cdeb1c546e1a2024fc02fd0e0153b5854f4cc3e4aebc593 sh -c "cat /etc/*release | grep ^ID"
node:internal/fs/utils:345
    throw err;
    ^

This appears to be caused by the fact that our test image has a non-root user, and Github actions expects everyone to run as root (see https://github.com/actions/checkout/issues/1014, https://github.com/actions/checkout/issues/956, and https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user).

Overriding the container user and setting it to root works around the issue, but then the test fails with the same error as before. By updating the ros_gz repository I was able to reproduce this locally, so it seems to be something introduced recently in ros_gz.

Given the timing, I suspect https://github.com/gazebosim/ros_gz/pull/394/files is the culprit.

M1chaelM commented 1 year ago

The recent change to ros_gz introduced a new dependency on ros-humble-actuator-messages (see the explanation here: https://github.com/gazebosim/ros_gz/issues/397). I've fixed this by adding it to the CI image. Long term, I think it would be better to move to a binary install of Gazebo Garden (see #662 ) since that's generally more accessible to our users.

M1chaelM commented 1 year ago

@j-herman Do you have time to take a look at this? It should be pretty quick and it fixes the CI, which affects our other PRs.