Setting Up a UDP Connection

From the Network Settings window, select UDP from the drop-down menu for both Cmd Control and Publisher/Subscriber/Service tabs, then configure IP addresses.

  • The simulation PC/machine is the Host.

  • Any other machine connected to the Host is the Destination (typically this is the machine running the AD algorithm or software stack).

  • For a single machine setup, use the 127.0.0.1 IP address for all IP fields.

Make sure that none of the port numbers overlap to prevent communication issues

Interface Details and Protocol Structure

Details of each UDP message and its contents are listed in this section. All messages are preceded by a header region with a message identifier string and end with a common 2 byte tail.

Ego Ctrl Cmd

  • Ego Ctrl Cmd sends command messages to the ego-vehicle.

  • Protocol details

    • Total packet size: 55 Bytes

    • Data field size: 3 + 20 Bytes

No

Name

Size

Type

Unit

Remarks

1

CtrlMode

1

uint8

-

1: Keyboard, 2: Auto Mode

2

Gear

1

uint8

-

0: Manual, 1: Parking, 2: Reverse, 3: Neutral, 4: Drive, 5: Lower gear

3

CmdType

1

uint8

-

Determines the control type.
1: Throttle control, 2: Velocity control, 3: Acceleration control

4

Velocity

4

float

km/h

(Only active if CmdType == 2)

5

Acceleration

4

float

m/s2

(Only active if CmdType == 3)

6

Accelerator CMD

4

float

-

Accelerator pedal input ranges from 0 to 1

7

Brake CMD

4

float

-

Brake pedal input ranges from 0 to 1

8

Steering CMD

4

float

-

-1~1: Steering control command (Steer = actual steering angle value/maximum steering angle)

Ego Vehicle Status

  • Ego Vehicle Status returns the current state values of the ego-vehicle.

  • Protocol details

    • Total packet size: 121 Bytes

    • Data field size: 42 + 52 Bytes

No

Name

Size

Type

Unit

Remarks

1

CtrlMode

1

int8

-

1: Keyboard, 2: Auto Mode

2

Gear

1

int8

-

0: Manual, 1: Parking, 2: Reverse, 3: Neutral, 4: Drive, 5: Lower gear

3

Signed Velocity

4

float

km/h

Current vehicle velocity

4

Map Data ID

4

int

-

0 ~ 9999: Digital Twin Map ID
10000 ~ 19999: Virtual Map ID

5

Accel

4

float

-

Accelerator pedal input ranges from 0 to 1

6

Brake

4

float

-

Brake pedal input ranges from 0 to 1

7

sizeX

4

float

m

Ego-vehicle size (x-axis)

8

sizeY

4

float

m

Ego-vehicle size (y-axis)

9

sizeZ

4

float

m

Ego-vehicle size (z-axis)

10

Overhang

4

float

Ego-vehicle front overhang length specification

11

Wheelbase

4

float

Ego-vehicle wheelbase length specification

12

Rear Overhang

4

float

Ego-vehicle rear overhang length specification

13

posX

4

float

m

X-axis value of the ego-vehicle’s current position

14

posY

4

float

m

Y-axis value of the ego-vehicle’s current position

15

posZ

4

float

m

Z-axis value of the ego-vehicle’s current position (elevation)

16

Roll

4

float

deg

Current roll angle value

17

Pitch

4

float

deg

Current pitch angle value

18

Heading

4

float

deg

Current heading angle value

19

VelocityX

4

float

km/h

Current vehicle velocity (x-axis component)

20

VelocityY

4

float

km/h

Current vehicle velocity (y-axis component)

21

VelocityZ

4

float

km/h

Current vehicle velocity (z-axis component)

22

AccelX

4

float

m/s2

Current vehicle acceleration (x-axis component)

23

AccelY

4

float

m/s2

Current vehicle acceleration (y-axis component)

24

AccelZ

4

float

m/s2

Current vehicle acceleration (z-axis component)

25

Steer

4

float

deg

Current steering angle

Object Info

  • Object Info contains information about each object placed in the scene.

  • Protocol details

    • Total packet size: 1472 bytes

    • Data field size: 1420 bytes (68 bytes × 20)

      • The simulator reports object info data for the 20 closest objects to the current vehicle.

No

Name

Size

Type

Unit

Remarks

1

Obj_id

2

short

-

Unique identifier number of the generated object

2

ObjType

2

short

-

0: Pedestrian, 1: Dynamic actor (NPC vehicles), 2: Static object, -1: Ego-vehicle

3

posX

4

float

m

X-axis value of the current position

4

posY

4

float

m

Y-axis value of the current position

5

posZ

4

float

m

Z-axis value of the current position (elevation)

6

Heading

4

float

deg

Heading angle of the object

7

sizeX

4

float

m

