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