Hello everyone !
I work on two-wheels robot mobile project. One part of the project is making a visualization of trajectory like a plot in Matlab. The plot shows how robot ride along black line in line follower mode and it is scalled to centimeters. The problem is with coordinate Y. In reality Y oscillate between 0-3 cm but plot shows even 20 cm. Do you know maybe how to deal with this inaccuracy ?
this link contains excel file with encoders values https://megawrzuta.pl/download/2c94ed93d2e8675ba2388cecff7bc53e.html

댓글 수: 5

Talat Buyukakin
Talat Buyukakin 2017년 10월 11일
Hello Adam, The link you give above can not be open because of deleted or missing. Can you please mail me encoder values that you have worked with. I'm working on kind of this project. talatb.akin@hotmail.com Thank You
Walter Roberson
Walter Roberson 2017년 10월 11일
편집: Walter Roberson 2017년 10월 11일
Talat: note that Adam will not have been notified about your comment.
I happened to have downloaded the file while testing the code. I have attached it.
Talat Buyukakin
Talat Buyukakin 2017년 10월 12일
편집: Talat Buyukakin 2017년 10월 12일
Walter:Thank you so much for your help. I download it.
Adam Stepniak
Adam Stepniak 2017년 10월 12일
Walter was faster ;), good luck with your project Talat.
Talat Buyukakin
Talat Buyukakin 2017년 10월 12일
Thank you too Adam :)

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

 채택된 답변

Walter Roberson
Walter Roberson 2017년 3월 2일

0 개 추천

It is difficult for us to test with a picture of code, so I typed it in, but skipped the comments.
Your alfa (angle) has been calculated based upon difference in linear distance traveled, rather than based upon angular distance traveled. When I divided alfa by R to get angular distance, the results looked plausible.
modified version that looks plausible:
filename='encoders.xlsx';
encoders=xlsread(filename);
el=encoders(:,1);
er=encoders(:,2);
R=3.25;
L=16;
n=192;
dr=er.*((2*pi*R)/n);
dl=el.*((2*pi*R)/n);
d=(dr+dl)/2;
alfa=(dr-dl)/L/R;
c=cos(alfa);
s=sin(alfa);
x=d.*c;
y=d.*s;
plot(x,y);
title('trajectory');
xlabel('X')
ylabel('Y')
axis([0 200 -50 50])
hold on
grid on

댓글 수: 1

Adam Stepniak
Adam Stepniak 2017년 3월 9일
Thank you for fast resposnse, in fact the plot shows more realistic results in case of following straight line.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기

질문:

2017년 3월 2일

댓글:

2017년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by