A2M8 RP Lidar Connecting to Simulink with ROS2 on a Raspberry Pi

Hi,

I have an A2M8 RP Lidar connected to a raspberry pi through USB and I’m trying to publish the /scan topic using ROS 2 and display the resulting scan in Simulink to create a map. What drivers/packages/plugins should I use to accomplish this?

I have tried using ROS Melodic with the package found here https://github.com/Slamtec/rplidar_ros which allowed me to launch the lidar and successfully see that the topic is being published but when I try to subscribe to the topic in Simulink it doesn’t work. I get an error that “Code generation information file does not exist”. Ideally, I would like to get it working using ROS2 anyway.

I would also like to be able to simulate the lidar in Gazebo.

Thanks for your help.

Hello @RobotInfo and welcome to the RobotShop community,

The branch for ROS2 (Rolling Ridley) is here:

https://www.mathworks.com/help/ros/ug/publish-and-subscribe-to-ros-2-messages-in-simulink.html

I hope that helps!