Closed ivolkg closed 3 years ago
You got it: https://aur.archlinux.org/packages/ros2-foxy-xacro/ :)
I'll also upload some other common ROS packages later but over all you'll probably have to build some packages manually. By the way, if you have experience with ROS I'd be happy if you can name like 5-10 other commonly used packages that come to your mind so that I can put them at higher priority for AUR.
Thanks I'm pretty new at ROS but I have to use it for my masters and I really don't want to use Ubuntu, so maybe I will encounter more of this problems
So if you could point me in the right direction as to how I can build ROS packages from scratch I will be more than happy to contribute and upload them at the AUR
I'm having this issue
This command should solve the issue:
mkdir -p /home/isaac/.cache/paru/clone/ros2-foxy/src
ln -s /opt/ros2/foxy /home/isaac/.cache/paru/clone/ros2-foxy/src/install
This is caused by a bug in the pkgbuild and I'll solve it ASAP. See #5.
So if you could point me in the right direction as to how I can build ROS packages from scratch I will be more than happy to contribute and upload them at the AUR
You can start by studying xacro pkgbuild itself.
Most ROS packages are more complicated than xacro though. A ROS package can depend on other ROS packages, as well as non-ROS packages that install on OS itself. Furthermore, those dependencies that are ROS packages can themselves depend on ROS and non-ROS packages. This makes a recursive process until you reach simple packages with no special dependencies.
For example, here's my pkgbuild for ros2-localization
package which I've not tested enough to publish in AUR.
# Maintainer: Mohammad Mostafa Farzan <m2_farzan@yahoo.com>
pkgname=ros2-robot-localization-git
pkgver=r991.212bfb0
pkgrel=1
pkgdesc="Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS 2"
url="https://navigation.ros.org/tutorials/docs/navigation2_with_slam.html"
arch=('any')
depends=('ros2-git'
'ros2-navigation-git'
'ros2-diagnostics-git'
)
source=("robot_localization::git+https://github.com/cra-ros-pkg/robot_localization#branch=ros2"
"git+https://github.com/ros-geographic-info/geographic_info#branch=ros2")
sha256sums=('SKIP'
'SKIP')
pkgver() {
cd $srcdir/robot_localization
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
sed -i "s/c++14/c++17/g" $srcdir/robot_localization/CMakeLists.txt
}
build() {
source /opt/ros2/rolling/setup.sh
colcon build --merge-install
}
package() {
# Copy build files
mkdir -p $pkgdir/opt/ros2/rolling
cp -r $srcdir/install/* $pkgdir/opt/ros2/rolling/
# Exclude files that clash with base ros installation
rm $pkgdir/opt/ros2/rolling/*setup.*
rm $pkgdir/opt/ros2/rolling/_local_setup*
rm $pkgdir/opt/ros2/rolling/COLCON_IGNORE
}
Note that the package depends on other ROS packages. For two of them I created separate pkgbuilds (navigation
, diagnostic
) because I felt they are common packages. For geographic_info
I didn't bother making yet another pkgbuild. I just added clone instruction so that it'll be built by colcon before the main package—colcon automatically builds dependencies first. If later on I run into another package with geographic_info
dependency, I'll refactor it as a new package. There are no strict rules, and IMO going too granular will just create clutter.
The base ros2-foxy (or ros2-git) package itself installs a few hundred base packages and all ROS packages depend on it.
So how to find out what are dependencies of a package? Here's some tips:
rosdep check --from-paths <package_source_path>
displays non-ROS dependencies of a package. You can find Arch equivalents by searching the names in https://www.archlinux.org/packages/ first and https://aur.archlinux.org/packages/.package.xml
should reveal ROS dependencies. Note that some of them are probably already installed by ros2-foxy or ros2-git. ros2 pkg list | grep <package_name>
should help here. However, if you've also installed stuff from AUR they'll also show up in the list. To distinguish them, run the command like ls /opt/ros2/rolling/share/ | grep xacro | xargs pacman -Qo
which reveals the pacman package that installed the ros package.I've just created a separate repo for these non-base ros2 packages, like xacro: https://github.com/m2-farzan/ros2-supplementary-pkgbuilds
I've uploaded a few packages there that I already had. But they are not stable and tested yet. If you have any comments, questions or contributions, please create issues/PR's there as I want to keep this repo dedictated to base ros2-foxy package.
Thanks
I see that xacro is available in AUR for other ros distros but not for foxy