ROS

ROS系列文整理

由於 Robot Operating System(ROS) 的中文資源還幾乎不存在(2012年),決定先撒下一點麵包屑,之後有寫出新的也會依序整理到這上面。

我覺得機器人在能源不出現問題之前,是必然崛起的一個領域。機器人的存在可以幫助人類變得更好,被解放的生產力能夠聚焦到更為重要的議題上 – 永續發展,公平正義,世界均富等等,而要在機器人產業做出能推動世界進步的成果,我認為 ROS 是一個很重要的工具。

現在(2015年)已經多了不少中文資源,大家可以參考 ROS網站中文版。另外,最近同實驗室的同學黃昭霖也開始寫一些 他自己的筆記、有一位朋友林信男最近也開始寫 ROS on Jetson的學習筆記、他甚至還幫忙整理了各種 ROS 中文資源列表 XD 如果你需要問問題,去 ROS Answers絕對是不二選擇(因為有很多ROS package的開發者會到上面回答跟自己package相關的問題),或者可以去ROS.Taipei這個中文社群 或 另一個中文社群 逛逛。

對學習 ROS 有興趣的朋友來說,能有多一些資源參考總是好的。希望之後有心做 ROS 的人學習愉快 : D

如果你/妳覺得這些文章很有幫助,很歡迎你/妳給我一點小小的鼓勵!任何一點點對我來說都是很棒的鼓勵,希望可以分享更多自己的所學給大家。請大家千萬不要有一點點勉強喔!我最不喜歡強迫別人了。 附上我的 Paypal.me 連結:https://www.paypal.me/pojenlai


ROS tutorials 系列 (Beginner Level)

我的 tutorial 不詳細 go through 整個 tutorial 原文,而是就我認為重要之處詳加說明,而且有些東西原文寫得很清楚就不必重複寫了。換句話說,我仍預期你看下面這系列文章時要搭配原文看,才會比較完整。

0. 什麼是 ROS ? 要怎麼使用 ROS ? (玩ROS前必看!我盡量寫得淺顯,不是工程師應該也看得懂XD)

1. 淺談 ROS file system

2. 新增 ROS package

3. 建立 ROS packages

4. 了解 ROS Node

5. 了解 ROS Topics

6. 了解 ROS Service 跟 Parameters

7. 使用 rqt_console 跟 roslaunch

8. 使用 rosed 來編輯檔案

9. 建立自己的 msg 檔或 srv 檔

10.撰寫一個 publisher 跟 subscriber (上手 ROS Topic )

11.撰寫一個 service 跟 client (上手 ROS Service )

12.使用 rosbag 記錄和播放資料

13.使用 roswtf 來幫忙 debug

14.探索 ROS wiki

15.下一步是什麼?

———————————————–

Object Recognition Kitchen 系列

使用 Object Recogniton Kitchen 的 Linemod 演算法辨識物體

Object Recognition Kitchen 透明物體辨識(演算法概念)

ecto 簡介 (1) – cell 與 plasm

ecto 簡介 (2) – tendrils 與 scheduler

———————————————–

LSD SLAM 系列

深入學習 LSD-SLAM – 1

深入學習 LSD-SLAM – 2

深入學習 LSD-SLAM – 3

深入學習 LSD-SLAM – 4

深入學習 LSD-SLAM 番外篇 – RDS X RTAB-Map

深入學習 LSD-SLAM – 5

———————————————–

ROS觀念文

用 DDS 開發 ROS 2.0

簡介CRAM(Cognitive Robot Abstract Machine)

簡介 Knowrob (機器人知識處理的工具)

比較 Topic, Service 跟 Actionlib

ROS Navigation stack 簡介

ROS SMACH 簡介

———————————————–

ROS實作細節文

如何使用 Google Cartographer SLAM 演算法來建地圖

Caffe & GoogLeNet,如何幫助機器人更好地辨識物體

使用 Gazebo 模擬器控制機器人建立 2D 地圖

如何用 ROS Topic 控制機器人移動

使用 ROS 與 Gazebo 模擬一個自動避障機器人

改 launch file 中的參數值

launch file 中的條件用法

安裝 household object database

收到彩色影像,發布灰階影像 topic 的方法

接收來自 ROS Topic 的影像並偵測畫面中的動作

———————————————–

ROS雜感

PR2 開箱文

ROS Kong 2014 照片集

ROS in DARPA Robotics Challenge!

———————————————–

