How to generate .deb from catkin workspace in ROS - ros

I can compile and install ROS package in the catkin workspace in ROS. How can I export the package in catkin workspace to a .deb file so I can install and use it on the other machines?
My ROS version is ROS Indigo and OS version is Ubuntu 14.04

Here is a step-by-step guide of doing it using ROS bloom:
Navigate to your package path
cd /path/to/package
Use ROS bloom to create the .deb file
bloom-generate rosdebian --os-name ubuntu --ros-distro kinetic fakeroot debian/rules binary
* If your ROS distribution is different from Kinetic, replace kinetic with your distribution
Copy the .deb file to the other machine, and in its folder type
sudo dpkg -i packagename.deb
this will install the package on that machine, and you are now able to use it like any other ROS package

1 - I think the ROS build farm would be a good starting point and solution for that. You cannot create a .deb as you said but, you can create a source closed ROS packages
The ROS build farm is also designed to enable deploying a custom build farm. This can be useful to release closed-source packages, build for platforms and architectures not provided by the official ROS build farm, and/or customize any part of the process to specific needs.
Take a look here for a better overview.
2 - Another approach would be using a CMake install. Although this will require the same architecture and ROS Distro between both your platforms and a location that can be the same for both machines.
Define a CMAKE_INSTALL_PREFIX for some location like: /opt/your_ros_install.
Run sudo make install to allow installing there.
Copy the install directory from machine A to machine B, using scp or tar or some other technique.
To run your installed ROS packages on either machine: source /opt/your_ros_install/setup.bash.

Take a look at this post: Generate .deb from ROS package
Use the following commands:
path-of-your-package$ bloom-generate rosdebian --os-name ubuntu --ros-distro kinetic
$fakeroot debian/rules binary

Related

I can't install ar_track_alvar on ROS Noetic

I download ROS Noetic but when I paste this line on Terminal, it can't found.
$ sudo apt-get install ros-indigo-ar-track-alvar
How can I solve this problem?
As I know, this package is avaliable for Noetic but I can't install it.
That command is trying to install the package for Indigo, not Noetic. Make sure your package names include the ROS distro you’re targeting.
sudo apt install ros-noetic-ar-track-alvar
Edit based on comment: It does appear there is a noetic build for this package, but it doesn't look like it's officially tracked on the ROS wiki. If it isn't supplied via apt you will need to build the package from source. The Noetic source can be found here on GitHub.

How to use Bazel to crate a wheel file for a package that build with cmake

I have a made a python package. The package is currently build using cmake. I want to prebuild this package on my laptop and create a .whl file, such that I can install it on other platform without worrying about building.
I know that bazel could do it. Can someone help me with an example or is there any other tools to prebuild a package that build with Cmake into wheel file?

How to setup ROS environment variable on Ubuntu 20.04?

I tried following this guide to install ROS, but even after adding ROS source.list and its key
sudo apt install ros-melodic-desktop-full
gave error.
E: Unable to locate package ros-melodic-desktop-full
Then I ran this command
sudo apt search ros
to see if any such package exists. I couldn't find ros-melodic-desktop-full but I found another similar package ros-desktop-full.
So I installed it instead. The installation went smooth without giving any errors.
Next step in the guide is to set-up ROS environment variable, but I have no such directory
/opt/ros
So how do I setup the environment variable?
P.S.
I also installed some tools and dependencies with this command
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
and initialized rosdep
sudo rosdep init
rosdep update
The ros-desktop-full package you installed is part of the official Ubuntu release.
ROS Melodic (and in the future, Noetic) is published by the OSRF in a separate repository (packages.ros.org). These packages install to /opt/ros/. However, some ROS packages have also been ported to Debian, which is how they found their way to Ubuntu (which derives from Debian).
The Debian packages are fully functional, but they do not install to /opt/ros. Instead, everything is integrated in the operating system itself. This means that you need to set up your personal workspace slightly differently.
Given that most tutorials assume that you use the OSRF packages, I suggest you either wait for the Noetic release (scheduled for the end of May 2020), then install ros-noetic-desktop-full, or downgrade to Ubuntu 18.04 LTS to use ROS Melodic.
From the documentation here, melodic is only supported on Ubuntu 18.04. The ROS version targeting Focal (20.04) is Noetic, but that one has not been released yet (see Distributions). I'm not sure what ROS version Ubuntu packages (the ros-desktop-full one you installed), but I was not successful in using it.
If you really do want to use Ubuntu 20.04, then I think your best option currently is to compile from source. Last time I checked the precompiled debs for Noetic are not yet available at http://packages.ros.org/ros/ubuntu (you can track release progress at github issue 21513). No idea if compiling Noetic from source is easy or hard, but I was able to compile ROS2 foxy from source without too much trouble though.

Installing OpenCV into PyCharm

Idk if this is a stackoverflow-appropriate post so forgive if the question is misplaced. I'm trying to install OpenCV into my Pycharm IDE through the conda virtual environment. I typed conda install -c conda-forge opencv inside the PyCharm terminal and it has been doing this for 11 hours and God knows how many more to go.
Pycharm did this with PyTorch as well. Am I doing something wrong or is this normal?
While you can install packages directly in PyCharm by going to file->settings select Project Interpreter and click on the '+' icon on the top right (see image)
I would recommend creating a requirements.txt file in the root of your project, and write down all your required packages. When a package is missing, PyCharm will automatically suggest to install the package for you.
e.g. for installing opencv you can add the following to you requirements.txt
opencv-python
Or even specify the version that your project needs
opencv-python==4.1.2
edit: the advantage of using a requirement.txt is that you can more easily port the project to another machine, and re-install the packages if needed.

How to manage cross-platform binary package with conan?

I'm trying to develop a conan package for OpenCV pre-built binaries according to our specs. I need these to be available for Windows and Linux but am at a loss on best practices to structure the conan file.
How should I package both binaries? Should I instead create a package for each OS?
Packing OpenCV is not an easy task, there is an official recipe available and provided by Conan Community here
To install OpenCV:
conan install -r conan-center opencv/4.1.0#conan/stable
There are more versions available, you can list those version by:
conan search -r conan-center opencv
Also, there is a good blog post about OpenCV + Conan here
How should I package both binaries? Should I instead create a package for each OS?
Each recipe should be able to distribute the same project for ANY platform. You can create multiple methods, one per OS. For example, some projects are distributed with CMake and autotools, where CMake only works on Windows. Take a look in OpenCV Conan recipe, you can learn a lot.
If you are interested in packages where you need to download an installer, so mingw Conan recipe is a good example.
Regards!

Resources