Unrecognized method, property, or field 'ReferencePoint' for class 'DrivingStrategy'.

13 ビュー (過去 30 日間)
Samuel
Samuel 2025 年 3 月 28 日
回答済み: Brandon Junior 2025 年 10 月 25 日 15:20
The lastb code block is the one returning the error
%Advance the Scenario
while advance(scenario)
plotOpenPaths(trafficLight)
drawnow limitrate
end
Unrecognized method, property, or field 'ReferencePoint' for class 'DrivingStrategy'.
if isa(obj.Scenario.Actors(i),"driving.scenario.Vehicle") && ~isa(motionStrategy,"driving.scenario.Stationary") && isequal(motionStrategy.ReferencePoint, "front-axle")
a = actorPoses(obj.Scenario);
obj.SensorSimulation.addActors(actorProfiles(obj), actorPoses(obj));
setUpSensorSimulation(obj.Scenario);
running = advance(obj.Scenario);

回答 (2 件)

Altaïr
Altaïr 2025 年 6 月 4 日
Hey @Samuel,
The GitHub example notes that testing was done using MATLAB R2020b. In R2024b, a new FrontAxlePosition field was introduced as part of the actor's pose.
Some related updates can also be seen in the actorPoses function, to update the FrontAxlePosition property of the actors.
R2021a:
R2024b:
To resolve the error, I had to make few adjustments to the DrivingStrategy class in the example:
  1. Added a new property called ReferencePoint to the class.
  2. Updated the accessibility of dependent properties to public.

Brandon Junior
Brandon Junior 2025 年 10 月 25 日 15:20
You need to open the "DrivingStrategy.m" file and add the "ReferencePoint" property to the properties block.
ReferencePoint = 'Rear axle';

製品


リリース

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by