We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0ca622 commit ba66795Copy full SHA for ba66795
sample_nodes/crossdoor_nodes.cpp
@@ -26,8 +26,11 @@ NodeStatus CrossDoor::IsDoorLocked()
26
27
NodeStatus CrossDoor::UnlockDoor()
28
{
29
- SleepMS(2000);
30
- _door_locked = false;
+ if( _door_locked )
+ {
31
+ SleepMS(2000);
32
+ _door_locked = false;
33
+ }
34
return NodeStatus::SUCCESS;
35
}
36
@@ -47,10 +50,10 @@ NodeStatus CrossDoor::OpenDoor()
47
50
48
51
if (_door_locked)
49
52
- _door_open = true;
53
+ return NodeStatus::FAILURE;
54
-
55
56
+ _door_open = true;
57
58
59
0 commit comments