Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Simple action helper class #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

planthaber
Copy link
Member

The class helps with managing SimpleActions and dependencies.

  • setup of action value limits with less calls
  • setup of named Values with less calls
    • can use std::map init addNamedValues({ {"VAL1", 1}, {"VAL2", 2},{"VAL3", 3} });
  • action states can be set using functions
    • to make the curretn state requestable by requestSimpleActions()
    • to be able to check if the action dependencies are met using canExecute()
SimpleActionsHelper helper;

std::shared_ptr<SimpleActionWrapper> action1 = helper.addSimpleAction("action1", robot_remote_control::VALUE_INT);
action1->setLimits(-1,3,1);
action1->addNamedValues({ {"VAL1", 1}, {"VAL2", 2},{"VAL3", 3} });
action1->setState("VAL2");
action1->addActionDependency("action2", 3);
action1->addActionDependency("action2", 4);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant