Code Monkey home page Code Monkey logo

ros2-toolchain-crosscompile's Introduction

ROS2 toolchain cross-compiler

This is a very minimal pass at a workflow that can use a custom toolchain to create a ROS2 build.

It cannot handle dependencies that are outside the source tree, so there is only a limited subset of ROS2 that this can build.

As of right now, it is specifically tuned to using a linaro aarch64 cross compiler, but to make it generic should not take much modification.

Main Process

Setup

You need to have Docker and vcs installed on your dev computer already

  1. Download the linaro cross compiler (6.5)
  2. Download the linaro sysroot (6.5)
  3. Get the ROS2 sources
vcs import src < minimal_cpp_ros2_master.repos
# we do not have log4cxx dependency and don't actually need it
touch src/ros2/rcl_logging/rcl_logging_log4cxx/COLCON_IGNORE

Running the build

Start the container from the top dir of this repo

docker run -it -v $(pwd):/ws/ros2build candleends/ros2_cross_compiler

Now run the build within the container

colcon build --mixin aarch64-linux --packages-up-to demo_nodes_cpp

Deploying the build

Exit the build container. The install/ directory is your ROS2 build.

adb push install /userdata/install

Try the build

Open one adb shell to the device

export LD_LIBRARY_PATH=/userdata/install/lib
/userdata/install/lib/demo_nodes_cpp/talker

Then, in a second adb shell

export LD_LIBRARY_PATH=/userdata/install/lib
/userdata/install/lib/demo_nodes_cpp/listener

Now, you should see that the listener is receiving messages from the talker.

Tips / Advice

Rebuilding the Docker image

If you need to change the docker image that we use for building, it's easy to rebuild

cd docker
docker build . -t candleends/ros2_cross_compiler

ros2-toolchain-crosscompile's People

Contributors

emersonknapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ros2-toolchain-crosscompile's Issues

minimal repo subset

How did you pick the minimal subset of repositories in minimal_cpp_ros2_master.repos?

Does this satisfy all the recursive dependencies?

Are there any basic ROS2 behaviours it doesn't support? (e.g., could you build something like a TurtleBot with this subset?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.