Width of the object

8

sizeY

4

float

m

Length of the object

9

sizeZ

4

float

m

Height of the object

10

Overhang

4

float

Object front overhang length specification

11

Wheelbase

4

float

Object wheelbase length specification

12

Rear Overhang

4

float

Object rear overhang length specification

13

VelocityX

4

float

km/h

Current object velocity (x-axis component)

14

VelocityY

4

float

km/h

Current object velocity (y-axis component)

15

VelocityZ

4

float

km/h

Current object velocity (z-axis component)

16

AccelX

4

float

m/s2

Current object acceleration (x-axis component)

17

AccelY

4

float

m/s2

Current object acceleration (y-axis component)

18

AccelZ

4

float

m/s2

Current object acceleration (z-axis component)

Multi Ego Setting

  • Multi Ego Setting enables the simulator to set multiple egovehicles in the same scene, outputting all egovehicle-related variables for each unique ego-vehicle.

  • Protocol details

    • Total packet size: 683 bytes

    • Data field size: 648 bytes (4 + 4 + 32 bytes × 20)

No

Name

Size

Type

Unit

Remarks

1

num_of_ego

4

int32

-

Total number of egovehicles in the scene

2

camera_index

2

short

-

The ID of the vehicle the camera is currently centered on

3

ego_index

2

short

-

ID of the egovehicle

4

posX

4

float

m

X-axis value of the current position

5

posY

4

float

m

Y-axis value of the current position

6

posZ

4

float

m

Z-axis value of the current position (elevation)

7

Roll

4

float

deg

Current roll angle value

8

Pitch

4

float

deg

Current pitch angle value

9

Heading

4

float

deg

Current heading angle value

10

Velocity

4

float

km/h

Current vehicle speed

11

Gear

1

int8

-

1: Parking, 2: Reverse, 3: Neutral, 4: Drive

12

CtrlMode

1

int8

-

1: keyboard mode, 16: automode

Get TrafficLight Status

  • Get TrafficLight Status reports the current state of the most relevant traffic light.

  • Protocol details

    • Total packet size: 48 bytes

    • Data field size: 16 bytes

No

Name

Size

Type

Unit

Remarks

1

traffic light index

12

string

-

Unique identifier string for each traffic light

2

traffic light type

2

short

-

Defines the traffic light type and configuration

0: Red/Yellow/Green
1: Red/Yellow/Green_with_left_arrow
2: Red/Yellow/Green_with_left_arrow/Green
100: Yellow/Yellow/Yellow

3

traffic light status

2

short

-

Defines which light is currently lit

1: Red
4: Yellow
16: Green
32: Green_with_left_arrow
-1: default (not lit)

Combined lights (multiple lights on simultaneously) can be applied using standard bitwise operations

Set TrafficLight Ctrl

  • Set TrafficLight Ctrl transmits traffic light control commands.

  • Protocol details

    • Total packet size: 46 bytes

    • Data field size: 14 bytes

No

Name

Size

Type

Unit

Remarks

1

traffic light index

12

string

-

Unique identifier string for each traffic light

2

traffic light status

2

short

-

Defines which light is currently lit

1: Red
4: Yellow
16: Green
32: Green_with_left_arrow
-1: default (not lit)

Combined lights (multiple lights on simultaneously) can be applied using standard bitwise operations

Collision Data

  • Collision Data reports any collisions involving the ego-vehicle.

  • Protocol details

    • Total packet size: 173 bytes

    • Data field size: 140 bytes (28 × 5 bytes)

No

Name

Size

Type

Unit

Remarks

1

ObjType

2

short

-

Object type code

0: Pedestrian, 1: NPC Vehicle, 2: Static object, -1: Ego-vehicle

2

ObjId

2

short

-

Unique identifier number of the collided object

3

posX

4

float

m

The x-axis position of the collided object w.r.t the ego-vehicle

4

posY

4

float

m

The y-axis position of the collided object w.r.t the ego-vehicle

5

posZ

4

float

m

The z-axis position of the collided object w.r.t the ego-vehicle

6

global offset x

4

float

m

The x-axis position of the collided object w.r.t the map coordinate system

7

global offset y

4

float

m

The y-axis position of the collided object w.r.t the map coordinate system

8

global offset z

4

float

m

The z-axis position of the collided object w.r.t the map coordinate system

NPC Vehicle Collision Data

  • NPC Vehicle Collision Data reports any collisions involving NPC vehicles. As NPC vehicles are classified as objects, this message is divided into two identical smaller messages - each corresponding to a NPC vehicle.

  • Protocol details

    • Total packet size: 1156 bytes

    • Data field size: 1120 bytes (112 × 10 bytes)

No

Name

Size

Type

Unit

Remarks

1

ObjType

2

short

-

Object type code

