Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sensor data qos to laser scan publisher #36

Open
wants to merge 1 commit into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ros.distro": "humble",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was added by accident? Could you please remove the extra files?

"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"
}
}
1 change: 1 addition & 0 deletions include/rplidar_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define RPLIDAR_NODE_HPP_

#include <rclcpp/clock.hpp>
#include <rclcpp/qos.hpp>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp/time.hpp>
#include <rclcpp/time_source.hpp>
Expand Down
5 changes: 3 additions & 2 deletions src/rplidar_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
*/

#include <rplidar_node.hpp>
#include "rplidar_node.hpp"

namespace rplidar_ros
{
Expand Down Expand Up @@ -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<LaserScan>(topic_name_, 10);
rclcpp::QoS scan_qos(rclcpp::KeepLast(5),rmw_qos_profile_sensor_data);
m_publisher = this->create_publisher<LaserScan>(topic_name_, scan_qos);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about making this the default. This would break existing behavior (as subscriptions would also need to be updated).

Could we add this as a parameter instead?


/* create stop motor service */
m_stop_motor_service = this->create_service<std_srvs::srv::Empty>(
Expand Down