Skip to content

Tutorial 5 - not fully implemented? #141

Closed
@msadowski

Description

@msadowski

Hi Davide!

Once again many thanks for this library and excellent tutorials!

I have noticed that in the example 5 (the one with door crossing) the unlocking is not implemented (I think it makes for a very good homework, could be useful to note it in the tutorial itself).

In this line: https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/sample_nodes/crossdoor_nodes.cpp#L48 for opening the door we have:

NodeStatus CrossDoor::OpenDoor()
{
    if (_door_locked)
    {
        SleepMS(2000);
        _door_open = true;
    }

    return NodeStatus::SUCCESS;
}

But should the condition be if (!_door_locked) ? We should only be able to open it if it was previously unlocked.

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