Robotics StackExchange | Archived questions

ROS & MatlabSimulink vs LIDAR

Hello,

I am getting acquainted with the operation of the ROS environment and I was very interested in the project called turtlebot3. It allows me to simulate a robot with a lidar sensor and visualizations of this process in RVIZ. I would now like to download information about the lidar readings in order to develop a robot positioning algorithm between the table legs in the matlab.

Unfortunately, despite the fact that the message / scan contains 360 items, Matlab allows reading only 128 items, which limits the reading angle of lidar to 128 degrees.

How can you fix it? I attach the screenshots in links:

Greetings, Piotr

image description

image description

Terminal output


Update

We have 360 ​​readings in the rostopic echo. You can see four places where the readings are different from zero / inf. The readings match because the robot is between the table legs. Unfortunately, Matlab limits the angle to 128 readings, which means that only one leg of the table is visible.

Besides the simple model in simulink, I do not use any matlab functions (only rosinite).

Asked by Piotr on 2018-12-22 15:21:27 UTC

Comments

Could you please attach your images directly to the post? I've given you sufficient karma for that.

Asked by gvdhoorn on 2018-12-22 15:58:46 UTC

Done. Thank you.

Asked by Piotr on 2018-12-22 16:39:33 UTC

@Piotr I've edited your question so that the images show up directly without having to follow a link, except for the screen shot of the text. Can you please update your question with a copy & paste of the text instead of an image?

Asked by jayess on 2018-12-22 22:05:03 UTC

Now is ok? ;)

Asked by Piotr on 2018-12-23 02:27:02 UTC

I've just had a look at the rostopic echo output, and that scan contains just under 200 samples not 360. Can you show us the matlab code you're using because we won't be able to help you otherwise.

Asked by PeteBlackerThe3rd on 2018-12-23 20:21:44 UTC

The post has been updated

Asked by Piotr on 2018-12-24 04:21:30 UTC

Hello, Did you find a solution for this? I am facing the same issue

Asked by Firas on 2019-11-20 09:55:01 UTC

Hi,

the answer is: Tools -> Robot Operating System -> Manage Array Sizes

you need to change the value from 128 to 360

Asked by Piotr on 2019-11-24 16:17:35 UTC

Answers

In case someone is still facing this issue, Matlab explains how to change the limits imposed on variable string messages under the following link (Work with ROS Messages in Simulink®):

https://nl.mathworks.com/help/ros/ug/work-with-ros-messages-in-simulink.html#WorkWithROSMessagesInSimulinkExample-11

The issue which remains is that sometimes you don't have the ROS Toolbox part under the simulation tab. If this is the case, go to APPS and click on Robot Operating System (ROS) to connect your model to ROS. The ROS Toolbox section should now appear under simulation.

Asked by Firas on 2019-11-20 10:12:10 UTC

Comments