I have a Raspberry Pi 4 running Ubuntu 22.04 with ros2 humble. My laptop is running Ubuntu 20.04 with ros1 noetic. I have connected a Slamtec RPLIDAR A3 with my Raspberry Pi and want to view its laser scan in RViz. I have added their ros2 packages for my Raspberry Pi board. the launch file in the package opens the rviz2 in the Raspberry Pi, but there is no display connected to my Raspberry Pi.
Can I view the laser scan readings from my raspberry pi using my laptops Rviz? Thank you for your time.
To answer your question strictly how it was asked, no you cannot directly use your laptop's Rviz with a default ROS install. This is because ROS1 and ROS2 cannot directly communicate. If you really want to use your laptop's Rviz install you'll need to install and run the ros2 bridge. I'd note that this will add overhead and complexity to your project that you most likely do not want.
The more simple solution is do to what Mark suggested in his comment. Download an X11 server, ssh into the Pi, export DISPLAY=localhost:0
, then run the Pi's Rviz.