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

PrimaryClient: Add methods to unlock protective stop and stop the program #292

Merged

Conversation

urfeex
Copy link
Member

@urfeex urfeex commented Mar 17, 2025

Add functionalities to stop the running program and to unlock a protective stop through the primary client.

@urfeex urfeex requested a review from a team March 17, 2025 13:17
@urfeex urfeex force-pushed the primary_client_stop_and_unlock_ps branch 2 times, most recently from 14a30d6 to c04b302 Compare March 17, 2025 14:11
@urfeex urfeex marked this pull request as ready for review March 18, 2025 07:50
@urfeex
Copy link
Member Author

urfeex commented Mar 18, 2025

I moved the test modification to an own PR #293. Let's merge that first.

@urfeex urfeex force-pushed the primary_client_stop_and_unlock_ps branch from 9037e1e to d36121a Compare March 18, 2025 10:45
}
}

void PrimaryClient::commandStop(const bool already_stopped_ok, const bool validate,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that it is obvious what the arguments mean. Special the 'validate', another name suggestion could be "blocking"

I would be fine with that but then I would update that in all methods.

In addition, the functionality of already_stopped_ok might be challeging with a program that finish within 100ms inteval that the primary interface is updating the with. An example of this could be a small program setting an output.

Isn't that exactly an example of why we need such a flag?

We could maybe consider using enum for "modes"

Which modes are you referring to?

@urfeex urfeex requested a review from urrsk March 19, 2025 09:44
@urfeex urfeex force-pushed the primary_client_stop_and_unlock_ps branch from 0eec7a8 to 4dccf48 Compare March 19, 2025 10:19
std::shared_ptr<RobotModeData> robot_mode_data = consumer_->getRobotModeData();
if (robot_mode_data == nullptr)
{
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of more expecting an exception to be thrown here!

@urfeex urfeex requested a review from urrsk March 19, 2025 15:22
@urfeex urfeex merged commit 8ad298f into UniversalRobots:master Mar 20, 2025
24 checks passed
@urfeex urfeex deleted the primary_client_stop_and_unlock_ps branch March 20, 2025 09:26
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.

2 participants