메인메뉴 바로가기 본문으로 바로가기

마산중앙고등학교

검색열기

AI 로봇선도학교

Manipulator (로봇팔)

메인페이지 AI 로봇선도학교Manipulator (로봇팔)

Manipulator (로봇팔)


Manipulator 빌드

김성두  

 

      

개념: OPENMANIPULATOR는 오픈소스 기반의 소프트웨어와 하드웨어가 제공되는 로봇 팔입니다. 로봇운영체제 ROS을 통하여 제어하던지 OPENCR을 이용하여 제어가 가능합니다. 이 로봇팔은 바닥에 고정해서 사용해도 되고 로봇에 올려 사용도 가능합니다. 우리의 교육적 목표는 MANIPULATOR가 물건을 집어 옮기는 작업과, 로봇이 MANIPULATOR을 장착한 후 스스로 목표 지점으로 이동하여 물건을 집어 제자리로 되돌아 와서 물건을 놓는 과정을 시연하는 것입니다.

 

manipulator.jpg

 

 

베이스는 Ubuntu 20.04 에 ros2 foxy 구성입니다.

 

$ sudo apt update
$ wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros2_foxy.sh
$ chmod 755 ./install_ros2_foxy.sh 

$ bash ./install_ros2_foxy.sh 

: ros 의존성 관리 패키지 설치, pip는 우분투 아닌곳에서 사용함

 

$ sudo apt install ros-foxy-rqt* ros-foxy-joint-state-publisher


$ cd ~/colcon_ws/src/
$ git clone -b foxy-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git
$ git clone -b ros2 https://github.com/ROBOTIS-GIT/dynamixel-workbench.git
$ git clone -b foxy-devel https://github.com/ROBOTIS-GIT/open_manipulator.git
$ git clone -b ros2 https://github.com/ROBOTIS-GIT/open_manipulator_msgs.git
$ git clone -b ros2 https://github.com/ROBOTIS-GIT/open_manipulator_dependencies.git
$ git clone -b ros2 https://github.com/ROBOTIS-GIT/robotis_manipulator.git
$ cd ~/colcon_ws && colcon build --symlink-install
--------------------------

이상의 작업으로 빌더가 제대로 되지 않을때는  아래와 같이 조치함

$ sudo apt update

$ rosdep update       : user권한으로 실행 해야함

$ rosdep install --from-paths src --ignore-src -r -y     : 항상실시

또는 rosdep install -i --from-path src --rosdistro foxy -y

작업공간에 있는 (src에 있는) 모든 패키지들의 종속성을 확인해 패키지를 설치

 

$ colcon build --symlink-install

: 실제로 복사하지는 않고 링크만 걸어준다는 뜻이며 

 그러면 install 에 생성됨 이것을 적용하려면 source 해 주어야하는데 

 이것은 오버레이로 구성되어 작동됨을 의미함.

 

 만약 빌드가 안될경우 아래와 같이 빌드함 

$colcon build --symlink-install --packages-up-to 패키지명

$ source /opt/ros/foxy/setup.bash 

$ source ~/colcon_ws/install/local_setup.bash 를실행해야 된다. 

 (그래서 .bashrc 에 모두 포함시켜 놓음)

 

 

 

20211015_102147.jpg

 

 초기 작동 (U2D2 로 매니퓰레이트에 연결 시)

$ ros2 launch open_manipulator_x_coltroller open_manipulator_x-controller.launch.py

: 작동이 안되거나 에러 메시지가 발생하면 철자를 자세히 확인 및 usb포트의 퍼미션을 허가해 주어야 합니다.

 

 매니퓰레이터 상태 확인 및 시각 툴

$ ros2 topic pub /option std_msgs/String "data: print_open_manipulator_x_setting"

$ rqt _graph    : 각종 값 표시창

$ ros2 launch open_manipulator_x_description open_manipulator_x_rvix.launch.py 

  : 시각 툴

 

키보드 작동

$ros2 run open_manipulator_x_teleop teleop_keyboard

: 전진-w 후진-x 좌-a 우-d 위-q 아래-z

 

   Joint Space control 

- joint1  증-y 감-h 

- joint2  증-u 감-j

- joint3 증-i 감-k

- joint4 증-o 감-l

- joint5 증-f 감-g

-  INIT = 1,    HOME = 2 

: 그립에서 에러 메세지가 발생할 수 있으나 마이너한 것일 가능성이 높음