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

Support ROS2 iron #24

Open
Tobias-Fischer opened this issue Jun 12, 2023 · 18 comments
Open

Support ROS2 iron #24

Tobias-Fischer opened this issue Jun 12, 2023 · 18 comments

Comments

@Tobias-Fischer
Copy link
Contributor

Any volunteers that want to contribute, please add a comment here or contact me directly.

@songyuc
Copy link

songyuc commented Jul 3, 2023

Hello, my name is Yucheng Song. I’m interested in joining this project because I hope to use ros-iron on the Win11 system. I have about 5 hours per week that I can dedicate to this project. I have basic knowledge of C++ and Python programming. I’m not sure if I have the qualifications to participate, but I’m willing to learn and contribute. Please let me know if I can join. Thank you.

@Tobias-Fischer
Copy link
Contributor Author

Hi @songyuc - that's great to hear!

  1. As a first step, I would recommend setting up https://github.com/RoboStack/ros-humble locally and trying to build some packages.
  2. Once you have this working, you could copy the ros-humble folder to a new ros-iron folder. Then, you would need to rename (most/all?) the occurrences of humble with iron in this repository.
  3. Reset the vinca_*.yaml files to full_rebuild: true and build_number: 0.
  4. Then try to build e.g. the ros_base metapackage.
  5. You probably need to update a lot of the files in the patch folder, as many of the patches would now have been merged in upsteam.

Let me know how you go - I currently have limited time to push this myself, but I'd be happy to provide guidance.

@songyuc
Copy link

songyuc commented Jul 5, 2023

For the first step

Ros-humble installed

I have successfully installed ros-humble, as shown below,
image

Ros2/examples.git constructed

image

@songyuc
Copy link

songyuc commented Jul 6, 2023

Hi, @Tobias-Fischer
I should admit that I am new to ROS2. And I have tried installing ros-humble.
And the question is whether "setting up https://github.com/RoboStack/ros-humble locally" means building it from source?

@Tobias-Fischer
Copy link
Contributor Author

I meant being able to follow the "Testing changes locally" section on https://robostack.github.io/Contributing.html - including the "# Build the recipe using boa:" part.

@songyuc
Copy link

songyuc commented Jul 6, 2023

Thank you for your guidance.

@songyuc
Copy link

songyuc commented Jul 6, 2023

I am trying to set up ros-humble locally. But there was an error when execute vinca --multiple, showing as:

