Convert actor to MATLAB structure
Convert Actor to Structure
rrApp = roadrunner('C:\Project\TestHighwayRoute'); openScenario(rrApp,'myScenario1'); sim = createSimulation(rrApp);
Start the simulation.
Pause the simulation.
Retrieve one actor from the simulation.
actorsim = get(sim, 'ActorSimulation'); actorOne = actorsim(1);
Convert the actor to a MATLAB structure.
actorStruct = convertToStruct(actorOne)
actorStruct = struct with fields: ActorID: 1 Pose: [4×4 double] Velocity: [0 0 0] AngularVelocity: [0 0 0]
actorSim — Actor
Actor, specified as a
actorStruct = convertToStruct(actorSim)
actorStruct — MATLAB structure equivalent to actor
MATLAB structure equivalent to actor, returned as a
This MATLAB structure contains the runtime attributes of the specified actor.
The returned structure contains these fields.
|Actor identifier, returned as a positive integer.|
|Position and orientation of actor in the RoadRunner Scenario coordinate system, returned as a 4-by-4 array.|
|Velocity of actor in the x-, y-and z- directions, returned as a 1-by-3 vector. Units are in meters per second.|
|Angular velocity of actor in the x-, y-and z- directions, returned as a 1-by-3 real-valued vector. Units are in radians per second.|
Introduced in R2022a