ENSTABretagneRobotics / Hardware-MATLAB

8 stars 2 forks source link

HOW TO USE RPLIDAR S2 IN MATLAB? #9

Closed ohsekang closed 1 year ago

ohsekang commented 1 year ago

I had used rplidar a1m8 and below code worked well .

now I'm trying to use rplidar s2m1.

rplidar s2 didn't worked in this code and I got result value 1 (value 1 means lidar is not connected with MATLAB)

As I know there are few data about connecting lidar S2M1 to MATLAB.

Do you have any solution about this situation?

hardwarex_init; pRPLIDAR = CreateRPLIDAR();

% Check and modify the configuration file if needed... [result] = ConnectRPLIDAR(pRPLIDAR, 'RPLIDAR0.txt')

lebarsfa commented 1 year ago

Hello, I don't have the device nor much time to investigate right now. However here are some ideas :

If things get too complicated, another completely different approach (which I never tested, it might be not that simple...) could be to try ROS or ROS2 toolbox, see https://fr.mathworks.com/help/ros/index.html , https://github.com/Slamtec/rplidar_ros , https://fr.mathworks.com/help/ros/ug/work-with-specialized-ros-messages.html#WorkWithSpecializedROSMessagesExample-8 . Here also you might need to determine which version of ROS works with your LIDARs, possibly ROS1 Noetic...