Skip to content

Commit

Permalink
Make reference_wrapper argument const
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 24, 2023
1 parent 7f6ebb9 commit 6f67f65
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,20 +309,17 @@ class JointTrajectoryController : public controller_interface::ControllerInterfa
void resize_joint_trajectory_point_command(
trajectory_msgs::msg::JointTrajectoryPoint & point, size_t size);

// TODO(anyone): can I here also use const on joint_interface since the reference_wrapper is not
// changed, but its value only?
// TODO(anyone): Use auto in parameter declaration with c++20

/**
* @brief Assigns the values from a trajectory point interface to a joint interface.
*
* @tparam T The type of the joint interface.
* @param[out] joint_interface The reference_wrapper to assign the values to
* @param[in] trajectory_point_interface Containing the values to assign.
* @todo: Use auto in parameter declaration with c++20
*/
template <typename T>
void assign_interface_from_point(
T & joint_interface, const std::vector<double> & trajectory_point_interface)
const T & joint_interface, const std::vector<double> & trajectory_point_interface)
{
for (size_t index = 0; index < dof_; ++index)
{
Expand Down

0 comments on commit 6f67f65

Please sign in to comment.