Thứ Hai, 18 tháng 12, 2017

ROS - Robot Operation System



Một vài website tham khảo cách setup ROS và basic program in ROS:

https://www.youtube.com/channel/UCQLEPbkEmwz4mABAV-kzQTQ
http://www.srikanthmalla.com
- ROSCON 2012
- ROS in C++ Ebook
   A Gentle Introduction to ROS Jason M. O'Kane
- Open Source Robotic Foundation: Gazebo
- Book Title: Programming Robots with ROS: A Practical Introduction to the Robot Operating System

Book Cover
- Advice from Quora:

To start learning about ROS, just install it and gets your hands dirty. Generally, it is advised to follow the tutorials provided on ROS wiki page, but i will share my experience, whenever i started the ROS tutorials at some point of time many things i couldn’t understand as why i am doing it after completing 6 7 tutorials which leads to frustration and giving up. I will tell you how i started learning ROS. I will highly recommend this book as i found it very helpful Books/Programming_Robots_with_ROS - ROS Wiki and fun to read.

Firstly Install ROS completely, with Gazebo Simulator, RViz etc. Read about terms like Node, Topic, Message, Subscriber, Publisher etc from the book. 

Start the Turtlesim tutorialsthis will help you get a clear understanding of Node, Topic, Subscribing messages, Publishing messages, Messages like Geometry Commands, sensor values etc.
Read the book about writing scripts and controlling the Turtlesim using Python scripts (or C++ whichever you like my personal choice is python) which will help you to understanding writing message subscribing and publishing.

Now, you should start learning about the Catkin Package and how to create, compile and manage catkin packages. Various Source codes are available in catkin packages so you should learn how to compile and use catkin packages.

Now choose a robot of your choice (i started Turtlebot) and simulate it in Gazebo. Start learning about other libraries and how to integrate it in your robot to implement the required functionality.

Hope this will help you to get started.


I discovered ROS 2,5 months ago. At first it was really hard, but now I start to understand concepts better and I feel ROS made me much more productive for programming a robot.

Let me give you some background so you know from where I started. With 2 internships (10 months), I had knowledge about programming in a few languages (scripting, OO, web, …) and I also knew some stuff about system administration and network (due to my last internship as a DevOps).

So I would say, it is a good background to start learning ROS, even if I didnt really study in depth any of the subjects I have worked on.

Let’s get started !

The early beginning :
  • Early September. I am just co-founding a robotics company as a CTO. Well, in other words I am the computer guy. Our goal : to build an accessible robot for makers, startups, and small companies. As I discovered ROS as I was looking for some help about how to deal with inverse kinematics, cartesian paths, and many more things. Maths for robotics is not easy. Trust me, it is a real pain.
  • My goal with ROS : build a complete stack for a custom 6-axis robotic arm, from the user interface (web page or mobile) to the robot motors.
  • First I liked what I saw on some cool videos, and the fact that most of the code is on BSD license is great for business. So I started to read about the concepts. I find the ROS wiki is great, although when you just start I think you may need some guidelines. You can start with the basics tutorials to understand more about TopicsServices and Actions (well, maybe stick with Topics and Services, then when you understand more, give a try to Actions).
  • After that I didn’t really know where to start. How can I have a representation of my robot in ROS ? How can I use motion planning ? How do I control motors ? Can I build a complete stack ? Can I use ROS on a Raspberry Pi 3 and Arduino ? That’s a lot of questions, and the list goes on…
  • So I searched online for books about ROS. I will not list them as I found an answer that some people already asked on quora. Some of the described resources are great.

Learning the basics
  • I ended up reading books for days, doing the tutorials with the author’s github repository. I also watched almost all the 2012 ROSCON videos on Youtube
  • Really, watch this, it’s great. You will learn about the principles, the applications you can do, and you will discover the basics of some important packages.
  • I first learnt how to deal with Topics, Services and Actions (for this kind of information the ROS is also very good). It is important to understand the communication concepts in ROS at the beginning, so you can start to think about your project architecture. After you understand how  nodes communicate with each other, you are able to go further.
  • Starting to build the stack to control my custom robot
  • The next thing I focused on was URDF (see video here). URDF will allow you to get a representation of your robot. Without that you can’t do anything. So I advice you to learn how to create an URDF file (see alsoxacro for better and easier configuration to change later).
  • After my robot fully “URDFied”, I was able to see it on RVIZ (What a nice reward !). Rviz is a simulation tool that will help you see your robot model, transformations (tf is the hard part :)), and will allow to move your robot from joints commands, or with a motion planner.
  • Once I got my robot description in URDF, all I wanted to do is to say to the robot : “Hey you, move to x=0.1, y=0.1, z=0.2, and don’t make me do the ****** maths !” (No really, maths are fun, I even give some maths class after working)
  • Here comes MoveIt!MoveIt! is a great, great tool for motion and path planning. It will do the maths for you, all you need is some pre-configuration and your URDF ready. After that you can do a lot of impressive stuff with your robot. If you are using python this might help.
  • After you finished with Moveit! you need to get the calculated trajectory and actually run it with your own controllers, on your own robot. This part was quite hard for me to understand, what messages go where, in what order, where I am supposed to get the output, etc. (hint : the message you will be looking for is this one
  • Then you can find more infos on ROS wiki, ROS answers and Google)
  • The last step before I could really control the real robot, and not only the simulation, was to interface ROS with an Arduino Board. Then the arduino will control the stepper and servo motors. Well, there is a package for that !
  • Then I spent a long time trying to code on the Arduino to make things work smoothly. I was at this point after about 4 weeks of work. (including week-ends) 
  • Well, 1st month was quite hard, mostly all I did during that month is learning the basics of ROS, create a model for my robot, playing with Moveit! and trying to control my robot with an Arduino board.
Then it depends on what you need to do

After learning the basics and how to control your robot, it depends on your project. For me it was to build a complete stack to make the robot accessible for the end-user. So I had a look at :
  • IMU ROS messages to interface my data with ROS system
  • ROS on Raspberry Pi
  • Rosbridge Suite 
  • will allow you to setup a websocket between a ROS system and a non-ROS system. That’s great to complete the stack (user -> motors)
  • And many many more…
Some useful resources :
  • Gazebo for simulation in a real world
  • Sensors
  • 2D navigation 
    if you have a mobile robot
    … Then read more stuffs on the wiki and on the github repositories (PR, issues)
Conclusion :
  • 2.5 months after I started I can say learning ROS is worth it !
  • ROS is a great open-source middleware to use for your robot. Depending on your previous knowledge, the learning curve can be slow at the beginning. But in a few weeks/months you will be able to understand more and more stuff, and your productivity will be much higher. Plus, your robot will do amazing things, that you can’t just program on your own.
  • You can choose between C++ and Python for programming with ROS. If you want fast prototyping and are not so familiar with C++ I would recommand starting using Python (don’t worry, all your application doesn’t need to be in Python as nodes are language-agnostic).
  • The important thing is, don’t give up. At the beginning you will feel stuck and disoriented, but after you go through that, and start to understand the concepts, you will see the benefits of using ROS !
  • I hope this answer will help, you can get more infos about the robot I am currently programming hereand read some articles about cobots and accessibles robots here.

Không có nhận xét nào:

Đăng nhận xét