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

Fix for #43 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix for #43 #59

wants to merge 1 commit into from

Conversation

DLu
Copy link
Collaborator

@DLu DLu commented Jul 2, 2020

Potential fix for #43.

@cf-zhang Does this work for you?

@@ -51,12 +52,16 @@ class LocomotorActionServer
void publishFeedback(const locomotor_msgs::NavigationState& nav_state);
void completeNavigation();
void failNavigation(const locomotor_msgs::ResultCode& result_code);

// Note: This is a separate method so as not to change the previous constructor parameter list
void setPremptionCallback(PreemptionCallback cb) { preemption_cb_ = cb; }

Choose a reason for hiding this comment

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

I'd recommend just having a virtual void onPreemption() {} method that the user can override.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In which class?

Choose a reason for hiding this comment

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

In this one. Rather than setting a callback functor, you can just let the user override the onPreemption method if they want to trigger some callback. These 2 actions will have equal output.

@cf-zhang
Copy link

cf-zhang commented Jul 4, 2020

Potential fix for #43.

@cf-zhang Does this work for you?

I have resoulved my problem by provide a CancelTaskCallback, thanks.

@yyagin
Copy link

yyagin commented Jun 6, 2022

Hello, what is the status of this? @SteveMacenski, if @DLu does not have the time i can integrate the changes you requested into a fork and create a new merge request.

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.

4 participants