-
Notifications
You must be signed in to change notification settings - Fork 14
Visualization and logging
센서 정보를 시각화하고 로그 기록으로 남기는 것은 컨트롤러를 개발하고 디버깅하는데 중요하다. 이번 장에서는 rviz에서 시뮬레이션 한 Atlas 로봇을 어떻게 시각화 하는지, 센서 정보를 어떻게 로그 기록으로 남기는지, rviz를 통해 로그 기록 된 센서를 재생하는 방법에 대해 설명 할 것이다.
더 많은 정보를 원하면 rviz와 rosbag의 문서를 참고 하면 된다.
ROS visualization tool이 없다면 다음 명령어를 통해 설치해라.
For ROS Indigo:
sudo apt-get install ros-indigo-viz
다음 명령어를 통해 가제보에서 Atlas 로봇을 불러 온다.
roslaunch drcsim_gazebo atlas.launch
rviz는 강력한 로봇 시각화 툴이다. 이것은 센서 데이터, 로봇 모델, 환경 지도를 GUI로 제공하고 이것은 로봇 컨트롤러를 개발하고 디버깅하는데 유용하다.
로봇이 동작하고 있을 때 다음의 명령어를 통해 rviz를 시작하여라.
rosrun rviz rviz
'Add'를 클릭하고 스크롤을 내려 'rviz > RobotModel'을 선택후 'OK'를 클릭하면 아래와 같은 그림처럼 된다.
'Displays' 그룹에서 'Global Options' 아래에 'Fixed Frame' 옆 라벨을 클릭 하여 '/pelvis'를 클릭하거나 선택하면 원거리에서 로봇을 볼 수 있다.
휠 마우스를 통해 뷰를 조정 할 수 있다.:
-
왼쪽을 누른 상태에서 드래그 하면 뷰를 회전 할 수 있다.
-
휠을 누른 상태에서 드래그 하면 뷰 화면을 움직일 수 있다.
-
휠을 위아래로 움직이면 줌, 인이 된다.
-
오른쪽을 누른 상태에서 드래그 하면 줌, 인이 된다.
키'Add'를 클릭하여 새 항목을 추가하고 'rviz > Camera'를 추가한다. 디스플레이 창의 Camera 항목에서 빈 공간을 클릭하면 빈 필드가 나타납니다. /multisense_sl/camera/left/image_raw
를 선택하거나 기입 합니다. 이제 작은 프레임 안에 카메라 비디오 피드가 나타납니다. rviz는 카메라 이미지에 로봇 모델의 중첩을 표시합니다. 이것은 카메라 이미지에 원을 나타내게 합니다. 중첩들은 Camera > Overlay Alpha를 1.0으로 셋팅 하므로써 끌 수 있습니다. Atlas 로봇 앞에 아무것도 없으면 회색으로 카메라 이미지가 나타 날 수 있습니다. 그래서 카메라 피드에서 보일 수 있도록 로봇 앞에 박스를 놓으면 됩니다.
For drcsim >= 4.1.0: atlas versions >= v3 (e.g. atlas_v3.launch)을 사용하면, the camera topic namespace는/multisense_sl/
에서 /multisense/
로 바뀌어야 됩니다.
이제 카메라와 유사한 방식으로 레이저 스캔을 추가 하겠습니다. 'Topic'을 /multisense_sl/laser/scan
로 바꿉니다. 다시 rviz에서 레이저 스캔의 시각화를 보기 위해서 로봇 앞에 박스를 떨어뜨리세요. 박스가 떨어질 때 박스 위로 빨간 색 포인트들이 보일 것입니다.
For drcsim >= 4.1.0: atlas versions >= v3 (e.g. atlas_v3.launch)을 사용하면, laser topic을 /multisense_sl/laser/scan
에서 /multisense/lidar_scan
로 바꾸어야 됩니다.
TF는 조인트 변환을 시각화 하고, Map은 2D collision map을 시각화 하고, PointCloud(2)는 Microsoft Kinect와 같은 센서의 깊이 정보를 시각화 합니다.
Bonus: actuate the laser. 로봇 머리에 있는 레이저가 회전할 수 있도록 장착 되어 있다. 아래의 명령어로 회전 시킬 수 있다.:
rostopic pub /multisense_sl/set_spindle_speed std_msgs/Float64 '{ data: 6.0 } '
데이터 값은 지령 각속도 값이며 단위는 초당 라디안이다. rviz에에서 주변을 회전하는 레이저 값을 볼 수 있다. 환경의 poor-man의 3D 모델을 빌드하기 위해 "LaserScan" display의 "Decay Time" field를 클릭하여서 0이 아닌 값으로 시간을 증가 시켜라 시간의 단위는 초이다. rviz에서 레이저 스캔들이 누적되는 것을 볼 수 있다.
현재 설정을 초기 값으로 저장하기 위해서는 "File > Save Config"을 클릭하여라. 다음번에 rviz를 실행시키면 이 설정이 로드 될 것이다.
"File > Save Config as ... ", "File > Open Config"을 이용하여 초기 설정 값이 아니어도 저장하거나 로드 할 수 있다.
다음과 같이 명령어를 사용하여 다른 설정으로 rviz를 실행하는 것 또한 가능하다.
rosrun rviz rviz -d /your/config/file.vcg
rosbag 로봇이 동작 중에 토픽을 효율적으로 저장 할 수 있는 툴이다.
다음 명령어를 통해 현재 실행 중인 토픽의 리스트를 확인 할 수 있다.
rostopic list
우리는 로봇으로 부터 조인트 상태, 카메라, 레이저, tf (transform data)를 기록 할 것 이다. 이는 ROS.bag 파일로 기록된다.
rosbag record -O /tmp/ROS.bag /tf /atlas/joint_states /multisense_sl/camera/left/image_raw /multisense_sl/camera/left/camera_info /multisense_sl/laser/scan
For drcsim >= 4.1.0: atlas versions >= v3 (e.g. atlas_v3.launch)은 다음의 rosbag 명령어를 사용한다.
rosbag record -O /tmp/ROS.bag /tf /atlas/joint_states /multisense/camera/left/image_raw /multisense/camera/left/camera_info /multisense/lidar_scan
실행 중에 터미널 창에서 Control + C를 누름으로써 rosbag 기록을 멈출 수 있다.
rosbag 파일을 실행하기 위해 다음 내용의 "playback.launch"라는 이름의 launch 파일을 생성할 것이다.
<launch>
<!-- Creates a command line argument called file -->
<arg name="file"/>
<!-- Run the rosbag play as a node with the file argument -->
<node name="rosbag" pkg="rosbag" type="play" args="--loop $(arg file)" output="screen"/>
</launch>
다음의 명령어를 통해 파일을 launch 시킬 수 있고 ROS.bag
file의 절대 경로가 필요하다.
roslaunch playback.launch file:=/tmp/ROS.bag
다른 터미널 창에서 rviz를 실행하고 rosbag에 의해 실행되는 토픽의 리스트를 얻을 수 있다.
rosrun rviz rviz &
rostopic list
-
Robot Simulators
-
Build a Robot
- Model structure and requirements
- How to contribute a model
- Make a model
- Make a Mobile Robot
- The relationship among Link, Joint and Axis
- Import Meshes
- Attach Meshes
- Add a Sensor to a Robot
- Make a Simple Gripper
- Attach Gripper to Robot
- Nested model
- Model Editor
- Animated Box
- Make an animated model(actor)
- Inertial parameters of triangle meshes
- Visibility layers
-
Model Editor
-
Build a World
-
Tools and utilities
-
Write a plugin
-
Plugins
-
Sensors
-
User input
-
Transport Library
-
Rendering Library
-
Connect to ROS
-
Ros Control - Advanced
-
DRCSIM for ROS Kinetic (Ubuntu16.04)
-
DRCSIM
- DRC Simulator installation
- Launchfile options
- Spawn Atlas into a custom world
- Animate joints
- Atlas Keyboard Teleoperation over ROS
- Teleoperate atlas with a music mixer
- Visualization and logging
- Atlas MultiSense SL head
- How to use the Atlas Sim Interface
- Atlas fake walking
- Grasp with Sandia hands
- DRC vehicle tele-operation
- DRC vehicle tele operation with Atlas
- Sending joint commands with ROS
- Atlas control over ROS with python
- Modify environment
- Atlas switching control modes
- Atlas Controller Synchronization over ROS Topics
- Changing Viscous Damping Coefficients Over ROS Service
- Running BDI controller demo
- Using the RobotiQ 3 Finger Adaptive Robot Gripper
- BDI Atlas Robot Interface 3.0.0 Stand In Example
-
HAPTIX
- HAPTIX software install and update
- HAPTIX C API
- HAPTIX Matlab and Octave API
- HAPTIX Simulation World API
- HAPTIX Teleoperation
- HAPTIX environment setup
- HAPTIX Optitrack Control
- HAPTIX Tactor Glove
- HAPTIX Simulation World API with Custom World Example
- HAPTIX logging
- HAPTIX DEKA Luke hand installation
- HAPTIX Simulation Scoring Plugin Example
-
MoveIt!
-
Rviz & rqt & ROSBAG
- Control Theory
- TroubleShooting
- Solidworks model to URDF
- ROS-Gazebo with MATLab
- MATLab installation in Linux
- [Gazebo simulation with MATLab]