Lukket

edit this matlab code: max $50

%% this code is suppose to is be able to detect an obstacle, stop in front of obstacle, go pass by the obstacle

if ismember([url removed, login to view], rostopic('list'))

laser_sub = rossubscriber('/scan');

end

if ismember([url removed, login to view], rostopic('list'))

velocity_pub = rospublisher([url removed, login to view],'geometry_msgs/Twist');

% velocity_sub = rossubscriber('cmd_vel', 'geometry_msgs/Twist');

end

velocity_msg = rosmessage(velocity_pub);

% Set some parameters that will be used in the processing loop.

% You can modify these values for different behavior.

spinVelocity = 0.6; % Angular velocity (rad/s)

forwardVelocity = 0.2; % Linear velocity (m/s)

backwardVelocity = -0.6; % Linear velocity (reverse) (m/s)

distanceThreshold = .6; % Distance threshold (m) for turning

% Run a loop to move the robot forward and compute the closest obstacles

%to

% the robot. When an obstacle is within the limits of the

%distanceThreshold,

% the robot turns. This loop stops after 20 seconds of run time.

% CTRL+C (or Control+C on the Mac) also stops this loop.

tic;

while toc < 20

% Collect information from laser scan

scan_data = receive(laser_sub,1);

plot(scan_data);

data = readCartesian(scan_data);

x = data(:,1);

y = data(:,2);

% Compute distance of the closest obstacle

dist = sqrt(x.^2 + y.^2);

minDist = min(dist);

% Command robot action

scan_data = receive(laser_sub);

if minDist < distanceThreshold

% If close to obstacle, back up slightly and spin

velocity_msg.Linear.X = backwardVelocity;

velocity_msg.Angular.Z = spinVelocity;

velocity_msg.Linear.X=forwardVelocity;

velocity_msg.Angular.Z = -spinVelocity;

velocity_msg.Linear.X=forwardVelocity;

else

% Continue on forward path

velocity_msg.Linear.X = forwardVelocity;

velocity_msg.Angular.Z = 0;

end

send(velocity_pub, velocity_msg);

end

% let TurtleBot stop before disconnect from it

velocity_msg.Angular.Z = 0.0;

velocity_msg.Linear.X = 0.0;

send(velocity_pub, velocity_msg);

Evner: Matlab and Mathematica

Se mere: stochastic inventory control matlab code, genetic algorithm control fuzzy logic matlab code, motor control matlab code, fuzzy control matlab code, inventory control matlab code, control cart pole balancing fuzzy logic matlab code, fuzzy control project matlab code, fuzzy control inverted pendulum matlab code, matlab code plot graph, digital image processing matlab code, matlab code repeating bits, matlab code point vortex, matlab code database, signature recognition matlab code, outsource matlab code, convert matlab code, conv matlab code, expectation maximization matlab code, matlab code conversion, running matlab code fortran, converting matlab code, point vortex matlab code, sample code using microsoft internet transfer control vb6, matlab code hsdpa

Om arbejdsgiveren:
( 0 bedømmelser ) United States

Projekt ID: #16706875

10 freelancere byder i gennemsnit $92 på dette job

liveexperts123

A proposal has not yet been provided

$155 USD in 5 dage
(52 bedømmelser)
6.8
davidngo817

Hello, dear. I am interested in your project. I have extensive experience in Matlab. As I am a developer with rich experience, I am confident in your project. I will provide the perfect result on time. Please feel Flere

$150 USD in 3 dage
(24 bedømmelser)
5.6
uzairrzahid

Hi. My name is Uzair. I am in final semester of my masters in Electrical Engineering. I am doing my thesis in biomedical signal processing and Machine learning. I have more than 3 years of experience in MATLAB special Flere

$55 USD in 3 dage
(11 bedømmelser)
4.0
$120 USD in 3 dage
(5 bedømmelser)
3.6
olaideejiwole

I have high proficiency in Matlab , SPSS Statistics, Simulation, Mathematics, Python,Algorithm, C programming, Machine learning and Statistics analysis. Once you share the project, I will have a look & confirm if I can Flere

$60 USD på 1 dag
(5 bedømmelser)
2.7
mahmoud0ayman

I realized that this code is subscribing to ros laser scan msg I have very good experience in matlab and ros and I am sure I can help you

$30 USD in 3 dage
(1 bedømmelse)
1.5
$155 USD in 3 dage
(3 bedømmelser)
3.3
mouradzaied

I'm Expert in IA, image processing and computer vision for more 20 years. For more details see my publications: [login to view URL]

$111 USD in 3 dage
(1 bedømmelse)
0.8
sourindu

Hey I am an expert electrical engineer. I have done several projects with matlab. So please ping me up with more details so that we can get this done asap.

$55 USD på 1 dag
(0 bedømmelser)
0.0
OmarElGeddawy

Hi, I am Omar. I have been working with MATLAB for more than two years now with many projects in a variety of different fields, for sure control of small mobile robots was one of them, I can help you solve this error. Flere

$30 USD på 1 dag
(0 bedømmelser)
0.0