0: Pedestrian, 1: NPC Vehicle, 2: Static object, -1: Ego-vehicle

2

ObjId

2

short

-

Unique identifier number of the collided object

3

posX

4

float

m

X-axis value of the current position

4

posY

4

float

m

Y-axis value of the current position

5

posZ

4

float

m

Z-axis value of the current position (elevation)

6

Heading

4

float

deg

Heading angle of the object

7

sizeX

4

float

m

Width of the object

8

sizeY

4

float

m

Length of the object

9

sizeZ

4

float

m

Height of the object

10

VelocityX

4

float

km/h

Current object velocity (x-axis component)

11

VelocityY

4

float

km/h

Current object velocity (y-axis component)

12

VelocityZ

4

float

km/h

Current object velocity (z-axis component)

13

AccelX

4

float

m/s2

Current object acceleration (x-axis component)

14

AccelY

4

float

m/s2

Current object acceleration (y-axis component)

15

AccelZ

4

float

m/s2

Current object acceleration (z-axis component)

↓ Second Object Data

16

ObjType

2

short

-

Object type code

0: Pedestrian, 1: NPC Vehicle, 2: Static object, -1: Ego-vehicle

17

ObjId

2

short

-

Unique identifier number of the collided object

18

posX

4

float

m

X-axis value of the current position

19

posY

4

float

m

Y-axis value of the current position

20

posZ

4

float

m

Z-axis value of the current position (elevation)

21

Heading

4

float

deg

Heading angle of the object

22

sizeX

4

float

m

Width of the object

23

sizeY

4

float

m

Length of the object

24

sizeZ

4

float

m

Height of the object

25

VelocityX

4

float

km/h

Current object velocity (x-axis component)

26

VelocityY

4

float

km/h

Current object velocity (y-axis component)

27

VelocityZ

4

float

km/h

Current object velocity (z-axis component)

28

AccelX

4

float

m/s2

Current object acceleration (x-axis component)

29

AccelY

4

float

m/s2

Current object acceleration (y-axis component)

30

AccelZ

4

float

m/s2

Current object acceleration (z-axis component)

Get Intersection Status

  • Get Intersection Status returns the current state of the most relevant intersection.

  • Protocol details

    • Total packet size: 37 bytes

    • Data field size: 8 bytes

No

Name

Size

Type

Unit

Remarks

1

intersection index

2

short

-

Unique identifier number for each intersection

2

intersection status

2

short

-

Current intersection status

3

intersection status time

4

float

The amount of time the intersection has maintained the current state

Set Intersection Status

  • Set Intersection Status changes the current state of an intersection according to user input.

  • Protocol details

    • Total packet size: 40 bytes

    • Data field size: 8 bytes

No

Name

Size

Type

Unit

Remarks

1

intersection index

2

short

-

Unique identifier number for each intersection

2

intersection status

2

short

-

Current intersection status

3

intersection status time

4

float

The amount of time the intersection has maintained the current state

Scenario Load

  • Scenario Load instructs the simulator to load specific pre-built .json scenario files

  • Protocol details

    • Total packet size: 69 bytes

    • Data field size: 37 bytes

No

Name

Size

Type

Unit

Remarks

1

file name

30

string

-

2

delete all

1

bool

-

3

load network connection data

1

bool

-

4

load ego vehicle data

1

bool

-

5

load npc vehicle data

1

bool

-

6

load pedestrian data

1

bool

-

7

load object data

1

bool

-

8

set pause

1

bool

-

Save Sensor Data

  • Save Sensor Data saves sensor data for the current simulation frame.

  • Protocol details

    • Total packet size: 125 bytes

    • Data field size: 91 bytes

No

Name

Size

Type

Unit

Remarks

1

is custom file name

1

bool

-

Determines if the save file name is custom input by the user

2

custom file name

30

string

-

The custom save file name input by the user

3

file dir

60

string

-

The full path string of the save file

Sensor Control

  • Sensor Control controls the position and orientation of a designated sensor according to input commands.

  • Protocol details

    • Total packet size: 59 bytes

    • Data field size: 26 bytes

No

Name

Size

Type

Unit

Remarks

1

sensor index

2

short

-

2

pose

4

float

m

3

posY

4

float

m

4

posZ

4

float

m

5

roll

4

float

deg

6

pitch

4

float

deg

7

heading

4

float

deg

Turn Signal Lamp Control

  • Turn Signal Lamp Control controls the turn signal lamp lights of the vehicle.

  • Protocol details

    • Total packet size: 33 bytes

    • Data field size: 2 bytes

No

Name

Size

Type

Unit

Remarks

1

turn signal

1

byte

-

0: No signal, 1: Left turn signal, 2: Right turn signal

2

emergency signal

1

byte

-

0: No signal, 1: Emergency lamps on