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

Action call in a stage #601

Open
karanchahal opened this issue Aug 7, 2024 · 6 comments
Open

Action call in a stage #601

karanchahal opened this issue Aug 7, 2024 · 6 comments

Comments

@karanchahal
Copy link

Hi, I want to run a custom stage called attach object which runs things externally to MTC/Move it.

So I want to run this action call when task is being executed and robot is in the correct position, but when I add this stage into MTC (the stage is inherited from PropogatingForward stage), in the task.plan() stage it is being executed and the rest of my stack fails since robot is not in the correct position.

How do I add the constraint of only running code in the custom stage during task.execute() ?

@rhaschke
Copy link
Contributor

rhaschke commented Aug 8, 2024

Currently, MTC doesn't allow for running code during task execution: it is primarily a framework planning trajectories. Side-effects cannot be transmitted to the move_group node for execution.
If you just want to attach a collision object to the robot, use the ModifyPlanningScene stage.

@blooop
Copy link

blooop commented Dec 6, 2024

I have a vacuum gripper and I'd like to call a ros service to turn on/off the vacuum gripper during execution. From the sounds of it, MTC doesn't support calling the service at the appropriate point during the execution? Are there any workarounds for using MTC with a vacuum gripper?

Thanks

@rhaschke
Copy link
Contributor

rhaschke commented Dec 6, 2024

Yes, that's currently not supported as the MTC node just sends the planned trajectory for execution to the main move_group node.
I have some code lying around, changing that logic and directly using MoveIt's execution manager within the MTC node to execute the trajectory with side effects. However, I never found time to finalize and merge this into MoveIt+MTC.

@blooop
Copy link

blooop commented Dec 6, 2024

Thanks for the quick reply.

As a horrible horrible workaround, what about having a fake gripper joint that MTC activates as normal and then the gripper node subscribes to the state of the fake gripper joint to turn the vac on and off.

@matthias88
Copy link

matthias88 commented Dec 6, 2024

An approach that works is to execute the sub-trajectories up to the point where you need to call the gripper service, and then execute the remaining sub-trajectories afterward. Yes, its a workaround, but it fit my needs

@rhaschke
Copy link
Contributor

rhaschke commented Dec 9, 2024

Both of these approaches will work.

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

No branches or pull requests

4 participants