my ros experience
TRANSCRIPT
SpeakerSJ Kim (Seongjun Kim)
- Embedded Software Engineer for 6 years
- MCUs, Linux, Web development
- My goals
1. Build autonomous robots
2. Make my robot runs errand for me
3. Easy web interface for SLAM and navigation
2
• SLAM: Simultaneous localization and mapping• Navigation: the act, activity, or process of finding the way to get to a place
when you are traveling in a ship, airplane, car, etc. (Merriam-Webster)
Table & Contents- Before ROS - pyKobuki (GUI app for turtlebot)
- Why ROS?
- Essential Concepts & Commands
- ROS installation
- Project 1 - SULCATA (ROS stack for SLAM)
- Project 2 - Gazebo Factory (steps for original robot)
- Project 3 - Web and ROS
- What's Next?
- Q & A
- Reference
3
Before ROS (pyKobuki)- https://github.com/bus710/pyKobuki
- A GUI application for driving Kobuki
- Python, Tkinter, threading, serial comm.
https://youtu.be/1CXgpq7vz8k4
Before ROS (pyKobuki) (cont.)
- Target features: TCP socket, Kinect, SLAM, Manipulator
- A new feature requires a new thread.
- New features cause high complexity/time sensitivity.
- An error from a thread can stop other threads.
Kobuki
OS
Python runtime
Main process
SerialQ ParserGUI
PC
USB
TCP socket
Kinect
Manipulator
5
SLAM
Why ROS?- Meta OS, Stable middleware, and Modular design
- Several message types (topic, service, and action)
- Various useful packages (Drivers, DSP, and ML)
- Supports several languages (c/c++, java, js, golang, …)
- Free Open Source Software
- Promising roadmap (sync w/ Ubuntu LTS)
6Kobuki
OS
ROS
MLWebGUI
PC
Manipulator Kinect
Driver
DSP Planner
Essential Concepts & commands- Roscore: ROS itself.
- Rosrun: runs a single node in a package.
- Roslaunch: runs multiple nodes across multiple packages.
- Catkin: is an extension of cmake for ROS.
- Message between Publisher/Subscriber nodes.
- Topic: message stream between pub/sub nodes.
- Service: is RPC. a node can call another nodes’ func.
- Action: can initiate a long-running task.
7
ROS installation- CPU: Intel i5 - 3rd gen., RAM: 8GB, HDD: 64GB,
- GPU: HD4000, USB: 3.0
- Ubuntu 14.04, ROS Indigo - Desktop Full
8
$ sudo sh -c ‘echo “deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main” \
> /etc/apt/sources.list.d/ros-latest.list’
$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
$ sudo apt-get update
$ sudo apt-get install ros-indigo-desktop-full
$ sudo rosdep init
$ rosdep update
$ echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
$ sudo apt-get install python-rosinstall
$ cd ~
$ mkdir catkin_ws
$ cd catkin_ws
$ catkin_make
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc ; source ~/.bashrc
http://wiki.ros.org/indigo/Installation/Ubuntu
Project 1 - SULCATA- A type of tortoise species, which live in the ground.
- Kinect v2, Kobuki, Kobuki supporter kit
- USB Type A to B, Camera mounting screw
- Molex PN : 5566-02B2
9NVIDIA-TK1 (ARM based) Intel I-5 (x64 based)
VS.
Project 1 - SULCATA (cont.)
- Summary for the stack
10
kobuki
Ubuntu
kobuki-slamkobuki-keyop
rviz
PC
Kinect v2
kobuki-driver
urg-node
libkinect2
iai-kinect2kobuki-node
depth to laser
ROS 1
235
46
(1) iai-Kinect sends depth image to the dimension converter node.
(2) The converter sends 2D value to urg-node.
(3)&(4) kobuki-slam reads 2D value and tf (time frame) from each nodes.
(5) Rviz visualizes data on GUI.
(6) keyop sends topics for driving kobuki.
Project 1 - SULCATA (cont.)
- Installation & Launch https://github.com/bus710/sulcata
11
- libkinect2 supports several GPUs (NVIDIA, AMD, Intel, ARM).
- Read the official document carefully to install the driver on your machine.
Project 2 - Gazebo Factory- Gazebo is OSRF’s 3D robot simulator.
- Supports ground, flight, underwater env. & robot.
- Various physics engines (ODE, Bullet, Simbody, and DART)
- Compatible with ROS. Good for proof of concept.
12
UbuntuPC
ROS
Model System World WorldPlugin
Systemplugin
Modelplugin
Gazebo
Project 2 - Gazebo Factory (cont.)
- 3 files for model description.(1) model.config
(2) model.sdf
(3) link*.dae (by Blender, Solidworks, or Rhino)
- 6 files for ROS package and Gazebo world setting.(4) CMakeLists.txt
(5) package.xml
(6) launch/PROJECT_NAME.launch
13
/home/USER_NAME/ .gazebo/models/ROBOT_NAME/
catkin_ws/src/PROJECT_NAME/
(1) model.config
(2) model.sdf
(3) link*.dae
(4) CMakeLists.txt
(5) package.xml
(6) launch/PROJECT_NAME.launch
(7) worlds/WORLD_NAME.world
(8) src/GAZEBO_PLUGIN.cc
(8) src/ROS_NODE.py
(7) worlds/WORLD_NAME.world(8) src/GAZEBO_PLUGIN.cc(9) src/ROS_NODE.py
Project 2 - Gazebo Factory (cont.)
- Installation & Launch https://github.com/bus710/gz_factory
14https://youtu.be/lGlfi2OWBnE
Project 3 - Web and ROS- ROS bridge package supports web socket.
- A good fit for real-time web applications.
- Any computer has web browser. (no install for client)
- There is a missing link between ROS bridge and browser.
- Browser requires web page before it accesses web socket.
15
ROS coreROS bridgeWeb
browser
???
Client Robot
This layer must deliver web page for browser
Project 3 - Web and ROS (cont.)
- To deliver web pages, we need a web server.
- Node.js has lightweight web server, Express.
16
Node.js stack ROS stackWeb Browser
Client Robot
User starts - ROS core.- ROS simulator node.- ROS bridge (port 9090).
User starts node stack (port 3000).User accesses Robot via web
browser. Then, Web browser requests index.html.
Node returns index.html.
Web browser requests client.js
Node returns client.js.
User clicks button on web.Then, the loaded Client.js sends JSON packet via WebSocket (port 9090).
ROS bridge- Converts JSON to ROS topic.- Assigns topic to simulator.
1
23
4
n User actions Http exchange Web socket access
Project 3 - Web and ROS (cont.)
- Installation & Launchhttps://github.com/bus710/rosbridge-usage
- Result
What's next- Build a combination with SULCATA + ROS Bridge.
- Research on robotics topics about SLAM & navigation.
- Eventually, make my robot runs errands for me.
18
Q&A
19
Reference
20
[1] http://wiki.ros.org/
[2] http://gazebosim.org/
[3] https://github.com/OpenKinect/libfreenect2
[4] https://github.com/code-iai/iai_kinect2
[5] https://github.com/robotpilot/rosbook_kr
[6] “Programming Robots with ROS”, Morgan Quigley, Brian Gerkey, and William D. Smart
[7] http://wiki.ros.org/urg_node
[8] http://wiki.ros.org/depthimage_to_laserscan
[9] OROCA, the best ROS community in Korea