Visual Servoing
기능
Visual servoing 예제를 제공합니다. 예제 파일은 python 으로 작성 되어 있습니다.
- python 소스 위치: ~/ros2_ws/src/doosan-robot2/dsr_example2/visualservoing/launch
dsr_launcher2 인자
인수명 | 자료형 | 기본값 | 설명 |
---|---|---|---|
name | - | dsr01 | ROBOT name space . single robot : dsr01 . multi robot: dsr01 부터 순차적으로 dsr02, dsr03, dsr04 … |
host | - | 127.0.0.1 | 로봇 제어기 IP . 애뮬레이터 : 127.0.0.1 . 실제 로봇제어기 : 192.168.137.100 |
port | - | 12345 | 서비스 port |
mode | - | virtual | 로봇 동작 모드 - virtual : 가상 동작 - real : 실제 동작 |
model | - | m1013 | M-Series 로봇 모델 . m0609, m0617, m1013, m1509 A-Series 로봇 모델 . a0509, a0912 E-Series 로봇 모델 . e0509 H-Series 로봇 모델 . h2017, h2515 |
color | - | white | 로봇 컬러 . white or blue |
gui | - | none | Rviz2 활성화 유무 . True : Rviz2 활성화 . False : Rviz2 비활성화 |
옵션
visual_servoing.sdf 파일을 변경하여 시뮬레이션 환경을 변경할 수 있습니다.
/rgbd_camera/depth_image 토픽을 사용하여 depth data를 사용할 수 있습니다.
예제
1. 가상 로봇 default IP/Port
- IP : 127.0.0.1 , port = 12345
2. launch (Start the simulation)
maker 인식을 수행할 카메라를 켜기위해 visualservoing 예제의 런치파일을 실행합니다.
$ ros2 launch visualservoing dsr_bringup2_visual_servoing_gazebo.launch.py mode:=virtual host:=127.0.0.1 port:=12345 name:=dsr01 model:=m1013
3. Move to the home position
Visual servoing 수행을 위해 home position으로 이동합니다.
$ ros2 run visualservoing joint90
4. Run the visual servoing example
$ ros2 launch visualservoing visual_servoing_gz.launch.py
Camera Calibration 방법
1. camera_calibration.launch.py 에 사용된 camera_calibration.sdf 파일을 수정합니다. 사용 중인 카메라의 성능에 맞게 조정해야 합니다.
2. 카메라 보정에 필요한 패키지를 설치합니다.
$ sudo apt install ros-humble-camera-calibration
$ sudo apt install ros-humble-image-pipeline
3. camera_calibration.launch.py 를 실행합니다.
$ ros2 launch visualservoing camera_calibration.launch.py
4. Camera Calibration 노드를 실행합니다.
$ ros2 run camera_calibration cameracalibrator --pattern chessboard --size 6x8 --square 0.02 image:=/rgbd_camera/image
5. calibration 버튼이 활성화될 때까지 Gazebo에 업로드 된 바둑판을 회전하고 이동합니다.
6. calibration 버튼을 누른 후 저장 버튼을 클릭하고 터미널(Camera Calibration 노드가 실행된 위치)에 표시된 결과를 rgbd_camera_gz.yaml 파일에 적용합니다
주의
1. RAM 용량이 부족하면 build 오류가 발생할 수 있으므로 swap을 설정하여 메모리 용량을 늘려주세요.
2. Gazebo를 더 빨리 실행하려면 dsr_controller2_gz.yaml의 update_rate를 수정해야 합니다.
(Path: doosan-robot2/dsr_controller2/config/dsr_controller2_gz.yaml)

그림 6.2 visual servoing