NPC Ghost Mode
This section describes about the 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
Type Description : A message which you can control the NPC vehicle in the NPC Ghost mode.
No | Name | Type | Unit | Remarks |
|---|---|---|---|---|
1 | header | Header | - |
|
2 | npc_list | - | Npc Ghost Vehicle information |
How to use NPC Ghost Mode in ROS
The NPC Ghost Mode setting can be set in the submenu of the PlayMode menu at the top of the simulator.

In the NPC Ghost Mode Settings, enter the IP of ROS Bridge according to your environment and click Connect.
You can check the connection status through the Status UI.
If you publish /NpcGhost_Topic in ROS, you can see the NPC Ghost Vehicle is created according to the information.
UDP Protocol Messages
NPC Ghost Controller
Type Description
Message to represent NPC vehicle using Ghost Mode.
Up to 20 vehicles can be represented.
If you want to create fewer than 20 NPC vehicles, you can set the unique_id for unnecessary vehicle information to 0 and fill it with random data.
Communication Protocol
Total Packet Size: 1031 Bytes
Data Size: 1000 Bytes (50 Bytes * 20)
unique_id (1byte / int8)
unique_id of NPC Ghost Vehicle (Example: 2,3,4..)
car_name (25byte / string)
NPC Ghost Vehicle Model Name
The data size to be entered is 25 bytes. If the data size is shorter than 25 bytes, the blank must be filled via pressing space key, if longer, it must be shortened to fit 25 bytes.Example
"2016_Kia_Niro(HEV) "
x_position (4byte / float)
Set the X position of the NPC Ghost Vehicle (m)
y_position (4byte / float)
Set the Y position of the NPC Ghost Vehicle (m)
z_position (4byte / float)
Set the Z position of the NPC Ghost Vehicle (m)
roll_rotation (4byte / float)
Set Roll rotation of the NPC Ghost Vehicle (deg)
pitch_rotation (4byte / float)
Set Pitch rotation of the NPC Ghost Vehicle (deg)
yaw_rotation (4byte / float)
Set Yaw rotation of the NPC Ghost Vehicle (deg)

How to use NPC Ghost Mode in UDP

The following GitHub link is provided to enable the NPC Ghost Mode feature on UDP.
: [UDP] GitHub Link for NPC Ghost Mode
You can enable this feature by running python NPC_Ghost_Mode.py.