Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
ROBOT LOCALIZATION AND MOTION PLANNING
3 commentaires
- 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;
Réponse acceptée
7 commentaires
Plus de réponses (1)
115 commentaires
- 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.
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)