Borrar filtros
Borrar filtros

Condition inside animation loop

1 visualización (últimos 30 días)
mohammed alany
mohammed alany el 8 de Mayo de 2019
if i have animation part inside loop like below
%% animation part
while( distanceToGoal > goalRadius )
[v, omega] = step(controller, robot.CurrentPose);
drive(robot, v, omega)
robotCurrentLocation = robot.CurrentPose(1:2)
distanceToGoal = norm(robotCurrentLocation - robotGoal);
end
during execute the above code, the simulation give me the current position of robot.
i would like to put the below code
for i = 1 : 5
rN = rand;
pause(2)
disp(['rN = ' num2str(rN)])
if rN > 0.8
end
end
inside the animation part, so each two seconde it will give me different random values,
if rN > 0.8 i need stop the robot
any help please

Respuestas (0)

Categorías

Más información sobre Animation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by