Implementation:CARLA simulator Carla ActorDescription
| Knowledge Sources | |
|---|---|
| Domains | Actor System, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
ActorDescription is an RPC-serializable class that represents the chosen configuration of an actor blueprint, containing the blueprint identity and the selected attribute values for spawning.
Description
Defined in the carla::rpc namespace, this class carries the information needed to spawn a specific actor: a numeric uid (ActorId), a string id identifying the blueprint, and a vector of ActorAttributeValue objects with the user's chosen parameter values. When compiled within UE4, it supports bidirectional conversion with FActorDescription, mapping attribute values through the Variations TMap. This type is distinct from ActorDefinition in that it represents a specific instance configuration rather than the full blueprint specification. Serialized via MSGPACK_DEFINE_ARRAY.
Usage
Use this type when requesting the server to spawn an actor with specific attribute values, or when inspecting the description of an already-spawned actor.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/ActorDescription.h
Signature
namespace carla {
namespace rpc {
class ActorDescription {
public:
ActorDescription() = default;
ActorId uid = 0u;
std::string id;
std::vector<ActorAttributeValue> attributes;
MSGPACK_DEFINE_ARRAY(uid, id, attributes);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/ActorDescription.h"
I/O Contract
| Field | Type | Default | Description |
|---|---|---|---|
| uid | ActorId |
0 | Blueprint unique numeric ID |
| id | std::string |
empty | Blueprint string identifier |
| attributes | std::vector<ActorAttributeValue> |
empty | Selected attribute values for this actor instance |
Usage Examples
#include "carla/rpc/ActorDescription.h"
carla::rpc::ActorDescription desc;
desc.uid = blueprint.uid;
desc.id = blueprint.id;
// Set color attribute
carla::rpc::ActorAttributeValue color_attr;
color_attr.id = "color";
color_attr.value = "255,0,0";
desc.attributes.push_back(color_attr);
// Use desc to spawn actor via RPC