ros / ros_tutorials

Code used in tutorials found on ROS wiki
http://wiki.ros.org/ros_tutorials
787 stars 537 forks source link

Error in teleop_turtle_key.cpp "E0349 no operator "=" matches these operands" #135

Open mattgpaul opened 2 years ago

mattgpaul commented 2 years ago

Was having failures with colcon build --merge-install for the tutorial workspace build. After finding the source of the first error that shows up under inspection, the error appears in the file of the title, on line 318. I pulled this from the repo, is there any fix to this? This error is causing the colcon build to fail.

tlalexander commented 2 years ago

I get this error too. It looks like the error has moved to line 323:

/home/taylor/Software/dev_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:323:7: error: no match for ‘operator=’ (operand types are ‘rclcpp_action::Client<turtlesim::action::RotateAbsolute>::GoalResponseCallback’ {aka ‘std::function<void(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’} and ‘TeleopTurtle::sendGoal(float)::<lambda(rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute>::SharedPtr)>’)
  323 |       };
audrow commented 2 years ago

Hi @bobleeswaggs and @tlalexander, a few questions to help us find the bug:

tlalexander commented 2 years ago

Hi @audrow thanks for the reply. It turns out I had been using foxy but was trying to build the code for galactic. I've installed galactic and now the code builds. So my mistake! Since the code builds, perhaps this issue could be closed. Thanks!

audrow commented 2 years ago

@tlalexander, okay thanks for the update.