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

RobotBackend should be cleaned up #31

Open
wumanu opened this issue Jan 8, 2020 · 0 comments
Open

RobotBackend should be cleaned up #31

wumanu opened this issue Jan 8, 2020 · 0 comments
Assignees

Comments

@wumanu
Copy link
Member

wumanu commented Jan 8, 2020

the loop of the RobotBackend could potentially be simplified a bit, experience shows that the logic now is a little error prone.

for instance, i think there is a slight problem in this part:

            if (std::isfinite(
                    robot_driver_.get_max_inter_action_duration_s()) &&
                robot_data_->desired_action->newest_timeindex() < t)
            {
                uint32_t action_repetitions =
                    robot_data_->status->newest_element().action_repetitions;

                if (action_repetitions < max_action_repetitions_)
                {
                    robot_data_->desired_action->append(
                        robot_data_->desired_action->newest_element());
                    status.action_repetitions = action_repetitions + 1;
                }
            }

There is a (small) chance that we check the if-clause and realize that action t has not been appended yet, so we enter the loop, but before we append the repeated action, the user in fact appends another action.

while this problem is most likely practically irrelevant, it hints at some logical issues. not sure what's the best solution, maybe the timeseries should have a lock function?

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

No branches or pull requests

2 participants