Skip to content

Elevators & Occupied Event

Hancheol Choi edited this page Mar 12, 2018 · 12 revisions

Overview

이 페이지에서는 가제보에서 엘레베이터를 사용하는 방법을 알려준다. 가제 엘레베이터는 문이 달린 칸으로 위아래로 움직일 수 있으며 prismatic joint로 제어된다.

Functionality

엘레베이터의 동작은 ElevatorPlugin을 통해 이루어진다. 이 플러그인은 2개의 prismatic joint를 제어한다. 플러그인의 업데이트 사이클에는 lift joint가 엘레베이터를 요청된 층으로 이동시키고 dorr joint가 엘레베이터의 현재 상태에 따라 닫힌 문을 연다. 특정 층으로의 이동은 층의 번호를 string message로 엘레베이터의 토픽으로 보내 이루어질 수 있다. 자세한 파라미터는 뒤 섹션에서 주어진다. 엘레베이터의 제어 과정은 다음과 같다.

  1. Wait for a floor request.
  2. Close door.
  3. Move to requested floor.
  4. Open door.
  5. Wait for five seconds.
  6. Close the door.
  7. Go to #1.

층 이동 요청은 Queue 형태가 아니며 새로운 요청이 오기 전에 이동을 마칠것이다.

Parameters

lift joint, door joint, floor height, control topic은 SDF안에 명시되어있다. 다음은 그 예이다.

<plugin filename="libElevatorPlugin.so" name="elevator_plugin">
  <lift_joint>elevator::lift</lift_joint>
  <door_joint>elevator::door</door_joint>
  <floor_height>3.075</floor_height>
  <topic>~/elevator</topic>
</plugin>

이 예에서 elevator 모델은 리프팅을 위한 lift, 문 개폐를 위한 door joint와 함게 SDF파일 어딘가에 존재한다. 각 층의 높이는 3.075 미터이고 엘레베이터 플러그인은 ~/elevator 토픽상의 요청을 수신한다.

Example

완성된 example world는 가제보와 함께 배포된다. 아래 코드로 실행시킬 수 있다.

gazebo worlds/elevator.world

이 world는 두 층과 엘레베이터 하나로 이루어져 있다. 간단한 도형을 층 앞에 두면 층 이동 요청이 Occupied Region Event로 인해 발도오디게 된다.

Occupied Region Event

엘레베이터 플러그인은 SimEventsPluginOccupiedEvent와 함께 동작한다. OccupiedEvent는 3D 구역으로 model에 의해 메세지를 발송하게 된다.

Usage and Example

<plugin filename="libSimEventsPlugin.so" name="event_plugin">

  <region>
    <name>region1</name>
    <volume>
      <min>0 0 0</min>
      <max>0 1 1</max>
    </volume>
  </region>

  <event>
    <name>region1_event</name>
    <type>occupied</type>
    <region>region1</region>
    <topic>~/elevator</topic>
    <msg_data>0</msg_data>
  </event>

</plugin>

OccupiedEvent를 libSimEventsPlugin.so를 예로 들어 설명한다. 이는 이나 occupied 의 을 가지고 있는 에 의존한다.

다음 예에서 region은 최소점 (0,0,0)과 최대점(1,1,1)로 이루어진 공간이다. 이 공간의 이름은 region1 이다. occupied 의 인 region1 event 또한 region1을 통해 명시된다. 어떤 모델이 region1에 위치하게 되면 데이터 string message 가 값 "0"을 가지고 ~/elevator로 전송된다.

Table of Contents




Clone this wiki locally