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

Tools: Install uxrceddsgen in Ubuntu #27150

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ryanf55
Copy link
Collaborator

@Ryanf55 Ryanf55 commented May 24, 2024

Purpose

Allow users to more easily install MicroXRCEDDSGen without having to compile it using gradle, for users who use ROS 2 with Ubuntu. This is optional during setup. It is used as a compile-time dependency in ArduPilot. It's not used at runtime, thus is only useful for people who compile ArduPilot from source.

Sizes of downloads:

  • 406B for the script
  • 19M for the jar

@Ryanf55 Ryanf55 added this to the DDS 4.6 milestone May 24, 2024
@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented May 24, 2024

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented May 24, 2024

0001-Github-Enable-DDS-in-environment-setup-testing.patch

Also, this patch could be helpful to ensure DDS is actually going to work.

Copy link
Contributor

@Georacer Georacer left a comment

Choose a reason for hiding this comment

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

Hi!
Apart from the two comments, a couple more questions:

First, the flags DO_UXRCGEN_INSTALL and UXRCE_GEN_TOOL_NAME are not visible anywhere. Where do you propose that they will be documented?

If I understand this correctly, you download microxrceddsgen and microxrceddsgen.jar, but you don't actually use them to produce the DDS libraries. Is this really that useful? The user has to run the generation command anyways.

Also, in your PR descriptions you mention "for users who use ROS2". I don't see a mechanism where these will not be installed with -y if a user doesn't plan to user ROS.

heading "Installing $UXRCE_GEN_TOOL_NAME"
echo "Downloading from ArduPilot release"
sudo mkdir -p $UXRCE_GEN_ROOT
cd $UXRCE_GEN_ROOT
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't you return to the previous directory after this install step is done?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need. The others don't, they use absolute paths for directory changes.

eval $exportline
microxrceddsgen -version
else
echo "Skipping adding $UXRCE_GEN_ROOT to PATH."
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you indeed want to skip adding to path if the -y parameter was passed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, that's what the others do.

cd $UXRCE_GEN_ROOT
sudo wget --progress=dot:giga -P $UXRCE_GEN_ROOT/scripts https://github.com/ArduPilot/Micro-XRCE-DDS-Gen/releases/download/v4.5.0/microxrceddsgen
sudo chmod +x scripts/microxrceddsgen
sudo wget --progress=dot:giga -P $UXRCE_GEN_ROOT/share/microxrceddsgen/java https://github.com/ArduPilot/Micro-XRCE-DDS-Gen/releases/download/v4.5.0/microxrceddsgen.jar
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if these artifacts should be committed to the tree, and/or whether we should be cloning the entire repo rather than grabbing artifacts.

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented May 27, 2024

Hi! Apart from the two comments, a couple more questions:

First, the flags DO_UXRCGEN_INSTALL and UXRCE_GEN_TOOL_NAME are not visible anywhere. Where do you propose that they will be documented?

If I understand this correctly, you download microxrceddsgen and microxrceddsgen.jar, but you don't actually use them to produce the DDS libraries. Is this really that useful? The user has to run the generation command anyways.

Also, in your PR descriptions you mention "for users who use ROS2". I don't see a mechanism where these will not be installed with -y if a user doesn't plan to user ROS.

As best I could, I followed existing patterns. That includes the use of undocumented flags, which are only changed in CI. Thus, I propose doing what's already done and adding more flags, that only CI touches.

No, that is not correct. We download those, which are used to produce the ardupilot binaries. Once the binaries are created, microxrceddsgen is not needed at runtime.

If a user says "n" to the question, it won't be installed, just like the other optional features in setup. If it doesn't do that, it's a bug.

@peterbarker
Copy link
Contributor

[8:25 AM]Peter Barker: How often does it change?  How co-dependent is the ArduPilot build on it?  i.e. the install script is run once, so gets the jar once.  If it is out of date/non-functional in 2 months then that's a problem as everyone's DDS setup breaks.
[8:59 AM]RyanF: I hasn't changed since 4.5, but we expect one major version bump before 4.6.
[9:25 AM]Peter Barker: .... breaking everyone's DDS setups.  Thus my question about adding it as an artifact to the ArduPilot repo.  How big is it?
[9:28 AM]RyanF: 406B for the script and 19M for the jar.

@Ryanf55
Copy link
Collaborator Author

Ryanf55 commented Nov 17, 2024

Can we try this workflow out first? We have the 4.5.1 version that fixed some extranneous stderr behavior, but otherwise expect no changes. This PR makes a good improvement significant improvement in user setup time lowering the barrier to entry in using ROS 2.

@Ryanf55 Ryanf55 marked this pull request as draft January 8, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

4 participants