본문 바로가기

FOSCAR-(Autonomous Driving)/ROS 스터디

[2023 ROS 스터디] 임현진 #1주차 - ROS설치

반응형

ROS 설치

ROS를 설치하는 방법에는 1줄 설치 또는 수동 설치 방법이 있습니다.

강의에 나온대로 1줄에 설치하는 방법은

다음과 같았습니다.

하지만, 개발에 익숙해지면 ROS를 직접 수동으로 설치 할 줄 알아야 한다고 해서, 수동으로 직접 설치를 해보았습니다.

수동으로 설치할 경우에는 자신의 Ubuntu버전에 따라서 2가지로 나뉩니다. Ubuntun 버전이 18.04인 경우에는 ROS Melodic Morenia를 설치해야 하고, Ubuntu 버전이 20.04인 경우에는 ROS Noetic Ninjemys를 설치해야합니다. 저의 경우에는 Ubuntu가 18.04의 버전이기 때문에, ROS Melodic Morenia를 설치하였습니다.

http://wiki.ros.org/melodic/Installation/Ubuntu

 

melodic/Installation/Ubuntu - ROS Wiki

We are building Debian packages for several Ubuntu platforms, listed below. These packages are more efficient than source-based builds and are our preferred installation method for Ubuntu. Note that there are also packages available from Ubuntu upstream. P

wiki.ros.org

다음 링크에 들어가면 Ubuntu terminal을 통해서 설치하는 방법이 나옵니다. 저는 해당 링크를 step by step으로 따라가면서 설치를 완료하였습니다.

또한, ROS를 사용하다 보면 여러 창의 terminal이 필요한데 그때마다 terminal창을 계속 열어서 사용하면 불편하기 때문에 terminator라는 것을 설치하였습니다. terminator는 하나의 terminal 창을 여러개로 나누어서 사용 할 수 있도록 도와줍니다.

sudo apt-get install terminator

다음 명령어를 통해서서 설치 할 수 있습니다. 다 설치하고 나면 다음과 같이 창이 만들어집니다.

ROS 동작 테스트 - turtlesim 패키지

  • roscore는 ROS를 사용할 때, 제일 먼저 실행하게 됩니다.

  • rosrun을 사용하여 해당 패키지의 node를 실행시킵니다.
    ex) rosrun [package_name] [node_name]
     - rosrun turtlesim turtlesim_node 를 입력하면 다음과 같이 거북이 한마리가 창에 뜨게 됩니다.

             - rosrun turtlesim turtle_teleop_key 를 입력하면 창에 뜬 거북이를 방향키를 통해서 control 할 수 있게됩니다.
               이때, 주의할점은 해당 명령어를 입력한 창을 클릭하고 그 위에서 방향키를 움직여야 거북이가 움직인다는 것입니다.

           - rosrun rqt_graph rqt_graph 를 입력하면 node와 topic이 어떻게 동작하고 있는지를 확인 할 수 있습니다.

ROS에서 사용 가능한 통합개발환경(IDE)

  1. Otcreator + QT Creator Plugin for ROS
    설치 : sudo apt-get install qtcreator
    장점 : CmakeLists.txt을 그대로 사용 가능, rqt 프러그인 및 GUI 개발이 쉬움
  2. Visual Studio Code + ROS Extension
    설치 : https://code.visualstudio.com/
 

Visual Studio Code - Code Editing. Redefined

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

code.visualstudio.com

 

      장점 : 간단한 텍스트 편집기 지향, 빠름
      비슷한 계열로 Atom, Sublime Text, Clion 등도 좋음

   3. Eclipse
       설치 : http://www.eclipse.org

 

The Community for Open Innovation and Collaboration | The Eclipse Foundation

The Eclipse Foundation provides our global community of individuals and organizations with a mature, scalable, and business-friendly environment for open source …

www.eclipse.org

 

        장점 : 많은 사람들이 사용하는 익숙한 통합개발환경(단, 무거움)

 

저는 원래부터 우분투에서 사용하던 Visual Studio Code를 사용하기로 결정하였습니다.

ROS강의 Chapter1과 ROs강의 Chapter2는 개인 tistory에 따로 간단하게 정리하였습니다.
Chapter 1.

 

Ros Study - 로봇 소프트웨어 플랫폼

Ecosystem 하드웨어 모듈 + 운영체제 + 앱(서비스) + 유저 소프트웨어 플랫폼이 가져온 변화 하드웨어 인터페이스 통합 하드웨어 추상화, 규격화, 모듈화 가격 down, 성능 up 하드웨어, 운영체제, 애플

jinistudy.tistory.com

Chapter 2.

 

Ros Study - 로봇 운영체제 ROS

ROS란?(Robot Operating System) open source를 기반으로, 손쉽게 가져다가 쓸 수 있습니다. ROS는 personal robot을 위해서 만들어진 운영체제 소프트웨어 프레임워크 - 로봇 소프트웨어를 개발하기 위한 소프트

jinistudy.tistory.com

 

반응형