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

smach shutdown handler #105

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

smach shutdown handler #105

wants to merge 7 commits into from

Conversation

talhabw
Copy link
Contributor

@talhabw talhabw commented Dec 21, 2024

Closes #104

Sometimes we need to shutdown the smach to prevent the robot from getting damaged. This results in robot trying to align itself to the latest frame we have sent to align_frame_controller.

With this change we call the taluy/control/align_frame/cancel service when the smach is killed, which cancels the align_frame_controller, so the robot stays stable.

@talhabw talhabw self-assigned this Dec 21, 2024
@talhabw talhabw requested a review from senceryazici December 21, 2024 13:30
senceryazici
senceryazici previously approved these changes Dec 22, 2024
"/taluy/control/align_frame/cancel", Trigger
)

signal.signal(signal.SIGINT, self.shutdown_handler)
Copy link
Member

Choose a reason for hiding this comment

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

I believe the SIGINT signal already puts the main state machine in to preempted outcome, maybe when that outcome is achieved we just call the align frame controller and cancel it? Just asking if this signal handling is necessary

Copy link
Contributor Author

@talhabw talhabw Dec 22, 2024

Choose a reason for hiding this comment

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

SIGINT puts the main state machine to aborted outcome.

Maybe we can set each state's aborted outcome to CancelAlignControllerState we already have. I think this may be a better way than signal handling.

@senceryazici
Copy link
Member

This will need to wait until #107 is merged and then will need to rebased, since CI is failing @talhabw

senceryazici
senceryazici previously approved these changes Dec 23, 2024
Copy link
Member

@senceryazici senceryazici left a comment

Choose a reason for hiding this comment

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

maybe consider hooking up preempted to cancel align controller too. This comes down to the practice I guess, just see if this works out for your problem which you've described.

senceryazici
senceryazici previously approved these changes Dec 27, 2024
Copy link
Member

@senceryazici senceryazici left a comment

Choose a reason for hiding this comment

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

Looks good if all tested

@talhabw
Copy link
Contributor Author

talhabw commented Jan 2, 2025

this waits until #91 is merged

@ozanhakantunca ozanhakantunca added the needs hardware test features that needs to be tested on the hardware label Jan 6, 2025
@talhabw talhabw force-pushed the talha/smach-shutdown-handler branch from b724ebd to dccb830 Compare January 27, 2025 14:28
@senceryazici
Copy link
Member

What is the status here? after resolving the conflicts this can be merged no?

@talhabw
Copy link
Contributor Author

talhabw commented Jan 29, 2025

This didn't had the intended effects in hardware tests. We somehow couldn't catch the 'ctrl + c' exception and run the preempted/aborted states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs hardware test features that needs to be tested on the hardware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix align frame controller still executing when smach is killed
3 participants