FURLabRpcDispatcher¶
Transport-agnostic step-server core.
Owns session id, mode state, step counter, request queues, and all the
Handle* / dispatch logic. Knows nothing about ZMQ, SHM, msgpack, or any
specific wire transport. Multiple transports (ZMQ, SHM) call into the
same dispatcher; they only differ in how bytes get from the wire to
Dispatch() and back.
Lives on AAMjManager so all transports share one instance; the
dispatcher's serializing mutex makes concurrent dispatches from
multiple transports safe.
| Attribute | Value |
|---|---|
| Kind | Class |
Properties¶
Public Properties¶
| Property | Type | Description |
|---|---|---|
minimal |
`` | |
standard |
`` | |
changes |
Called when a PIE cycle ends or the editor level * |
|
URLabVersion |
FString |
Wire format echoed to the client as the urlab plugin version. |
FJsonObject |
Returns the reply as an |
minimal¶
- Type:
standard¶
- Type:
changes¶
- Type: Called when a PIE cycle ends or the editor level *
FJsonObject¶
- Type: Returns the reply as an
Private Properties¶
| Property | Type | Description |
|---|---|---|
Dispatch |
** Inner body of |
|
OwnerMgr |
TWeakObjectPtr<AAMjManager> | Weak so stale-manager bugs return nullptr on .Get() instead of |
DispatchMutex |
FCriticalSection |
Guards ActiveSessionId + step-handler install/uninstall. NOT held |
ActiveSessionId |
FString |
|
CachedReplayManager |
TWeakObjectPtr<AMjReplayManager> | |
StepQueue |
TQueue<TSharedPtr<FMjDirectStepCommand>, EQueueMode::Spsc> | SPSC. Shared ownership so both RPC + physics threads can drop their |
PushStateQueue |
TQueue<FMjPushStateRequest, EQueueMode::Spsc> | Puppet-mode request queue. |
PuppetStepHandler |
UMjPhysicsEngine::FMujocoStepCallback | Custom step handlers installed on the engine for Direct / Puppet. |
DirectStepHandler |
UMjPhysicsEngine::FMujocoStepCallback | |
bPuppetHandlerInstalled |
bool |
|
bDirectHandlerInstalled |
bool |
|
RegisteredOpNames |
TArray<FString> |
Dispatch¶
- Type: ** Inner body of
OwnerMgr¶
Weak so stale-manager bugs return nullptr on .Get() instead of
- Type: TWeakObjectPtr<AAMjManager>
DispatchMutex¶
Guards ActiveSessionId + step-handler install/uninstall. NOT held
- Type: FCriticalSection
ActiveSessionId¶
- Type: FString
CachedReplayManager¶
- Type: TWeakObjectPtr<AMjReplayManager>
StepQueue¶
SPSC. Shared ownership so both RPC + physics threads can drop their
- Type: TQueue<TSharedPtr<FMjDirectStepCommand>, EQueueMode::Spsc>
PuppetStepHandler¶
Custom step handlers installed on the engine for Direct / Puppet.
- Type: UMjPhysicsEngine::FMujocoStepCallback
DirectStepHandler¶
- Type: UMjPhysicsEngine::FMujocoStepCallback
bPuppetHandlerInstalled¶
- Type: bool
bDirectHandlerInstalled¶
- Type: bool
RegisteredOpNames¶
- Type: TArray
Functions¶
Public Functions¶
General¶
| Function | Returns | Description |
|---|---|---|
Init() |
void | Bind the dispatcher to a manager (game thread, called from BeginPlay). |
OnManagerGone() |
void | Per-manager teardown: drop the manager pointer, uninstall step |
Shutdown() |
void | Full bridge-server teardown. Resets everything OnManagerGone |
SetDraining() |
void | Cooperative shutdown signal. Set by BridgeServer::Stop() so blocking |
Dispatch() |
TSharedPtr<FJsonObject> |
Parse one inbound (already-decoded) request and run the matching |
SetCachedReplayManager() |
void | Worker threads read the replay manager via this cache instead of |
BuildHandshakePayload() |
TSharedPtr<FJsonObject> |
Build the hello-reply payload. When bIncludeAssets is true (caller |
AppendClockFields() |
void | Stamps sim_time + wall_time blocks (ROS builtin_interfaces/Time |
Init¶
Bind the dispatcher to a manager (game thread, called from BeginPlay).
- Signature:
Init(AAMjManager* InManager)
OnManagerGone¶
Per-manager teardown: drop the manager pointer, uninstall step
- Signature:
OnManagerGone()
SetDraining¶
Cooperative shutdown signal. Set by BridgeServer::Stop() so blocking
- Signature:
SetDraining(boolbIn)
Dispatch¶
Parse one inbound (already-decoded) request and run the matching
- Signature:
Dispatch(const TSharedPtr<FJsonObject>&Req) - Returns: TSharedPtr
SetCachedReplayManager¶
Worker threads read the replay manager via this cache instead of
- Signature:
SetCachedReplayManager(AMjReplayManager* RM)
BuildHandshakePayload¶
Build the hello-reply payload. When bIncludeAssets is true (caller
- Signature:
BuildHandshakePayload(AAMjManager* Manager,const FString&SessionId,const FString&URLabVer,boolbIncludeAssets) - Returns: TSharedPtr
AppendClockFields¶
Stamps
sim_time+wall_timeblocks (ROSbuiltin_interfaces/Time
- Signature:
AppendClockFields(TSharedPtr<FJsonObject>&Reply,doubleSimTimeSec)
Private Functions¶
General¶
| Function | Returns | Description |
|---|---|---|
DispatchInternal() |
TSharedPtr<FJsonObject> |
Inner body of Dispatch; wrapped by the public method so every |
RegisterDispatcherOps() |
void | Register every dispatcher-owned op (manager-required + |
DispatchInternal¶
Inner body of Dispatch; wrapped by the public method so every
- Signature:
DispatchInternal(const TSharedPtr<FJsonObject>&Req) - Returns: TSharedPtr
RegisterDispatcherOps¶
Register every dispatcher-owned op (manager-required +
- Signature:
RegisterDispatcherOps()