Implementation:CARLA simulator Carla WalkerControl
| Knowledge Sources | |
|---|---|
| Domains | Pedestrian Control, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
WalkerControl is an RPC-serializable class that provides movement control for pedestrian walker actors, specifying direction, speed, and jump state.
Description
Defined in the carla::rpc namespace (~68 lines), this class contains three parameters for controlling walker movement:
- direction (Vector3D, default {1,0,0}): the movement direction vector
- speed (float, default 0.0f): movement speed in m/s
- jump (bool, default false): whether the walker should jump
When compiled within UE4, the class converts to/from FWalkerControl with appropriate unit conversion (speed is multiplied by 1e2 for cm/s in UE4, divided by 1e2 for m/s in RPC). The class supports equality comparison and MsgPack serialization.
Usage
Use this type to control pedestrian walker movement via the CARLA client API, setting their walking direction, speed, and triggering jumps.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/WalkerControl.h
Signature
namespace carla {
namespace rpc {
class WalkerControl {
public:
WalkerControl() = default;
WalkerControl(geom::Vector3D direction, float speed, bool jump);
geom::Vector3D direction = {1.0f, 0.0f, 0.0f};
float speed = 0.0f;
bool jump = false;
bool operator!=(const WalkerControl &rhs) const;
bool operator==(const WalkerControl &rhs) const;
MSGPACK_DEFINE_ARRAY(direction, speed, jump);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/WalkerControl.h"
I/O Contract
| Field | Type | Default | Description |
|---|---|---|---|
| direction | geom::Vector3D |
{1.0, 0.0, 0.0} | Movement direction vector (normalized) |
| speed | float |
0.0f | Movement speed in m/s |
| jump | bool |
false | Whether walker should jump |
Usage Examples
#include "carla/rpc/WalkerControl.h"
carla::rpc::WalkerControl control;
control.direction = {0.0f, 1.0f, 0.0f}; // walk along Y axis
control.speed = 1.4f; // normal walking speed
control.jump = false;
walker->ApplyControl(control);