Skip to content
This repository has been archived by the owner on Jul 20, 2019. It is now read-only.

erlerobot/meta-ros2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meta-ros2

ROS 2 Layer for OpenEmbedded Linux

THIS PROJECT IS UNDER DEVELOPMENT

This project may contain bugs and have not being tested at all. Use under your own risk, but feel free to test, make pull request and improve this project.

Actually a main bug is causing that the Python3 writen programs not to work. If youy get the next error: ImportError: No module named 'rclpy._rclpy' refer to https://discourse.ros.org/t/import-error-no-module-named-rclpy--rclpy-cross-compiling/2463

Dependencies

meta
meta-poky
meta-yocto-bsp    = "morty:78890ea22750804e3e9113e76f7ca3d7234c8342"
meta-xilinx *     = "morty:a24cf71a30de3b5cf665cd91979ea013bf1bb1f4"
meta-oe
meta-networking
meta-filesystems
meta-python
meta-systemd      = "morty:fe5c83312de11e80b85680ef237f8acb04b4b26e"
meta-zynqberry    = "morty:5e062627d75b41647d5ee728ee38057a8290d1e1"
meta-zynqberry-pxfmini = "master:202fcd1c1fe6f7cefa00b719cc9e0fd0b62c466e"
* https://github.com/erlerobot/meta-xilinx

Develop machine

Compile natively (without docker)

Dependencies

cd ~
git clone https://github.com/ament/ament_package
cd ~/ament_package
sudo python3 setup.py install
cd ~
git clone https://github.com/ament/ament_tools
cd ~/ament_tools
sudo python3 setup.py install
cd ~
git clone https://github.com/ament/ament_python
cd ~/ament_python
git checkout release-beta2
sudo python3 setup.py install

Create a docker container

First a docker container is needed. Use https://github.com/erlerobot/Dockerfiles/tree/master/OpenEmbedded/docker_ros2 or check getting Docker container

git clone https://github.com/erlerobot/Dockerfiles/
cd Dockerfiles/OpenEmbedded/docker_ros2/
docker build .
docker run -it -v ${PWD}/shared:/home/build/shared ea2400e95d98 #change the id with the generated by docker build

After that you will be inside the docker container

build@a1eaaf9dd67f:~$ git clone https://github.com/erlerobot/meta-ros2
build@a1eaaf9dd67f:~$ cd poky/
build@a1eaaf9dd67f:~$ source oe-init-build-env

Get Docker

You can use the base Docker image from docker.erlerobotics.com

docker pull docker.erlerobotics.com/meta-ros2:latest
docker run -it -v ${PWD}/shared:/home/build/shared docker.erlerobotics.com/meta-ros2:latest
# inside docker
build@a1eaaf9dd67f:~$ cd poky/
build@a1eaaf9dd67f:~$ source oe-init-build-env

Builds

The build can be perform using the next command inside the ~/poky/build folder:

bitbake core-image-ros2

Add recipes

recipetool command can be used to generate layer files, these layers needs to be generated inside the ~/poky/build folder. After should be moved to the meta package. For example:

recipetool -d create -o Fast-RTPS_1.4.0.bb https://github.com/eProsima/Fast-RTPS/archive/v1.4.0.tar.gz

Recomendations

  • Use the server, is faster.
  • Before exiting your container make a commit. If not, you will need to recompile all your job.
docker commit hopeful_kare zynqberry-ros2-base1

Debug

Probably you will need to install the next repo inside docker, launching the setup.py file https://github.com/ament/ament_python