-
Notifications
You must be signed in to change notification settings - Fork 938
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
Add getMoveGroupClient() to move_group_interface #1215
Conversation
9f10610
to
8775b18
Compare
As discussed in private emails, I support this idea.
The MGI is supposed to make the user's life *easier* and should not prevent useful applications,
such as aborting actions, looking at feedback or results in asyncMove.
I don't like the idea of sharing the action client though and would prefer to return a reference from the method.
Why did you decide to use a shared_ptr instead?
For consistency it might also make sense to change the method name to `getMoveGroupClient`.
Do you have to write out the pointer definition, or is there a typedef you can use?
|
Because a
Done.
I couldn't find any existing typedef. Should I create a new one? |
Regarding the return type: I could return a reference to the underlying object directly (so, a
Well, we're doing that anyway, no matter which return type we use. |
Ok, I've made the change to the return type. |
8a00d27
to
c0f908e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I think about it, that sounds even better. Is this what you meant?
Yes, that's exactly what I meant. Returning a reference to a pointer does not make a lot of sense here, that's true. :)
I don't like the idea of sharing the action client though
Well, we're doing that anyway, no matter which return type we use.
Sorry, I meant to write share ownership.
Never get on a crowded subway and review at the same time...
Two nitpicks, otherwise this looks good to me.
...ng_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h
Show resolved
Hide resolved
...ng_interface/move_group_interface/include/moveit/move_group_interface/move_group_interface.h
Outdated
Show resolved
Hide resolved
... otherwise cancelGoal() doesn't work.
Ok, all requested changes are done. |
Looks good to me. Thanks for your time @mintar 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, declare both methods const.
@@ -1502,6 +1505,12 @@ moveit::planning_interface::MoveItErrorCode moveit::planning_interface::MoveGrou | |||
return impl_->move(false); | |||
} | |||
|
|||
actionlib::SimpleActionClient<moveit_msgs::MoveGroupAction>& | |||
moveit::planning_interface::MoveGroupInterface::getMoveGroupClient() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is missing the const specifier, while the implementation method has one.
moveit::planning_interface::MoveGroupInterface::getMoveGroupClient() | |
moveit::planning_interface::MoveGroupInterface::getMoveGroupClient() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I obviously meant to make it const everywhere. Fixed!
Nice! That went faster than expected. |
@mintar Glad you talked to me about it 👍 |
hi, I discovered there is a bug in current |
@davidyanghit it would be really nice if you could open a new PR with your proposed changes, it's easier to understand and comment then |
* CI: More generically fix permission errors Disable git security check for any folder. We are running a docker container on GHA. Chances are low that this gets compromised. * Revert changes to source Dockerfile These are inherited from ci.
Use case: I want to execute a trajectory asynchronously while also being able to monitor its execution and perhaps abort it.
MoveGroupInterface::asyncMove()
lets me start asynchronous executionMoveGroupInterface::stop()
lets me abort itThis PR simply adds a getter for the internal
move_action_client
. This enables code like shown in the usage example below. I'm not sure that exposing the internalmove_action_client
is the nicest API (comments welcome), but at least it seems more elegant than replicating all of the client's API one-by-one. In the example below, I've only usedgetState()
,getResult()
andcancelGoal()
; but the other methods are useful as well (for examplewaitForResult()
).usage example
TODOs