Why do the TurtleBot examples "Obstacle Avoidance using TurtleBot" and “Controlling the TurtleBot with Teleoperation” not work as expected?

Why does the map visualization look incorrect in the "Obstacle Avoidance using TurtleBot" and “Controlling the TurtleBot with Teleoperation” examples (it looks like it’s rotated by 90 degrees)? Also, why does the robot collide with the obstacles in the "Obstacle Avoidance using TurtleBot" example?

 채택된 답변

This is a known bug in MATLAB R2015a. As a workaround, you have to edit some files in the following location:
<matlabroot>\toolbox\robotics\robotexamples\ros\helpers\
Please replace “<matlabroot>” with the actual path of your MATLAB installation. It can be found by typing the following command at the MATLAB command prompt,
>> matlabroot
You need to change three files:
1) Line 272 in ExampleHelperTurtleBotCommunicator.m
2) Line 117 in exampleHelperTurtleBotObstacleTimer.m
3) Line 20 in exampleHelperTurtleBotShowGrid.m
On the mentioned lines, multiply the output from the readCartesian function with a matrix ([0 1; -1 0]). This will change the orientation of the laser scan to match the expectation of the example code.
For example,
>> readCartesian(message);
Should be changed to,
>> readCartesian(message) * [0 1; -1 0];
Save these files after the above changes. You may need administrative privileges to save the modified files. Use the REHASH command to force MATLAB to update the toolbox cache file:
>> rehash toolboxcache

추가 답변 (0개)

카테고리

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

제품

릴리스

R2015a

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by