Dynamic Obstacle in matlab environment

조회 수: 24 (최근 30일)
Maria
Maria 2014년 2월 10일
댓글: Ruqaiya Attaullah 2020년 4월 22일
if i have a obstacle (represented as (x,y)) in the mobile robot environment by using matlab , how can i make that obstacle move randomly with dynamic speed .
  댓글 수: 3
Maria
Maria 2014년 2월 11일
yes , changing velocity , that is what i meant.
Auday
Auday 2014년 6월 16일
Dear all I have two objects with original and destination positions as in below; how I can make them move using rand function, please
%// Define rectangle values origin_x1 = [9.5 9.5 11.5 11.5 ]; origin_y1 = [12.6 14.6 14.6 12.6]; destination_x1 = origin_x1 + 3; destination_y1 = origin_y1 + 2;
%// Define circle values r = 1; v = linspace(0,2*pi); origin_x2 = 15+r*cos(v); origin_y2 = 10+r*sin(v); destination_x2 = origin_x2 - 1; destination_y2 = origin_y2 + 3;

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 10일
x = x + rand() * max_x;
y = y + rand() * max_y;
or
theta = rand() * 2 * pi;
r = rand() * max_velecity;
[deltax, deltay] = pol2cart(r, theta);
x = x + deltax;
y = y + deltay;
  댓글 수: 2
Maria
Maria 2014년 2월 11일
Many thanks to you Walter, I will check that code .
passioncoding
passioncoding 2019년 1월 2일
did this code work?
I am doing same thing I need information

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Mischa Kim
Mischa Kim 2014년 2월 10일
I strongly recommend not to "randomize" the position vector since this results in a non-differentiable function. Start with acceleration and work your way back to position by integration. This way you'll at least end up with a solid kinematics system. If you even need to go a step further you have to make sure that the kinetics is compatible, as well.
function rand_mov()
tspan = 0:0.01:5;
X0 = [0 0 0 0];
[T, Xsol] = ode45(@EOM, tspan, X0);
figure
subplot(2,1,1)
plot(T, Xsol(:,1),T, Xsol(:,2))
title('x and vx vs. t')
subplot(2,1,2)
plot(Xsol(:,1), Xsol(:,3))
title('x vs. y')
end
function dX = EOM(t, X)
dX = zeros(4,1);
da = 1;
x = X(1);
vx = X(2);
y = X(3);
vy = X(4);
dX = [vx; da*(rand()-0.5); vy; da*(rand()-0.5)];
end
  댓글 수: 5
Mudasser  Wahab
Mudasser Wahab 2014년 8월 18일
Hey can you help me with a problem. How can I simulate a static obstacle?
I have the kinematic model of a differential drive robot. I have been able to navigate it from one point to another in an obstacle free environment. Now I want to insert a static obstacle and ovoid them using obstacle avoidance techniques.
The problem is I don't know How to simulate an obstacle in simulink.
Ruqaiya Attaullah
Ruqaiya Attaullah 2020년 4월 22일
Mudasser Wahab can you please help me in navigating the robot from one point to another. I am having trouble with that.

댓글을 달려면 로그인하십시오.


Maria
Maria 2014년 2월 11일
Many thanks to you Mischa , now i got it , if i am not wrong that without differentiable function formula i would not could be enabled to sense the velocity and acceleration of the obstacle since my algorithm required that i should compute the the velocity of moving obstacles to compute the relative speed between robot and obstacle , so to here good , but i hope to not be greedy if asked you to give more explanation about the code above because it is not so clear , it need some comments.
thanks

카테고리

Help CenterFile Exchange에서 Robotics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by