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

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Add Simple action helper class #53

merged 3 commits into from
Jan 15, 2025

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);

@planthaber planthaber requested a review from 0Nel December 4, 2024 14:05
@planthaber planthaber merged commit c30eb3a into master Jan 15, 2025
1 check passed
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