Skip to content
Taehun Lim edited this page Feb 5, 2018 · 2 revisions

가제보 플러그인을 이용해서 box를 움직이는 animation을 생성해보자. 플러그인은 가제보에 추가로 사용자 코딩을 할 수 있게 해주는 것으로서 예를 들어 박스를 생성하고 이것의 궤적을 코드 레벨에서 만들어 볼 수 있다.

추후에 플러그인 코드에 대해서는 자세히 다루고 여기서는 그런 플러그인을 한번 실행해보자.

working 디렉토리를 하나 생성하자.

    $ mkdir animatedbox
    $ cd animatedbox

plugin 코드를 다운받는다.

    $ wget http://bitbucket.org/osrf/gazebo/raw/gazebo8/examples/stand_alone/animated_box/animated_box.cc
    $ wget http://bitbucket.org/osrf/gazebo/raw/gazebo8/examples/stand_alone/animated_box/independent_listener.cc
    $ wget http://bitbucket.org/osrf/gazebo/raw/gazebo8/examples/stand_alone/animated_box/integrated_main.cc
    $ wget http://bitbucket.org/osrf/gazebo/raw/gazebo8/examples/stand_alone/animated_box/CMakeLists.txt
    $ wget http://bitbucket.org/osrf/gazebo/raw/gazebo8/examples/stand_alone/animated_box/animated_box.world

제공되는 cmake파일을 이용해서 빌드한다.

    $ mkdir build
    $ cd build
    $ cmake ../
    $ make

build 디렉토리 안에 플러그인 실행 파일이 있으므로 GAZEBO_PLUGIN_PATH라는 환경변수에 이 경로를 인식시켜줘야 한다.

    $ export GAZEBO_PLUGIN_PATH=$(pwd):$GAZEBO_PLUGIN_PATH

animated_box.world를 실행한다.

    $ gazebo ~/animatedbox/animated_box.world

다른 터미널에서 "gz topic" 명령어로 box pose를 수신할 수 있다.

    $ gz topic -v /gazebo/animated_box_world/pose/info

사용자가 코딩한 independent_listener 를 실행시켜서 거기서도 pose를 수신할 수 있다.

    $ gazebo ~/animatedbox/animated_box.world & ./build/independent_listener

gazebo server(시뮬레이션 계산하는 부분)를 따로 실행시키고 client(gui로 보여주는 부분)를 따로 실행시킬 수도 있다.

$ cd ~/animatedbox
$ ./build/integrated_main animated_box.world

$ gzclient

Table of Contents




Clone this wiki locally