diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 00000000..6a9b34ca --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,22 @@ +{ + "configurations": [ + { + "browse": { + "databaseFilename": "${default}", + "limitSymbolsToIncludedHeaders": false + }, + "includePath": [ + "/home/brian/rplidar_ws/install/rplidar_ros/include/**", + "/opt/ros/humble/include/**", + "/home/brian/rplidar_ws/src/rplidar_ros/include/**", + "/usr/include/**" + ], + "name": "ROS", + "intelliSenseMode": "gcc-x64", + "compilerPath": "/usr/bin/gcc", + "cStandard": "gnu11", + "cppStandard": "c++14" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..11eadcd7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,14 @@ +{ + "ros.distro": "humble", + "python.autoComplete.extraPaths": [ + "/opt/ros/humble/lib/python3.10/site-packages", + "/opt/ros/humble/local/lib/python3.10/dist-packages" + ], + "python.analysis.extraPaths": [ + "/opt/ros/humble/lib/python3.10/site-packages", + "/opt/ros/humble/local/lib/python3.10/dist-packages" + ], + "files.associations": { + "functional": "cpp" + } +} \ No newline at end of file diff --git a/include/rplidar_node.hpp b/include/rplidar_node.hpp index d2a1bd4f..81dabb0f 100644 --- a/include/rplidar_node.hpp +++ b/include/rplidar_node.hpp @@ -31,6 +31,7 @@ #define RPLIDAR_NODE_HPP_ #include +#include #include #include #include diff --git a/src/rplidar_node.cpp b/src/rplidar_node.cpp index c1284bcf..64c66a6d 100644 --- a/src/rplidar_node.cpp +++ b/src/rplidar_node.cpp @@ -33,7 +33,7 @@ * */ -#include +#include "rplidar_node.hpp" namespace rplidar_ros { @@ -112,7 +112,8 @@ rplidar_node::rplidar_node(const rclcpp::NodeOptions & options) /* done setting up RPLIDAR stuff, now set up ROS 2 stuff */ /* create the publisher for "/scan" */ - m_publisher = this->create_publisher(topic_name_, 10); + rclcpp::QoS scan_qos(rclcpp::KeepLast(5),rmw_qos_profile_sensor_data); + m_publisher = this->create_publisher(topic_name_, scan_qos); /* create stop motor service */ m_stop_motor_service = this->create_service(