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

docs: initial addition of ros2 tutorial #1116

Merged
merged 11 commits into from
Apr 8, 2024

Conversation

ruben-arts
Copy link
Contributor

Closes #1115

This is an initial try to make a simple tutorial. I feel it could be heavily extended but it feels hard to do it in steps. Input is very much appreciated.

Test this PR by running:

pixi run docs

And then open http://127.0.0.1:8000/pixi/tutorials/ros2/

docs/tutorials/ros2.md Outdated Show resolved Hide resolved
Co-authored-by: Silvio Traversaro <[email protected]>
docs/tutorials/ros2.md Outdated Show resolved Hide resolved
docs/tutorials/ros2.md Outdated Show resolved Hide resolved
docs/tutorials/ros2.md Outdated Show resolved Hide resolved
Comment on lines 88 to 93
Normally this would be the script you add to your `.bashrc` but now you tell pixi to use it.

```toml title="pixi.toml"
[activation]
scripts = ["install/setup.sh"]
```
Copy link
Contributor

Choose a reason for hiding this comment

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

This part is the only one that does not works on Windows, probably we want to mention at the beginning of the tutorial that the tutorial does not work on Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I improved the story to include the multi platform work.

@traversaro
Copy link
Contributor

Really cool! I see the point of showing the use pixi run ros2 run and the tasks system, but as this may be the first exposure to pixi for ROS 2 users, I would also mention somewhere of the existence of pixi shell, even just with those box that can be expanded.

Probably it is a bit out of scope, but one thing that we may want to at least warn the user about is rosdep . If one wanted to use rosdep, what would happen is that rosdep would call conda install, and I am not sure what would happen at that point in the pixi environment. I guess it may be possible to modify rosdep to actually call pixi add, but that is probably another story.

@ruben-arts
Copy link
Contributor Author

Thank you for the input @traversaro! Will update it!

To build a C++ node you need to add the `ament_cmake` and some other build dependencies to your manifest file.
```shell
pixi add ros-humble-ament-cmake-auto compilers pkg-config cmake
pixi add gcc_linux-64 gxx_linux-64 make -p linux-64
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to install manually gcc_linux-64 and gxx_linux-64 , shouldn't those be installed by compilers ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a mistake! Let me fix that. Still need to test on more platforms.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. Probably you also need to add make on all non-windows platform. To be honest, I typically install both make and ninja also on Windows just to avoid confusion. I think it would be useful to eventually add a build-essential or build-essential-cpp meta-package to conda-forge that depends on compilers and all these tools (perhaps even meson), but I never put the effort to start a discussion on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, that would help to get started with conda.

@traversaro
Copy link
Contributor

traversaro commented Apr 5, 2024

Probably it is a bit out of scope, but one thing that we may want to at least warn the user about is rosdep . If one wanted to use rosdep, what would happen is that rosdep would call conda install, and I am not sure what would happen at that point in the pixi environment. I guess it may be possible to modify rosdep to actually call pixi add, but that is probably another story.

Just for alignment, to add rosdep support for pixi the required modifications are not so many:

(the PR are not merged but we have them integrated as patches in the conda-forge corresponding packages, see https://github.com/conda-forge/rosdep-feedstock/blob/d3a72b237c86299d398f0f552eb3623fe95dba64/recipe/810.patch)

@ruben-arts ruben-arts added the 📖 documentation Improvements or additions to documentation label Apr 5, 2024
@ruben-arts ruben-arts self-assigned this Apr 5, 2024
@ruben-arts ruben-arts marked this pull request as ready for review April 8, 2024 08:45
@ruben-arts ruben-arts merged commit ffedf36 into prefix-dev:main Apr 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tutorial to build a ROS2 pixi project
3 participants