Closed marip8 closed 5 months ago
When I create a new "ROS Project", the Distribution:
drop-down menu does not list a ROS distribution initially:
and the
.workspace
file also contains no distribution:
<?xml version="1.0"?>
<Workspace>
<Distribution path=""/>
<DefaultBuildSystem value="2"/>
</Workspace>
Does this not work in your case?
I should have clarified that I did not have this issue when I was using the snap
distributed version of Qt Creator and this plugin. What you described above is also what I would see when I used the snap
version.
I recently switched from the snap
version to the nominal Qt installer version (i.e., from their website); the problems I described above occur in the Qt installer version of Qt Creator. It does find both distributions of ROS by default (maybe the snap
version can't find them because it can't access /opt
from its sandbox directory?), so I'm forced to choose one or the other.
When I set <Distribution path="">
, I get the following message: [ROS Error] Project file distribution [] is not installed. Setting to [/opt/ros/foxy], if incorrect modify project file [calibration_ws.workspace].
Then I think the plugin sources the setup.bash
file of the "default" version of ROS every time it builds because I see ROS environment variables in the build dialog and in a terminal after I source the workspace
I think this might be the code to change to get around this issue:
Can you send a PR that implements the feature you need?
I also noticed that when I change the entry in the Distribution:
drop-down list to something with a path, then I cannot change back to an empty entry. To make this explicit and more robust, the list should contain an explicit empty entry.
Can you send a PR that implements the feature you need?
Sure. I opened the issue without a PR mostly because I wasn't sure what all files needed to be changed and thought you or @Levi-Armstrong might know of a better solution.
I added that feature to the upcoming Qt Creator 13 plugin: https://github.com/ros-industrial/ros_qtc_plugin/pull/495. Please test and let me know if this works or you.
Problem
There are now quite a few tools in the ROS-I ecosystem that are independent of ROS such that they can support both ROS1 and ROS2 layers simultaneously. As of version 12.0.0, it appears that part of the plugin build process (at least for
colcon
) forces the sourcing of the selected distribution'ssetup.bash
file. This is a problem for me because I want to build a ROS-independent project in Qt Creator and then build both the ROS1 and ROS2 layers as separate projects in Qt, using the ROS-independent project as an underlay.Currently, my ROS-independent build (using
colcon
) is being forced to source ROS2 (I had to choose a distro, so I chose a ROS2 one), and my chained ROS1 workspace build (usingcolcon
) fails because sourcing the upstream workspace only lets it know about ROS2 things.What I tried to get around this issue
ROS_DISTRO
, etc. before building.Source workspace
button, so it appears that the build process sources/opt/ros/<distro>/setup.bash
during the build<Distribution />
key from the.workspace
file, manually building the workspace first, then clicking theSource workspace
button in the build dialog before rebuildingDesired solution
I think the ideal solution would be to add an empty string or "None" option in the
Distribution
drop down box in the ROS project configuration menu and make the sourcing of/opt/ros/<distro>/setup.bash
optional based on the value of this field.