補些關鍵字

ROS(Robot operating system), 機器人作業系統, 教學文章, 範例, 說明

最後更新:2017/09/09

Advertisements
AI/ML

Basic categorization of RL

We can gain cool insights by knowing types of RL algorithm:

typeOfRL.png

Policy gradient: Learn by directly adjusting policy to maximize the reward. E.g. Shoot the basketball. If you did not make it (low reward), then you’ll adjust how you shoot the ball.

Value-based: Learn by core values. E.g. we know it is good to be optimistic. So we can still trust ourselves in difficult situations because we have this value function to help us know what to do.

Actor-Critic: Learn by having teachers to teach us how to do well. E.g. when we grow up, our parents teach us to do some things (e.g. to treat others well) and not to do some things (e.g. to bully others). We are actors. Parents are our critics. When being criticized, we might adjust our policy/value function/model.

Model-based: Learn the model of our world. E.g. We know if we release our cup in the air, it will fall to the ground due to gravity on Earth.

It is not difficult to know we actually use all these methods to learn.

擷取.JPG

The pictures above come from Deep RL course in UCB.

AI/ML

Dive into TensorFlow (3) – Init the variable

The tf.Variable class creates a tensor with an initial value that can be modified, much like a normal Python variable. This tensor stores its state in the session, so you must initialize the state of the tensor manually.

We use the tf.global_variables_initializer() function to initialize the state of all the Variable tensors.

init = tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init)

The tf.global_variables_initializer() call returns an operation that will initialize all TensorFlow variables from the graph. You call the operation using a session to initialize all the variables as shown above.

AI/ML

Dive into TensorFlow (2) – Feeding dataset to session

x = tf.placeholder(tf.string)

with tf.Session() as sess:
    output = sess.run(x, feed_dict={x: 'Hello World'})

The feed_dict parameter in tf.session.run() help us set the placeholder tensor. The above example shows the tensor x being set to the string "Hello, world".

It’s also possible to set more than one tensor using feed_dict as shown below.

x = tf.placeholder(tf.string)
y = tf.placeholder(tf.int32)
z = tf.placeholder(tf.float32)

with tf.Session() as sess:
    output = sess.run(x, feed_dict={x: 'Test String', y: 123, z: 45.67
AI/ML

How to install and setup MuJoCo 1.31?

OK, first you want to make sure you have this kind of setting by following older installation guide in MuJoCo repo:

mujoco-1.png

Next, you can run the test by going to the bin and run./test ../model/humanoid.xml xs 10  :

ros@ros-K401UB:~/.mujoco/mjpro131/bin$ ./test ../model/humanoid.xml xs 10

Comparison of original and saved model
Max difference : 2.61e-06
Field name : body_mass

Simulation ..........
Simulation time : 0.64 s
Realtime factor : 15.59 x
Time per step : 0.128 ms
Contacts per step : 9
Constraints per step : 39
Degrees of freedom : 27

In my case, I have to copy my mjkey.txt to the ~/.mujoco/mjpro131/bin in order to run successfully:

mujoco-2.png

 

AI/ML

Dive into TensorFlow (1) – Tensor and Session

Tensor

In TensorFlow, data isn’t stored as integers, floats, or strings. These values are encapsulated in an object called a tensor. Tensors come in a variety of sizes as shown below:

# A is a 0-dimensional int32 tensor
A = tf.constant(1234) 
# B is a 1-dimensional int32 tensor
B = tf.constant([123,456,789]) 
# C is a 2-dimensional int32 tensor
C = tf.constant([ [123,456,789], [222,333,444] ])

tf.constant() is one of many TensorFlow operations. The tensor returned by tf.constant() is called a constant tensor, because the value of the tensor never changes.

Session

TensorFlow’s API is built around the idea of a computational graph, a way of visualizing a mathematical process. A “TensorFlow Session” is an environment for running a graph. The session is in charge of allocating the operations to GPU(s) and/or CPU(s), including remote machines.

Hello World

import tensorflow as tf

# Create TensorFlow object called hello_constant
hello_constant = tf.constant('Hello World!')

with tf.Session() as sess:
    # Run the tf.constant operation in the session
    output = sess.run(hello_constant)
    print(output)

The code first creates the tensor, hello_constant, from the previous lines. The next step is to evaluate the tensor in a session.

The code creates a session instance, sess, using tf.Session. The sess.run() function then evaluates the tensor and returns the results.