What changed in the SmoothTrajectory function in matlab 2025b?

29 visualizaciones (últimos 30 días)
Luis Arturo Torres
Luis Arturo Torres el 14 de Oct. de 2025 a las 14:47
Respondida: Soumya el 31 de Oct. de 2025 a las 3:21
I had this script to export a series of points to the driving scenario in the Automated Driving Toolbox and it was working in Matlab 2024b.
Now I updated to 2025b and this stopped working. I read in the docs. that maybe the Jerk, which is a new parameter by default in 0.6, coud be the reason. I tried with a big number of jerk but it is still failing.
The error message only says that there is an error in the function smoothTrajectory and nothing else.
The out.VehiclePose format is [X,Y, Yaw].
Do you guys have some suggestions?
load('waypoints.mat'); % It must contain a variable with the way-point list.
waypoints = racetrackwaypoints(:, 1:2); % Only X, Y
velocities = racetrackwaypoints(:, 3); % Velocity on each point.
realVehiclePose = out.VehiclePose;
% Create the scenario.
scenario = drivingScenario('SampleTime',0.1','StopTime',60);
roadCenters = [waypoints, zeros(size(waypoints(:,1)))]; % Use the loaded way-points
% Add the read center to the scenario.
cr = road(scenario, roadCenters, 'Lanes', lanespec(3)); % Define lanes explicitly
% Add a vehicle.
veh = vehicle(scenario, ClassID=1,PlotColor='red',Name='EgoVehicle');
%roadActor = actor(scenario, 'ClassID', 3, 'Position', [0,0,0]); % Static road object
% Define the vehicle trajectory with the way-points and speeds.
smoothTrajectory(veh, realVehiclePose);
drivingScenarioDesigner(scenario); %this is to open the drivingScenarioDesigner

Respuestas (1)

Soumya
Soumya el 31 de Oct. de 2025 a las 3:21
I understand that after upgrading to MATLAB 2025b, your script using 'smoothTrajectory' stopped working even though it ran fine in 2024b. The new release of the Automated Driving Toolbox introduces stricter jerk-limited motion constraints (default jerk = 0.6 m/s³), so older waypoint/speed combinations can now violate feasibility conditions and trigger an internal 'smoothTrajectory' error.
You can follow the given troubleshooting steps that might work for you:
  • Specify a larger jerk limit to relax constraints:
smoothTrajectory(veh, waypoints, velocities, 'Jerk', 50);
  • Very short distances or abrupt speed changes can make a jerk-limited path infeasible. Increase spacing or lower speeds if needed.
  • Wrap the call in a try/catch block to display full error details:
try
smoothTrajectory(veh, waypoints, velocities, 'Jerk', 20);
catch ME
disp(ME.message);
end
You can refer to the following documentations for more information:
I hope this helps!

Productos


Versión

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by