Skip to content

Commit

Permalink
Remove unnecessary captures in the various demos. (#647)
Browse files Browse the repository at this point in the history
This was pointed out by building with clang.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Aug 28, 2023
1 parent 02dcd2b commit 7a10670
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo_nodes_cpp/src/parameters/set_parameters_callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<rclcpp::Parameter> & parameters) {
[](std::vector<rclcpp::Parameter> & parameters) {
for (auto & param : parameters) {
// if "param1" is being set try setting "param2" as well.
if (param.get_name() == "param1") {
Expand All @@ -58,7 +58,7 @@ class SetParametersCallback : public rclcpp::Node

// validation callback
auto on_set_parameter_callback =
[this](std::vector<rclcpp::Parameter> parameters) {
[](std::vector<rclcpp::Parameter> parameters) {
rcl_interfaces::msg::SetParametersResult result;
result.successful = true;

Expand Down
2 changes: 1 addition & 1 deletion demo_nodes_cpp/src/services/introspection_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class IntrospectionClientNode : public rclcpp::Node
client_ = create_client<example_interfaces::srv::AddTwoInts>("add_two_ints");

auto on_set_parameter_callback =
[this](std::vector<rclcpp::Parameter> parameters) {
[](std::vector<rclcpp::Parameter> parameters) {
rcl_interfaces::msg::SetParametersResult result;
result.successful = true;
for (const rclcpp::Parameter & param : parameters) {
Expand Down
2 changes: 1 addition & 1 deletion demo_nodes_cpp/src/services/introspection_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class IntrospectionServiceNode : public rclcpp::Node
srv_ = create_service<example_interfaces::srv::AddTwoInts>("add_two_ints", handle_add_two_ints);

auto on_set_parameter_callback =
[this](std::vector<rclcpp::Parameter> parameters) {
[](std::vector<rclcpp::Parameter> parameters) {
rcl_interfaces::msg::SetParametersResult result;
result.successful = true;
for (const rclcpp::Parameter & param : parameters) {
Expand Down

0 comments on commit 7a10670

Please sign in to comment.