Monday, June 28, 2010

SetFwdVelocity

SetFwdVelocity

This is a function that comes with the Create tool box.  My code looks like this.



comm = strcat('COM', num2str(8));
a = instrfind('port',comm);
[serialObject] = RoombaInit(8) ;
%initialize the port
pause (10)
%wait for 10 sec --time to set the robot on the floor properly. just in case. :)
SetFwdVelRadiusRoomba(serialObject,0.1,1);
% setting the robot with fwd vel of 0.1m/s and turning radius of 2m/s
pause(10)
% wait for another 10 seconds ie run for 10 seconds
SetFwdVelRadiusRoomba(serialObject,0,2);
% setting the robot with fwd vel of 0m/s and turning radius of 2m/s..well ang vel doesnt matter anyway. 
% aka Stop
[Distance] = DistanceSensorRoomba(serialObject);
% reads the distance the robot has travelled since the last reading. 


The problems with this experiment is the distance read from the sensor never actually was in agreement with the expected results. There was always an error between the actual distance and expected distance and always, the actual distance is lesser. 


Also,  an interesting observation is that running this program over and over again, made the error lesser and lesser but it resets back to the same error after 5 or 6 runs. 


Could not find a solution for this except for using another function. 

No comments:

Post a Comment