This repository provides a ROS interface for the TFLuna 1D LiDAR sensor using an Arduino board. The interface allows you to connect the LiDAR to your ROS-Noetic system and visualize the sensor data using the RQT graphical tool.
- Connect the TFLuna 1D LiDAR sensor to the Arduino board using the TX and RX pins.
- Establish a serial communication between the Arduino and the host PC.
- Upload the Arduino script provided in this repository to the Arduino board.
- Before uploading, ensure that you check the port name and baud rate in the Arduino script and modify them according to your system's configuration.
-
Run the Python script in a terminal using the following command:
python python_file_name.py
Make sure to replace
python_file_name.py
with the actual name of the Python script. -
Before running the script, check the port number and baud rate in the Python script, and ensure that they match the configuration in the Arduino code.
-
Make the Python script executable by running the following command:
chmod +x python_file_name.py
Again, replace
python_file_name.py
with the actual name of the Python script.
-
After executing the Python script in the terminal, the LiDAR sensor data will be published as a
lidar_distance
node. -
To verify the published topic, open a separate terminal and run the following command:
rostopic list
The topic you are looking for should be
/lidar_distance
. You can modify the topic name in the Python script if desired. -
To observe the messages published on the
/lidar_distance
topic, use the command:rostopic echo /lidar_distance
- Open the RQT graphical tool on your ROS-Noetic system.
- Look for the
lidar_distance
topic in the list of available topics. - Select the
lidar_distance
topic to visualize the sensor data provided by the TFLuna 1D LiDAR.
Feel free to customize the code and topic names to suit your specific requirements. For any further assistance or inquiries, please don't hesitate to contact me.