Skip to content

colcon build error #147

Open
Open
@XZ-Niupitang

Description

@XZ-Niupitang
/ROS/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:200:5: error: no match for ‘operator=’ (operand types are ‘rclcpp_action::Client<turtlesim::action::RotateAbsolute>::GoalResponseCallback’ {aka ‘std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>’} and ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’)
  200 |     };
      |     ^

After the error is reported here, teleop_turtle_key.cpp is canceled the sendGoal () function in the compilation is normal, what is the problem?

void TeleopTurtle::sendGoal(float theta)
{
  auto goal = turtlesim::action::RotateAbsolute::Goal();
  goal.theta = theta;
  auto send_goal_options = rclcpp_action::Client<turtlesim::action::RotateAbsolute>::SendGoalOptions();
  // send_goal_options.goal_response_callback =
  //   [this](std::shared_future<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute>::SharedPtr> future)
  //   {
  //     RCLCPP_DEBUG(nh_->get_logger(), "Goal response received");
  //     this->goal_handle_ = future.get();
  //   };
  rotate_absolute_client_->async_send_goal(goal, send_goal_options);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions