Skip to content

Commit

Permalink
drop deprecated use of boost _1, _2
Browse files Browse the repository at this point in the history
The symbols have always been used through implicit includes from
ros_comm, but ROS-O considers changing these includes right now because
of excessive deprecation warnings building all of ROS.
ros-o/ros_comm#3
  • Loading branch information
v4hn committed Aug 6, 2024
1 parent af2f341 commit 7d6c12d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sr_hand/include/sr_hand/sr_subscriber.h
Original file line number Diff line number Diff line change
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
5 changes: 3 additions & 2 deletions sr_hand/src/sr_subscriber.cpp
Original file line number Diff line number Diff line change
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
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
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

0 comments on commit 7d6c12d

Please sign in to comment.