Ahora está siguiendo esta pregunta
- Verá actualizaciones en las notificaciones de contenido en seguimiento.
- Podrá recibir correos electrónicos, en función de las preferencias de comunicación que haya establecido.
ROBOT LOCALIZATION AND MOTION PLANNING
3 comentarios
- 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;
Respuesta aceptada
7 comentarios
Más respuestas (1)
115 comentarios
- 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.
Ver también
Categorías
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Se ha producido un error
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- 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-Pacífico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)