Skip to content

RobotBackend should be cleaned up #31

@wumanu

Description

@wumanu

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions