Code Monkey home page Code Monkey logo

ros_in_docker's Introduction

ROS in Docker

Tired of trying to compile ROS1 on Ubuntu 22.04? Tired of breaking your systems due to conflicts with the ton of dependencies ROS1 has? Here we propose a solution. A completely isolated environment, with ROS1 support by default, extensible, and with all the tools included for developing ROS1 applications without having to install them locally.

ros_in_doccker.mp4

Tested host-machines

  • Ubuntu 22.04

Supported development environments

  • tmux
  • VSCode

How to use with your project (VSCode)

vscode

  1. Click on "Use this template", or fork if you like.
  2. Git clone the repo locally and cd into it.
  3. Create an src/ directory inside the repository: mkdir -p src/
  4. Clone inside the src/ directory the ROS1 code you want to develop/test. I will be using the ros_tutorials as an example, but it can be as complex as you wish, so, git clone [email protected]:ros/ros_tutorials.git src/
  5. Launch code ., and then go to the "Remote Explorer" tab and hit "reopen the current folder in a container", this should launch a full dev environemnt with some extensions to develop your ROS application in the dockerize environment
  6. Launch the Build Task, Ctrl+Shift+p and type "Tasks: Run Build Task"

How to use with your project (tmux)

tmux

  1. Click on "Use this template", or fork if you like.
  2. Git clone the repo locally and cd into it.
  3. Launch make docker to create a local docker container image with all the nice stuff installed. If you need any extra dependency, now is the time to add it to the Dockerfile.
  4. Create an src/ directory inside the repository: mkdir -p src/
  5. Clone inside the src/ directory the ROS1 code you want to develop/test. I will be using the ros_tutorials as an example, but it can be as complex as you wish, so, git clone [email protected]:ros/ros_tutorials.git src/
  6. Launch make, this will build your project and open a tmux session with all the batteries included.

What about injecting rosbags inside the dev container?

Got you covered, just use the environment variable export ROS_BAGS=/path/to/data/in/host and launch make. Your rosbag files will be mounted in the dev container in ~/ros_ws/bags and are read-only accessible to the ROS1 applications.

How to extend the container

Could not be more simple, just add all your user-space command on the Dockerfile. apt install <your-libs> and enjoy the setup.

GUI Supported?

Of course, you can run rviz and friends inside the dev container, it looks a bit ugly but at least it works.

Install host-machine dependencies

For now, you only need, I expect this repo to be used by "intermediate" developers, so I guess you can figure out how to do that.

  • docker
  • docker-compose
  • (VSCode) dev-containers extension

Security concerns

The entire setup is NOT safe at all, so, use it at your own risk. I'm mounting directories from the host machine to the docker container where the user has sudo access without a password. So you can literally delete some stuff with root permissions without even typing a password. So, you are warned!

About the tools for development

I built this project on top of my dotfiles, so it's completely overfitted to my own needs and I don't intend to provide support for extra stuff. If there is something you don't like or don't need, feel free to modify your copy of the Dockerfile. You are in full control of what you want and not.

ros_in_docker's People

Contributors

nachovizzo avatar erjanmx avatar

Watchers

James Cloos avatar

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.