ros2 / demos

Apache License 2.0
506 stars 330 forks source link

code line does not match the official tutorial #702

Closed peterwarlg closed 1 month ago

peterwarlg commented 2 months ago

with the Fibonacci.action file defined in official action tutorial as:

# Request
---
# Result
---
# Feedback

Code here should be modified to auto & sequence = feedback->partial_sequence;, otherwise it cannot be compiled successfully

https://github.com/ros2/examples/blob/8a9fbfb54ffb600728644f2f310a8f4b1e23d5b6/rclcpp/actions/minimal_action_server/member_functions.cpp#L76

clalancette commented 2 months ago

Sigh. This whole thing is confusing because we have Fibonacci.action defined three times:

That said, if you follow the tutorial from https://docs.ros.org/en/humble/Tutorials/Intermediate/Creating-an-Action.html#defining-an-action to https://docs.ros.org/en/humble/Tutorials/Intermediate/Writing-an-Action-Server-Client/Cpp.html, it should do the right thing.

The action here is really to remove two of those three definitions of Fibonacci we have in the code; there is really no reason for three copies.