-
PrefaceFirst a big thank you to all authors of MTC for what seems to be an amazing framework, for doing a lot of things in ROS2 that otherwise seems difficult / daunting. I will also preface this discussion with acknowledging that my understanding of ROS2 and MoveIt is still in early stages - so please pardon incorrect use of terminology or concepts - pointers and corrections are welcome and appreciated. IntroductionI am trying to implement a Pick and Place mechanism for a UR5e, with a vacuum gripper end-effector, using MTC. The catch is that I want to only calculate the trajectories once, at startup of the MTC Node, and not recalculate them online, as I need to make sure they always gets executed in exactly the same way each time they are repeated. SetupI am on Ubuntu 24.02 with mtc branch What is working so farCreating a MTCNode based on the example in the official MTC Pick and Place tutorial, but without grasps, and using my own set of poses, and of course a different robot.
I can plan this, and I can have it execute with
Planned workFrom here I plan to first attempt to execute in turn (by separate calls to QuestionsSelecting a specific solutionFrom most of the tutorial material I have encountered I only see Just use multiple tasks insteadShould I give up on using one task with parallel solutions, and instead use multiple tasks, seeing that they are all independent from each other any way? Each trajectory will have requirements for start positions, but that would be a controller problem anyway, not an issue for telling MTC to execute a particular task, which are easily named, and hence able to get connected with a service or an action. Am I using MTC completely wrong?Is it the wrong use pattern for MTC? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Indeed, you should instantiate 4 separate MTC tasks and one additional to move from start to home.
No. Your approach is perfectly valid. Just use separate tasks. |
Beta Was this translation helpful? Give feedback.
Indeed, you should instantiate 4 separate MTC tasks and one additional to move from start to home.
A solution's task is intended to be executed entirely, not partially.
task_.solutions()
returns a vector-like object, not a map. Hence you can refer to solutions viatask_.solutions().front()
,task_.solutions()[0]
,task_.solutions()[1]
, etc. However, solutions are always sorted by cost and you want to pick the most cost-effective solution, i.e. …