Traceback (most recent call last):
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\Scripts\vinca.exe\__main__.py", line 7, in <module>
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\vinca\main.py", line 1011, in main
    distro = Distro(vinca_conf["ros_distro"], python_version)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\vinca\distro.py", line 11, in __init__
    self._distro = get_cached_distribution(index, distro_name)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\rosdistro\__init__.py", line 137, in get_cached_distribution
    cache = get_distribution_cache(index, dist_name)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\rosdistro\__init__.py", line 177, in get_distribution_cache
    yaml_str = get_distribution_cache_string(index, dist_name)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\rosdistro\__init__.py", line 164, in get_distribution_cache_string
    yaml_gz_str = load_url(url, skip_decode=True)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\site-packages\rosdistro\loader.py", line 48, in load_url
    fh = urlopen(url, timeout=timeout)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 525, in open
    response = meth(req, response)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 634, in http_response
    response = self.parent.error(
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 563, in error
    return self._call_chain(*args)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 496, in _call_chain
    result = func(*args)
  File "C:\Users\songyucheng\mambaforge\envs\robostackenv\lib\urllib\request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request (http://repo.ros2.org/rosdistro_cache/humble-cache.yaml.gz)

I could access the URL (http://repo.ros2.org/rosdistro_cache/humble-cache.yaml.gz), with Edge normally as,
image.
But the error showed at the terminal.

@Tobias-Fischer
Copy link
Contributor Author

That's weird - do you sit behind a firewall or something? Could you please try again to see whether it was temporary?

@songyuc
Copy link

songyuc commented Jul 7, 2023

I am in China currently, where some requests from IPs outside of China may be censored and unable to access.
I test it again and failed.

@songyuc
Copy link

songyuc commented Jul 7, 2023

After some testing, I guess there are two special conditions I should mention about my machine:

  1. Win11 system
  2. VPN for accessing (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)

Condition 2 is a prerequisite for me to access githubusercontent in my current region.

With these two conditions, I found that I could access repo.ros2.org with https as https://repo.ros2.org/rosdistro_cache/humble-cache.yaml.gz.

@songyuc
Copy link

songyuc commented Nov 7, 2023

Hello,

I would like to discuss a potential enhancement to the vinca --multiple command. Currently, in my region, I am required to use a VPN to access certain URLs, including those needed for vinca. I have found that I can access repo.ros2.org using HTTPS directly, which is not blocked.

Could we consider modifying vinca --multiple to default to HTTPS when accessing resources? This change would greatly assist myself and potentially others in similar network-restricted environments.

Thank you for considering this request.

Best regards,
Yucheng Song

@Tobias-Fischer
Copy link
Contributor Author

This is a rosdistro issue, see https://github.com/ros/rosdistro/blob/master/index.yaml

I'd be happy to review a PR in vinca that remaps HTTP requests to HTTPS requests for these URLs.

@IsabelParedes
Copy link

Hi!
I'm trying this out here https://github.com/ihuicatl/ros-iron/tree/iron :)

@traversaro
Copy link
Member

Hi! I'm trying this out here https://github.com/ihuicatl/ros-iron/tree/iron :)

Great, thanks a lot! Feel free to ask for any problem.

@IsabelParedes
Copy link

Hi! I ran into an issue with ament-package already. It builds fine but it causes ament-cmake-core to fail because it's one of its dependencies.

ament-cmake-core fails because it cannot find these files:

  • /tmp/tmpxsb4wg2vlocal_setup.bash.in
  • /tmp/tmp87s9kgz5local_setup.sh.in
  • /tmp/tmpn986xsv3local_setup.zsh.in

Those files definitely do not exist. The path seems to be incorrect. From looking at Humble, the path should be something like this:

  • $PREFIX/lib/python3.10/site-packages/ament_package/template/package_level/local_setup.bash.in
  • $PREFIX/lib/python3.10/site-packages/ament_package/template/package_level/local_setup.sh.in
  • $PREFIX/lib/python3.10/site-packages/ament_package/template/package_level/local_setup.zsh.in

These paths are set with ament-package, but more specifically with importlib_resources.path() (https://github.com/ament/ament_package/blob/cf415e74bb8faff896bb6915ee3d120cc7b60fc3/ament_package/templates.py#L27)

When building Iron, it's using importlib_resources=6.1.1 which is the same version that can be used to build Humble. Somehow it still comes up with different paths. (As a note, for Iron I'm using python=3.11 instead of 3.10).

One of the changes from Humble to Iron was the removal of isolated prefix level template (ament/ament_package#133) which I'm not sure if it's the culprit in this case.

I'll try to dive more into these templates, but if you can think of any easier solutions please let me know. Or maybe there's something else I'm missing.

Btw, I also tested the patches for ament-package and ament-cmake-core from Humble, but it was the same problem.

Thanks!

@traversaro
Copy link
Member

Thanks @ihuicatl ! Do you happen to have the complete failure log somewhere? They may be helpful to help you on the debug, thanks!

@traversaro
Copy link
Member

When building Iron, it's using importlib_resources=6.1.1 which is the same version that can be used to build Humble. Somehow it still comes up with different paths. (As a note, for Iron I'm using python=3.11 instead of 3.10).

With respect to that, note that ament_package uses the stdlib's importlib.resources if it is available (see https://github.com/ament/ament_package/blob/iron/ament_package/templates.py#L19), so I do not think the version of importlib_resources plays a role here.

If you have somewhere the ament_package build for iron, can you run the following Python script to understand what it prints:

import ament_package
import ament_package.templates
print(ament_package.templates.get_package_level_template_path('local_setup.bash.in'))
import importlib
print(importlib.resources.path('ament_package.template.prefix_level',''))
print(ament_package.template.prefix_level.__file__)

@IsabelParedes
Copy link

@traversaro Thanks for the tips! I was able to figure it out now :)

So I found out that importlib.resources.path() is actually deprecated. Instead, one should use files(). So I patched ament-package with those changes. And with that I was able to get the correct paths.

But then, when building ament-cmake-core, cmake was still not able to find the files because the path contained a .egg directory which was not being recognized as a directory. So even though the files were actually there, cmake could not find them.

CMake Error: File /home/user/micromamba/envs/iron-dev/conda-bld/ros-iron-ament-cmake-core-0_1701450248389/_h_env_placehold_..._placeh/lib/python3.11/site-packages/ament_package-0.15.3-py3.11.egg/ament_package/template/package_level/local_setup.zsh.in does not exist.

And the creating of this .egg file is coming from the build scripts, from vinca. It uses setup.py install which is also deprecated now.
This was changed here: https://github.com/RoboStack/vinca/pull/40/files

So I went back to the old way of doing it with pip install and the binaries seem to be installed in the correct location ($PREFIX/lib). And ament-cmake-core builds without issues.

Now I'll move on to the rest of the packages. But maybe I'll fork vinca first to keep these changes. Hopefully this won't be a problem for iron RoboStack/ros-humble#41

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

No branches or pull requests

4 participants