carla/Docs/carla_server.md

50 lines
1.1 KiB
Markdown
Raw Normal View History

2017-07-26 17:12:39 +08:00
CARLA Server
============
2017-03-03 22:54:19 +08:00
2017-07-26 17:12:39 +08:00
Protocol
2017-03-03 22:54:19 +08:00
--------
2017-09-07 21:55:41 +08:00
All the messages are prepended by a 32 bits unsigned integer (assumed
little-endian) indicating the size of the coming message.
2017-03-30 20:25:37 +08:00
2017-07-26 17:12:39 +08:00
Three consecutive ports are used,
2017-03-30 20:25:37 +08:00
2017-07-26 17:12:39 +08:00
* world-port (default 2000)
* stream-port = world-port + 1
* control-port = world-port + 2
2017-03-16 02:01:34 +08:00
2017-07-26 17:12:39 +08:00
###### World thread
2017-03-29 17:11:34 +08:00
2017-07-26 17:12:39 +08:00
Server reads one, writes one. Always protobuf messages.
2017-03-20 22:32:31 +08:00
2017-07-26 17:12:39 +08:00
[client] RequestNewEpisode
[server] SceneDescription
[client] EpisodeStart
[server] EpisodeReady
...repeat...
2017-03-20 22:32:31 +08:00
2017-07-26 17:12:39 +08:00
###### Stream thread
2017-03-20 22:32:31 +08:00
2017-07-26 17:12:39 +08:00
Server only writes, first measurements then the raw images.
2017-03-16 02:01:34 +08:00
2017-07-26 17:12:39 +08:00
[server] Measurements
[server] raw images
...repeat...
2017-03-30 01:05:26 +08:00
2017-07-26 17:12:39 +08:00
Every image is an array of uint32's
2017-03-30 01:05:26 +08:00
2017-07-26 17:12:39 +08:00
[width, height, type, color[0], color[1],...]
2017-03-30 01:05:26 +08:00
2017-09-07 22:04:18 +08:00
where each color is an [FColor][fcolorlink] (BGRA) as stored in Unreal Engine.
2017-03-30 01:05:26 +08:00
2017-09-07 22:04:18 +08:00
[fcolorlink]: https://docs.unrealengine.com/latest/INT/API/Runtime/Core/Math/FColor/index.html "FColor API Documentation"
2017-03-30 01:05:26 +08:00
2017-07-26 17:12:39 +08:00
###### Control thread
2017-03-30 01:05:26 +08:00
2017-07-26 17:12:39 +08:00
Server only reads, client sends Control every frame.
2017-03-03 22:54:19 +08:00
2017-07-26 17:12:39 +08:00
[client] Control
...repeat...
2017-03-03 22:54:19 +08:00
2017-07-26 17:12:39 +08:00
In the synchronous mode, the server waits each frame for a Control message.