[PYTHON] From ubuntu installation to running kinect with docker and ros (overview)

First of all,,,

I am a first year master's student at a graduate school in Kanto. I have been conducting research with windows + simulation.

I thought it was time to get a job or an intern, so I went to an intern at a robot startup with an acquaintance in the laboratory.

I was writing a program to some extent and thought I could work, but the reality was not so sweet.

There were words that I had heard but didn't understand, and I couldn't understand the meaning of the instructions. I felt what I had studied so far.

However, the people who understood them and moved the actual machine looked cool, and the sensors and robots actually moving seemed to be fun in the near future, so I decided to study.

Target

** Install ubuntu on your PC and use ros and docker to run kinect **.

In this article, I will explain the general flow.

Once you know the general flow, you can look it up and fight errors, but if you don't know the flow in the first place, you won't know what to do, and I was. Lol So, I'll leave the details to other articles and share the general flow I did.

(* Because it is "memo for myself" + "practice of output", please take a good look!)

environment

What i did

The comparison between the state before doing and the state after doing is like this.

図2.png

(This image was created with reference to the article by @ kotaro-dr.)

The final output will look like this. Screenshot from 2019-11-08 01-01-05.png

It's a little difficult to understand, but you can see that kinect can get rgb information and distance information. What looks like two images shows the depth.

ubuntu installation and preferences

windows backup

First, make a backup according to this. I omitted what I could do later and just backed up the system image.

Install ubuntu on D drive

Install ubuntu directly from usb according to this.

advanced ubuntu settings

Select the driver to handle or the os to start by default. (This area was taught by a junior in a detailed laboratory ...)

docker and ros and other installations

Install docker according to docker docs.

Install ros according to ROS.org.

If you want to install Chrom, Terminator, VScode, etc., install it.

Creating a GUI and docker file for kinect2

docker motivation

"Docker creates a virtual environment and works there, so it's okay not to destroy the environment of the main PC." It seems, but I couldn't really imagine it.

Perhaps this feeling is appreciated by those who have installed various libraries and have experienced conflicts between each library and the data being blown away.

I think this article is easy to understand. Based on the reference article, it looks like this in my own perception.

図1.png

(This image was created with reference to the article by @ kotaro-dr.)

In other words, if you just launch docker, I think it's okay to feel like you have a blank PC separate from the one you are using. At the time of its startup, describe various libraries you want to install and build your favorite environment.

Also, at a later date, I was using a notebook PC, The processing speed couldn't keep up and the kinect didn't look good. At that time, let's do it on the desktop! I think the merit is that it is very easy to build an environment when you think about it.

Dependencies

The structure of the file looks like this. I will create it like this.

/home/docker/
|--kinectv2
|  |--Dockerfile
|  |--build.sh
|  |--run.sh
|  |--etc...  

|--ros_rviz
|  |--Dockerfile
|  |--build.sh
|  |--run.sh
|  |--etc...  

Let's make docker for rviz

People from windows don't feel like it, but the image built with docker doesn't have a screen ... That's why you need to create a GUI.

So I want to see the output of kinect with rviz, so I made a docker file for it! (I'll add a github link! Please wait a moment)

Let's make docker for kinect v2

We need docker to run kinect, so create this! (I'll add a github link! Please wait a moment)

Run each Docker and rosrun

At this point, all you have to do is execute it.

First, start (run) the terminal for kinect v2. Execute with the following command

roslaunch kinect2_bridge kinect2_bridge.launch

Next, start (run) the terminal for rviz. Execute with the following command

rosrun rviz rviz

At the end

I am writing an article for the first time, but I realized that it is really difficult to write an easy-to-understand article. I realized the greatness of the articles that I have referred to so far. This article was mostly my own memo, but I hope it helps someone.

Also, on TV, Cyndi Lauper said that it was important to continue the output in order to become first-class. I will continue to output it.

Recommended Posts

From ubuntu installation to running kinect with docker and ros (overview)
Getting Started with Poetry From installation to execution and version control
From ROS for Windows installation to operation check
From easy git installation to docker startup python
From Kafka to KSQL --Easy environment construction with docker
How to share folders with Docker and Windows with tensorflow
From buying a computer to running a program with python
Dealing with pip and related installation errors on Ubuntu 18.04
Put Ubuntu in Raspi, put Docker on it, and control GPIO with python from the container
From environment construction to deployment for flask + Heroku with Docker
Repeat with While. Scripts to Tweet and search from the terminal
It's time to install DB with Docker! DB installation for beginners on Docker
HDA distribution from Houdini to export FBX with hierarchy and transforms
[Python] Try to recognize characters from images with OpenCV and pyocr
From Elasticsearch installation to data entry
Robot running with Arduino and python
Easy Slackbot with Docker and Errbot
Create folders from '01' to '12' with python
Tips for running Go with docker
OpenMPI installation from download to pass-through
From Ubuntu 20.04 introduction to environment construction
Realize environment construction for "Deep Learning from scratch" with docker and Vagrant
I tried to learn the angle from sin and cos with chainer