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

Do not die without any installed ROS distro #39

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Do not die without any installed ROS distro #39

merged 1 commit into from
Oct 24, 2024

Conversation

fmauch
Copy link
Contributor

@fmauch fmauch commented Aug 9, 2024

People might install ROS by themselves differently, e.g. though a source installation which does not install into /opt/ros or through Robostack.

This commit allows having an empty / non-existing /opt/ros without dying when creating environments (both, catkin and colcon workspaces). The output states that the distro 'None' is used, sourcing without an existing build states that users should take care about sourcing their ROS installation. Building without a source ROS installation will probably lead to errors in the output, but I would leave that to the user's responsibility for now.

E.g. requesting a colcon workspace without an existing ROS installation leads to

Requested to not create a misc workspace
Requested to not create a catkin_ws
Creating colcon_ws
log_dir: /root/checkout/bar2/colcon_ws/log
install_dir: /root/checkout/bar2/colcon_ws/install
Building colcon_ws in /root/checkout/bar2/colcon_ws
Building with command colcon build --symlink-install --cmake-args   -DCMAKE_EXPORT_COMPILE_COMMANDS=1
bash: line 1: colcon: command not found
None
Something went wrong while creating the environment!
Execution of module 'add' failed. Error message:
'None'

Closes #38

@DariusPietschatConbotics if you could test that, that would be really nice!

People might install ROS by themselves differently, e.g. though a source installation which does not install into /opt/ros or through Robostack.

This commit allows having an empty / non-existing /opt/ros without dying when creating environments (both, catkin and colcon workspaces).
The output states that the distro 'None' is used, sourcing without an existing build states that users should take care about sourcing their ROS installation.
Building without a source ROS installation will probably lead to errors in the output, but I would leave that to the user's responsibility for now.
@fmauch fmauch self-assigned this Aug 9, 2024
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 10.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 52.51%. Comparing base (d647765) to head (f6603fd).

Files Patch % Lines
src/robot_folders/helpers/environment_helpers.py 0.00% 16 Missing ⚠️
src/robot_folders/helpers/ros_version_helpers.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #39      +/-   ##
==========================================
- Coverage   52.73%   52.51%   -0.22%     
==========================================
  Files          27       27              
  Lines        1479     1489      +10     
==========================================
+ Hits          780      782       +2     
- Misses        699      707       +8     
Flag Coverage Δ
unittests 52.51% <10.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DariusPietschatConbotics

Hey!
I was able to get this working. As you described, the ROS distribution will say None but the initial compilation still starts, if I have my ROS sourced beforehand.
After switching branches of robot_folders I managed to run into this issue of catkin_tools. But I don't know if that is related at all.

@fmauch
Copy link
Contributor Author

fmauch commented Sep 13, 2024

Thanks for testing this out @DariusPietschatConbotics. I don't really know why I left this as a draft. But since it is working for you I guess, this can get merged.

@fmauch fmauch marked this pull request as ready for review October 24, 2024 05:52
@fmauch fmauch merged commit d074825 into main Oct 24, 2024
10 checks passed
@fmauch fmauch deleted the fix_no_opt branch October 24, 2024 05:53
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.

ROS not found, add_environment breaks
3 participants