Skip to content

Commit

Permalink
added subclass RetryNodeTypo (BehaviorTree#295)
Browse files Browse the repository at this point in the history
Co-authored-by: Subaru Arai <SubaruArai@local>
  • Loading branch information
SubaruArai and Subaru Arai authored Oct 13, 2021
1 parent d7ce6f5 commit 4c9807a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions include/behaviortree_cpp_v3/decorators/retry_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace BT
*
* Example:
*
* <RetryUntilSuccesful num_attempts="3">
* <RetryUntilSuccessful num_attempts="3">
* <OpenDoor/>
* </RetryUntilSuccesful>
* </RetryUntilSuccessful>
*/
class RetryNode : public DecoratorNode
{
Expand Down Expand Up @@ -61,6 +61,22 @@ class RetryNode : public DecoratorNode

virtual BT::NodeStatus tick() override;
};

class
[[deprecated("RetryUntilSuccesful was a typo and deprecated, use RetryUntilSuccessful instead.")]]
RetryNodeTypo : RetryNode{
public:
RetryNodeTypo(const std::string& name, int NTries)
: RetryNode(name, NTries)
{ };

RetryNodeTypo(const std::string& name, const NodeConfiguration& config)
: RetryNode(name, config)
{ };

virtual ~RetryNodeTypo() override = default;
};

}

#endif
2 changes: 1 addition & 1 deletion src/bt_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BehaviorTreeFactory::BehaviorTreeFactory()
registerNodeType<WhileDoElseNode>("WhileDoElse");

registerNodeType<InverterNode>("Inverter");
registerNodeType<RetryNode>("RetryUntilSuccesful"); //typo but back compatibility
registerNodeType<RetryNodeTypo>("RetryUntilSuccesful"); //typo but back compatibility
registerNodeType<RetryNode>("RetryUntilSuccessful"); // correct one
registerNodeType<KeepRunningUntilFailureNode>("KeepRunningUntilFailure");
registerNodeType<RepeatNode>("Repeat");
Expand Down

0 comments on commit 4c9807a

Please sign in to comment.