mobros - Movai Object Builder for ROS
Python framework to enable building and packaging of MOV.AI ROS components.
main branch:
How to install mobros
Simply execute the following:
python3 -m pip install -i https://artifacts.cloud.mov.ai/repository/pypi-edge/simple --extra-index-url https://pypi.org/simple mobros
Warning: If you see a warning that the installation folder is not on path simply add it to the PATH env var.
How to use mobros
To use, simply install the mobros python package, and use as following:
mobros <command> <args>
command can take following values:
- build: to build your ROS workspace.
- pack: to generate debian packages based on the configuration found in all package.xml.
mobros command: build
Example of usage:
mobros build
mobros build will install the requirements defined in your ROS component's package.xml and execute a catkin build in the working directory where you are executing mobros.
mobros command: pack
Example of usage:
mobros pack --workspace=/opt/mov.ai/user/cache/ros/src
mobros pack will drilldown on your workspace looking for package.xmls. For each package.xml it will generate a ros package (.deb).
If the ROS component has a metadata
folder close by, it will be included in the debian package.
Then, on installation, the metadata
will be automatically imported in MOV.AI database
mobros command: publish
Example of usage:
mobros publish
mobros publish is used by the CI systems to patch the rosdep source file with the new generated packages. It uses the yaml file generated by the mobros pack, and sends it to the rosdep patcher service.
Note: This command is protected by aws credentials, meaning its usage is limited to CI systems. For edge cases contact the Devops team for the following credentials. Required environment variables:
- AWS_DEFAULT_REGION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
Detailed System
Build
Mobros build simply userspace setup and calls to rosdep and catkin tools.
First it calls rosdep for him to walkthrough the userspace and install all mentioned projects in the package.xml's. After all dependencies are installed it moves to the catkin build as you guys are used to.
Rosdep
Rosdep is a tool to install ros dependencies. It achieves his goal through the following:
You can manually check the result of the translation by executing:
rosdep resolve <name_of_dependency>
Ros Metapackages
Another important thing to keep in mind is that, in a project that has a vertical structure, keep in mind that you need to define ros metapackages through the layers for the rosdep to be able to "crawl through" and find all package dependencies it needs to install. Metapackages, are empty ros packages that points to all other packages next to it. For instance:
The package.xml must contain the metapackage attribute:
<export>
<metapackage/>
</export>
Good example of a ros project, that contains a vertical arquitecture: https://github.com/uwrobotics/uwrt_mars_rover/tree/49afe9d20655aa8f3ccd6bf2e69fef878a9eef8f
Packaging
During the packaging the following is being achieved:
- Raising build identifier :
- read package.xml version
- add a forth digit for the build ID
- bump this build ID
- Generation of the debian metadata :
- automaticaly generates the debian folder based on the CMakelist.txt and package.xml
- injects the MOV.AI metadata folder into the package
- injects the install/uninstall methods of MOV.AI metadata into the platform
- Package the deb :
- compile the sources in release mode (TODO: add debug option)
- regroup the binaries and all identified artifacts in the package
- TODO: signing, git changelogs, release notes
movai metadata injection
The injection takes in consideration, the relation of the metadata content and the current project being packaged, like detailed in the following diagram:
If you followed the right structure, during mobros packaging you will see the following log:
Get Started - Run locally
In your project copy and execute the following in your terminal:
wget -qO - https://movai-scripts.s3.amazonaws.com/ros-build.bash | bash
Did you know ?
You know that you can install debs simply by mentioning them in the firmware section of the spawner?
With your new packages referenced there, you only need to :
movai-cli firmware my-robot