20160420 ros 3차 강의 (for 아스라다 팀)
TRANSCRIPT
PowerPoint Presentation
ROS 2016. 04. 20Yoonseok Pyo
Open Source Team1
1
IndexCommand-Line Tools
Visualization Tool: RViz
GUI Tool Box: RQT2
IndexCommand-Line Tools
Visualization Tool: RViz
GUI Tool Box: RQT3
ROS
Command-Line ToolsGUI ROS ROS
RViz 3D , , IMU
RQT Qt (rqt_graph), , (rqt_plot) (rqt_bag)4
http://www.ros.org/core-components/
Command-Line Tools ROS .rospack, roscd, rospd, rosls, rosed, roscp, rosdep, roswf, catkin_create_pkg, wstool, catkin_make, roscore, rosrun, roslaunch, rosnode, rostopic, rosservice, rosparam, rosmsg, rossrv, rosbag, tf_echo ROS Cheatsheet .
!https://github.com/oroca/oroca_ros_tutorials/raw/master/ROScheatsheet_indigo_catkin.pdf Command-Line Tools
IndexCommand-Line Tools
Visualization Tool: RViz
GUI Tool Box: RQT6
RViz (ROS Visualization Tool)ROS 3D (LRF) Kinect, Xtion, RealSense Depth Camera IMU ..
URDFUnified Robot Description Format
Rviz Kinect Point Cloud Data https://youtu.be/OqOkpZBOpxY LRF https://youtu.be/qtoAJ1wzB6s LEGO Mindstorm https://youtu.be/6afrMnEmXFIIMU https://youtu.be/j5v5fKppcQo RealSense Point Cloud Color, Depth https://youtu.be/Jf4kgPEzY4s https://youtu.be/ath8uNv9c_Q , https://youtu.be/9lbuLAD1c_4 , , https://youtu.be/xCRsszVAP1E IK https://youtu.be/5rMv3ZDyFwQ (2015 DARPA Robotics Challenge) https://www.youtube.com/user/DARPAtv
8
RViz !9
RViz RViz
* ros-indigo-desktop-full
RViz
10http://wiki.ros.org/rviz$ sudo apt-get install ros-indigo-rviz$ rosrun rviz rviz$ rviz
RViz ()11
RViz (LRF )12
3D
RViz ( ADD )13
xyz ( ) 2 (TF)
13
14 LRF, IMU, USB Camera,Depth Camera, Robot Model Rviz .
PC Rviz .
15
RViz #1 (LRF)* Rviz Displays
1) Fixed Frame Global Options > Fixed Frame = laser
2) Axes rviz Add , Axes . (Length Radius )
3) LaserScan rviz Add , LaserScan .(Topic , Color Transformer, Color )
16$ sudo apt-get install ros-indigo-rplidar-ros$ sudo chmod a+rw /dev/ttyUSB0$ roslaunch rplidar_ros rplidar.launch$ sudo apt-get install ros-indigo-urg-node$ sudo chmod a+rw /dev/ttyACM0$ rosrun urg_node urg_node(RPLiDAR )(HOKUYO )
RViz #1 (LRF)17
RViz #2 (IMU)18$ sudo apt-get install ros-indigo-myahrs-driver$ rosrun myahrs_driver myahrs_driver _port:=/dev/ttyACM0$ roslaunch myahrs_driver myahrs_driver.launch(withrobot myAHRS+)
RViz #3 (USB Camera)19$ sudo apt-get install ros-indigo-uvc-camera$ sudo apt-get install ros-indigo-image-*$ rosrun uvc_camera uvc_camera_node
$ rosrun uvc_camera uvc_camera_node _device:=/dev/video?* Rviz Displays
1) Fixed Frame Global Options > Fixed Frame = camera
2) rviz Add , Image .(Add > by display > rviz > Image)
3) Image > Image Topic "/image_raw" . 2 , (, )
RViz #3 (USB Camera)20
RViz #4 (Depth Camera)21$ cd ~/Downloads/$ git clone https://github.com/PercATI/RealSense_ROS.git$ cd RealSense_ROS/r200_install/$ sh install.sh$ cd ~/Downloads/RealSense_ROS/realsense_dist/2.3/$ sh install_realsense_ros.sh $ roslaunch realsense realsense_r200_launch.launch* Rviz Displays
1) Fixed Frame Global Options > Fixed Frame "camera_depth_frame" .
2) PointCloud2 rviz Add , PointCloud2 .
3) Topic (RealSense )
RViz #4 (Depth Camera)22$ sudo apt-get install ros-indigo-openni2-camera ros-indigo-openni2-launch$ tar -xvf Sensor-Bin-Linux-x64-v5.1.0.41.tar.bz2$ cd Sensor-Bin-Linux-x64-v5.1.0.41/$ sudo sh install.sh $ roslaunch openni2_launch openni2.launch* Rviz Displays
1) Fixed Frame Global Options > Fixed Frame "camera_depth_frame" .
2) PointCloud2 rviz Add , PointCloud2 .
3) Topic (*Xtion CD )(ASUS Xtion )
RViz #4 (Depth Camera)23
RViz #5 (Robot Model)R2-D2 24$ sudo apt-get install ros-indigo-urdf-tutorial$ roslaunch urdf_tutorial display.launch model:='$(find urdf_tutorial)'urdf/05-visual.urdf
RViz #6 (Navigation)
25Xtion CD Xtion
RViz #7 (Interactive Marker)
26Xtion CD Xtion
IndexCommand-Line Tools
Visualization Tool: RViz
GUI Tool Box: RQT27
RQT: ROS GUI ROS Fuerte rqt rxbag, rxplot, rxgraph rqt_bag, rqt_plot, rqt_graph ROS GUI .rqt Qt .rqt rqt_image_view, rqt_graph, rqt_plot, rqt_bag .
, rqt_action, rqt_gui, rqt_plot, rqt_runtime_monitorrqt_bag, rqt_gui_cpp, rqt_pose_view, rqt_rvizrqt_bag_plugins, rqt_gui_py, rqt_publisher, rqt_service_callerrqt_capabilities, rqt_image_view, rqt_py_common, rqt_shellrqt_console, rqt_launch, rqt_py_console, rqt_srvrqt_controller_manager, rqt_logger_level, rqt_reconfigure, rqt_tf_treerqt_dep, rqt_moveit, rqt_robot_dashboard, rqt_toprqt_ez_publisher, rqt_msg, rqt_robot_monitor, rqt_topicrqt_graph, rqt_nav_view, rqt_robot_steering, rqt_web . ( ;;)
RQT RQT
RQT
$ sudo apt-get install ros-indigo-rqt ros-indigo-rqt-common-plugins$ rqt
RQT #11. (Action)Action Type Browser |Action
2. (Configuration)Dynamic Reconfigure| GUI Launch |roslaunch GUI
3. (Introspection)Node Graph | Package Graph | Process Monitor | CPU, ,
4. (Logging)Bag |ROS Console | (Warning), (Error) Logger Level |ROS Debug, Info, Warn, Error, Fatal
30
RQT #25. (Miscellaneous Tools)Python Console | Shell |(shell) Web |
6. (Robot) (dashboard)
7. (Robot Tools)Controller Manager| Diagnostic Viewer| Moveit! Monitor| Moveit! Robot Steering | GUI , GUI Runtime Monitor |
31
RQT #38. (Services)Service Caller | Service Type Browser |
9. (Topics)Easy Message Publisher | GUI Topic Publisher | Topic Type Browser | Topic Monitor |
10. (Visualization)Image View | Navigation Viewer| Plot|2 GUI , 2 Pose View | TF RViz |3 RViz TF Tree |tf 32
RQT 33
http://www.ros.org/core-components/
RQT 1. GUI ROS 2. GUI Tool !34
35 rqt_image_viewrqt_graphrqt_plotrqt_bag
RQT #1: rqt_image_view36$ rosrun uvc_camera uvc_camera_node
$ rqt( [Plugins] [Visualization] [Image View] .)
$ rqt_image_view
RQT #2: rqt_graph37$ rosrun turtlesim turtlesim_node$ rosrun turtlesim turtle_teleop_key$ rosrun uvc_camera uvc_camera_node
$ rqt( [Plugins] [Introspection] [Node_Graph] .)
$ rqt_graph
RQT #3: rqt_plot38$ rosrun turtlesim turtlesim_node$ rosrun turtlesim turtle_teleop_key
$ rqt( [Plugins] [Visualization] [Plot] .)
$ rqt_plot /turtle1/pose/
RQT #4: rqt_bag39$ rosrun uvc_camera uvc_camera_node$ rosbag record /image_raw
$ rqt( [Plugins] [Logging] [Bag] .)$ rqt_bag
Key Point?Rviz, rqt ~40
40
!
hello world![]2016. 04. 20Yoonseok Pyo
Open Source Team42
42
hello world!ROS hello world!
1) CMakeLists.txt package.xml .
43$ catkin_create_pkg [] [1] [n]$ cd ~/catkin_ws/src$ catkin_create_pkg my_first_ros_pkg std_msgs roscpp$ cd ~/catkin_ws/src/my_first_ros_pkg
hello world!442) (package.xml) , , , $ cd ~/catkin_ws/src/my_first_ros_pkg$ gedit ./package.xml
my_first_ros_pkg 0.0.1 The my_first_ros_pkg package Yoonseok Pyo BSD http://robotis.com https://github.com/oroca/oroca_ros_tutorials.git Yoonseok Pyo catkin std_msgs roscpp std_msgs roscpp
hello world!453) (CMakeLists.txt) , , $ cd ~/catkin_ws/src/my_first_ros_pkg$ gedit ./CMakeLists.txtcmake_minimum_required(VERSION 2.8.3)
project(my_first_ros_pkg)
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs)
catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS roscpp std_msgs DEPENDS system_lib)
include_directories(${catkin_INCLUDE_DIRS})
add_executable(hello_world_node src/hello_world_node.cpp)
add_dependencies(hello_world_node my_first_ros_pkg_generate_messages_cpp)
target_link_libraries(hello_world_node ${catkin_LIBRARIES})
hello world!464) $ cd ~/catkin_ws/src/my_first_ros_pkg/src$ gedit ./hello_world_node.cpp
#include #include #include
int main(int argc, char **argv){ ros::init(argc, argv, "hello_world_node"); ros::NodeHandle nh; ros::Publisher chatter_pub = nh.advertise("say_hello_world", 1000); ros::Rate loop_rate(10); int count = 0;
hello world!47
while (ros::ok()) { std_msgs::String msg; std::stringstream ss; ss