Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
ROBOT LOCALIZATION AND MOTION PLANNING
3 Commenti
- Thanks Walter.
- It is to find the Jacobian Fx, Fu of f w.r.t. x and u. I tried this but get error "Undefined function 'x' for input arguments of type 'double' :
- f = @(x, u) [x(1)+u(1)*cos(x(3)+u(2));
- x(2)+u(1)*sin(x(3)+u(2)) ; x(3)+u(2)];
- Fx = @(x,u) 1;1;1;
- Fu = @(x,u) cos(x(2)+1);sin(x(2)+1);1;
Risposta accettata
7 Commenti
Più risposte (1)
115 Commenti
- Thanks Walter. Managed to get it:
- I did some mods since I posted my code, so here is the modified code:
- Map = zeros(11,9);
- Map(1,:) = -1; Map(11,:) -1; Map(:,1) = -1; Map(:,9) = -1;
- Map(9,2) = -1; Map(10,2) = -1; Map(10,3)= -1; Map(5:6,5:8) = -1;
- SearchStart = [3,7];
- SearchGoal = [9,6];
- CurrPos = SearchStart;
- SolutionMap = Inf*ones(size(Map)); %store g-values in here.
- x=3;y=7;
- nrow = size(SolutionMap,1);
- ncol = size(SolutionMap,2);
- while ~isequal(SolutionMap(x,y),SearchGoal)
- if SearchGoal(1) > CurrPos(1);x = x + 1;
- end
- if SearchGoal(1) < CurrPos(1);x = x - 1;
- end
- if SearchGoal(2) > CurrPos(2);y = y + 1;
- end
- if SearchGoal(2) < CurrPos(2);y = y - 1;
- end
- idx = sub2ind([nrow, ncol], x, y);
- candidates = [];
- if x > 1; candidates = [candidates, idx - 1]; end;%(x-1,y)
- [candidates, idx - 1];
- if x < nrow; candidates = [candidates, idx + 1]; end %(x+1, y)
- [candidates, idx + 1];
- if y > 1; candidates = [candidates, idx - nrow]; end %(x, y-1)
- [candidates, idx - nrow];
- if y < ncol; candidates = [candidates, idx + nrow]; end %(x, y+1)
- [candidates, idx + nrow];
- [least, whichleast] = min( SolutionMap(candidates) );
- [newx, newy] = ind2sub([nrow, ncol], candidates(whichleast));
- x = newx;
- y = newy;
- end
- %[newx, newy]
- % visualize the solution map (g values)
- imagesc(SolutionMap)
- set(gca,'dataAspectRatio',[1 1 1])
- It does not check that the current node is eligible for expansion (the expand routine is not intended to do that in the algorithm). This would result in incorrect paths
- the algorithm does not give any clue as to how to create the solution map
- Potential nodes are checked for being closed at the time of expand(), but are not checked when they become current. Nodes can end up being closed after queuing if they become current and are found to be blocked; and whether or not they are found to be blocked, the algorithm defines that they get queued as closed when they become current. Because of this algorithm set-up, a node can end up queued twice. It is inefficient to expand the same node twice. The algorithm should either re-check for closed when a node becomes current or else it should avoid entering anything into the queue when it is already in the queue.
Vedere anche
Categorie
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia-Pacifico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)