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

[ROS-O] drop deprecated use of boost _1, _2 #239

Open
wants to merge 1 commit into
base: noetic-devel
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
4 changes: 2 additions & 2 deletions sr_hand/include/sr_hand/sr_subscriber.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010 Shadow Robot Company Ltd.
* Copyright 2010, 2024 Shadow Robot Company Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -101,7 +101,7 @@ class SRSubscriber
* @param msg the target in radians
* @param joint_name name of the joint we're sending the command to
*/
void cmd_callback(const std_msgs::Float64ConstPtr &msg, std::string &joint_name);
void cmd_callback(const std_msgs::Float64ConstPtr &msg, const std::string &joint_name);

/// The vector of subscribers to the different joint topics.
std::vector<Subscriber> controllers_sub;
Expand Down
7 changes: 4 additions & 3 deletions sr_hand/src/sr_subscriber.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010 Shadow Robot Company Ltd.
* Copyright 2010, 2024 Shadow Robot Company Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -81,9 +81,10 @@ namespace shadowrobot
for (SRArticulatedRobot::JointsMap::iterator joint = sr_articulated_robot->joints_map.begin();
joint != sr_articulated_robot->joints_map.end(); ++joint)
{
std::string joint_name{ joint->first };
controllers_sub.push_back(node.subscribe<std_msgs::Float64>(
"sh_" + boost::to_lower_copy(joint->first + "_position_controller/command"), 2,
boost::bind(&SRSubscriber::cmd_callback, this, _1, joint->first)));
[this, joint_name](auto msg) { cmd_callback(msg, joint_name); }));
}
}

Expand All @@ -110,7 +111,7 @@ namespace shadowrobot
}
}

void SRSubscriber::cmd_callback(const std_msgs::Float64ConstPtr &msg, std::string &joint_name)
void SRSubscriber::cmd_callback(const std_msgs::Float64ConstPtr &msg, const std::string &joint_name)
{
// converting to degrees as the old can interface was expecting degrees
sr_articulated_robot->sendupdate(joint_name, sr_math_utils::to_degrees(msg->data));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011 Shadow Robot Company Ltd.
* Copyright 2011, 2024 Shadow Robot Company Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -140,8 +140,7 @@ namespace shadowrobot
nh_tilde("~"), use_sendupdate(false)
{
action_server = boost::shared_ptr<JTAS>(new JTAS("/r_arm_controller/joint_trajectory_action",
boost::bind(&JointTrajectoryActionController::execute_trajectory,
this, _1),
[this](auto msg){ execute_trajectory(msg); },
false));
std::vector<std::string> joint_labels;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2011 Shadow Robot Company Ltd.
* Copyright 2011, 2024 Shadow Robot Company Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -38,7 +38,7 @@ namespace shadowrobot
{
action_server = boost::shared_ptr<JTAS>(
new JTAS("/r_arm_controller/joint_trajectory_action",
boost::bind(&JointTrajectoryActionController::execute_trajectory, this, _1),
[this](auto msg){ execute_trajectory(msg); },
false));

// Create a map of joint names to their command publishers
Expand Down
2 changes: 1 addition & 1 deletion sr_tactile_sensors/package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2022 Shadow Robot Company Ltd.
Copyright 2022, 2024 Shadow Robot Company Ltd.
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation version 2 of the License.
Expand Down