Skip to main content
Skip table of contents

NPC Ghost Mode 사용 방법

본 페이지는 User 가 원하는 위치/자세로 NPC Vehicle 을 생성 할 수 있는 모드인 NPC Ghost Mode 에 대해 소개한다.


ROS Protocol Messages

NPC Ghost Controller

https://github.com/MORAI-Autonomous/MORAI-ROS_morai_msgs/blob/master/msg/NpcGhostCmd.msg

  • NPC Ghost Controller

    • Message Type : morai_msgs/NpcGhostCmd

    • Default Topic : /NpcGhost_Topic

    • 타입설명 : NPC Ghost mode 에서 Npc Vehicle 을 생성 (Control) 하는 메세지

No

Name

Type

Unit

Remarks

1

header

Header

-

2

npc_list

NpcGhostInfo[]

-

Npc Ghost Vehicle 정보



ROS 에서의 NPC Ghost Mode 기능 사용법

NPC Ghost Mode 설정은 시뮬레이터 상단 PlayMode 메뉴의 하위 메뉴에서 설정이 가능하다.

npcg1.png
  • NPC Ghost Mode Settings 창에서 사용 환경에 맞게 ROS Bridge 의 IP 를 적어주고 Connect 를 눌러준다.

  • Status UI 를 통해 연결 유무를 확인할 수 있다.

  • ROS 에서 /NpcGhost_Topic 을 Publish 해주면 해당 정보에 따라 NPC Ghost Vehicle 이 생성되는 것을 확인 할 수 있다.


UDP Protocol Messages

NPC Ghost Controller

  • 타입 설명

    • Ghost Mode 이용 NPC 차량들을 표현하기 위한 메세지

    • 최대 20대까지 표현이 가능

    • 만약 20대 미만의 NPC 를 생성하고 싶은 경우 불필요한 차량 정보에 대한 unique_id 를 0으로 지정하고, 임의의 데이터들로 채우면 됨

  • 통신 프로토콜

    • 전체 패킷 크기: 1031 Bytes

    • 데이터 크기 1000 Bytes (50 Bytes * 20)

      • unique_id (1byte / int8)

        • NPC Ghost Vehicle 의 unique_id 값 (e.g. 2,3,4..)

      • car_name (25byte / string)

        • NPC Ghost Vehicle의 모델 이름

          • (warning) 입력할 데이터 크기는 25byte로 25byte 보다 짧을 경우 뒤에 Space로 공백을 채워야 하며, 길면 줄여 25byte에 맞춰야 함

          • e.g. "2016_Kia_Niro(HEV) "

      • x_position (4byte / float)

        • NPC Ghost Vehicle 의 x 위치 지정 (m)

      • y_position (4byte / float)

        • NPC Ghost Vehicle 의 y 위치 지정 (m)

      • z_position (4byte / float)

        • NPC Ghost Vehicle 의 z 위치 지정 (m)

      • roll_rotation (4byte / float)

        • NPC Ghost Vehicle 의 roll 회전 지정 (deg)

      • pitch_rotation (4byte / float)

        • NPC Ghost Vehicle 의 pitch 회전 지정 (deg)

      • yaw_rotation (4byte / float)

        • NPC Ghost Vehicle 의 yaw 회전 지정 (deg)


UDP 에서의 NPC Ghost Mode 기능 사용법

npcg2.png

UDP에서 NPC Ghost Mode 기능 사용을 위해 아래 GitHub 링크를 제공한다. 24.R1.0 UPDATE

: [UDP] NPC Ghost Mode 기능 사용을 위한 GitHub링크

python NPC_Ghost_Mode.py로 실행하여 NPC Ghost Mode 기능을 사용한다.

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.