Skip to content

Conversation

@DLu
Copy link
Collaborator

@DLu DLu commented Jul 2, 2020

Potential fix for #43.

@cf-zhang Does this work for you?

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.

5 participants