File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -59,14 +59,12 @@ int main()
5959
6060 // Registering a SimpleActionNode using a function pointer.
6161 // you may also use C++11 lambdas instead of std::bind
62- factory.registerSimpleCondition (" CheckBattery" , std::bind ( CheckBattery) );
62+ factory.registerSimpleCondition (" CheckBattery" , [&](TreeNode&) { return CheckBattery (); } );
6363
6464 // You can also create SimpleActionNodes using methods of a class
6565 GripperInterface gripper;
66- factory.registerSimpleAction (" OpenGripper" ,
67- std::bind (&GripperInterface::open, &gripper));
68- factory.registerSimpleAction (" CloseGripper" ,
69- std::bind (&GripperInterface::close, &gripper));
66+ factory.registerSimpleAction (" OpenGripper" , [&](TreeNode&){ return gripper.open (); } );
67+ factory.registerSimpleAction (" CloseGripper" , [&](TreeNode&){ return gripper.close (); } );
7068
7169#else
7270 // Load dynamically a plugin and register the TreeNodes it contains
You can’t perform that action at this time.
0 commit comments