From 7a10670493bbd0df92b07d0602ee07bb29f80aa7 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Mon, 28 Aug 2023 12:38:58 -0400 Subject: [PATCH] Remove unnecessary captures in the various demos. (#647) This was pointed out by building with clang. Signed-off-by: Chris Lalancette --- demo_nodes_cpp/src/parameters/set_parameters_callback.cpp | 4 ++-- demo_nodes_cpp/src/services/introspection_client.cpp | 2 +- demo_nodes_cpp/src/services/introspection_service.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo_nodes_cpp/src/parameters/set_parameters_callback.cpp b/demo_nodes_cpp/src/parameters/set_parameters_callback.cpp index eaf47a43d..6be64e6ea 100644 --- a/demo_nodes_cpp/src/parameters/set_parameters_callback.cpp +++ b/demo_nodes_cpp/src/parameters/set_parameters_callback.cpp @@ -47,7 +47,7 @@ class SetParametersCallback : public rclcpp::Node // setting another parameter from the callback is possible // we expect the callback to be called for param2 auto pre_set_parameter_callback = - [this](std::vector & parameters) { + [](std::vector & parameters) { for (auto & param : parameters) { // if "param1" is being set try setting "param2" as well. if (param.get_name() == "param1") { @@ -58,7 +58,7 @@ class SetParametersCallback : public rclcpp::Node // validation callback auto on_set_parameter_callback = - [this](std::vector parameters) { + [](std::vector parameters) { rcl_interfaces::msg::SetParametersResult result; result.successful = true; diff --git a/demo_nodes_cpp/src/services/introspection_client.cpp b/demo_nodes_cpp/src/services/introspection_client.cpp index 4da953121..53ca3457f 100644 --- a/demo_nodes_cpp/src/services/introspection_client.cpp +++ b/demo_nodes_cpp/src/services/introspection_client.cpp @@ -70,7 +70,7 @@ class IntrospectionClientNode : public rclcpp::Node client_ = create_client("add_two_ints"); auto on_set_parameter_callback = - [this](std::vector parameters) { + [](std::vector parameters) { rcl_interfaces::msg::SetParametersResult result; result.successful = true; for (const rclcpp::Parameter & param : parameters) { diff --git a/demo_nodes_cpp/src/services/introspection_service.cpp b/demo_nodes_cpp/src/services/introspection_service.cpp index 5c6888398..d258d4720 100644 --- a/demo_nodes_cpp/src/services/introspection_service.cpp +++ b/demo_nodes_cpp/src/services/introspection_service.cpp @@ -80,7 +80,7 @@ class IntrospectionServiceNode : public rclcpp::Node srv_ = create_service("add_two_ints", handle_add_two_ints); auto on_set_parameter_callback = - [this](std::vector parameters) { + [](std::vector parameters) { rcl_interfaces::msg::SetParametersResult result; result.successful = true; for (const rclcpp::Parameter & param : parameters) {