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

Fixed fastrtps version reading in microRTPS generation for ROS2 built from sources #155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions scripts/generate_microRTPS_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,14 @@
fastrtps_version = subprocess.check_output(
"ldconfig -v 2>/dev/null | grep libfastrtps", shell=True).decode("utf-8").strip().split('so.')[-1]
else:
# grab the version of the ros-<ros_distro>-fastrtps package
fastrtps_version = re.search(r'Version:\s*([\dd.]+)', subprocess.check_output(
"dpkg -s ros-" + ros2_distro + "-fastrtps 2>/dev/null | grep -i version", shell=True).decode("utf-8").strip()).group(1)
try:
# grab the version of the ros-<ros_distro>-fastrtps package
fastrtps_version = re.search(r'Version:\s*([\dd.]+)', subprocess.check_output(
"dpkg -s ros-" + ros2_distro + "-fastrtps 2>/dev/null | grep -i version", shell=True).decode("utf-8").strip()).group(1)
except subprocess.CalledProcessError:
# if ROS2 was installed from sources the command above fails, get the system-wide version instead
fastrtps_version = subprocess.check_output(
"ldconfig -v 2>/dev/null | grep libfastrtps", shell=True).decode("utf-8").strip().split('so.')[-1]


# If nothing specified it's generated both
Expand Down