[u,steps] = sampleControl(mobileProp,q0,u0,qTgt)
generates a series of control commands and number of steps to move from the current state
q0 with control command u0 toward the target
state qTgt.
Interpolate that path so that it contains exactly 250 points.
numStates = 250;
interpolate(path,numStates)
Extract the sequence of motions from the path.
q1 = path.States(1:end-1,:); % Initial states
q2 = path.States(2:end,:); % Final states
Estimate the cost of propagating to target state.
cost = distance(propagator,q1,q2);
Generate a series of control commands and number of steps to move from the current state q1 with control command u toward the target state q2.
u = zeros(size(q1,1),propagator.NumControlOutput);
steps = zeros(size(q1,1),1);
for i = 1:size(q1,1)
[u(i+1,:),steps(i)] = sampleControl(propagator,q1(i,:),u(i,:),q2(i,:));
end
Create a control-based path object with the specified state propagator and a sequence of specified states, controls, targets, and durations.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.