Closed robotics-qc closed 3 months ago
Nevermind - I solved it. If anyone else is facing this, the issue seems to be that we need to create the node with the override options otherwise sampling planner does not work.
rclcpp::NodeOptions options;
options.automatically_declare_parameters_from_overrides(true); // Turns out this is essnential and I somehow missed it while writing my node
std::shared_ptr<CustomMtcPipeline> mtc_node = std::make_shared<CustomMtcPipeline>(options);
The reason for this behavior is that TimeParameterization
is configured via the ROS parameter planning_plugin
, which is not declared and thus not available without that flag.
Hello! I have just recently picked up using moveit task constructor and had the pick&place example working. I decided to make a simpler demo that builds many simple demo tasks that demonstrate the usage of different stages. Using the same environment where the pick and place demo runs and works - i created another node which executes my freshly defined task.
I created a simple task : Task flow :
The point of this is to show the syntax of MoveRelative and MoveTo stages, as well as demonstrate the conceptual difference between a cartesian planner and sampling planner.
Planning is successful and the visualization shows that it behaves as expected. However, whilst executing, whenever I use a sampling planner - in either of the stages at any point in the program - the execution is aborted. But the odd thing is it works in the pick and place example based code I have running in the same package if I run that node instead of this one. The settings for the planners/stages/everything is the same except for the task and it's substages.
My node's terminal output :
Output in the RViz terminal:
If I use the cartesian planner for everything, then there is no error and planning + execution is completed If I use sampling planner then the planning is successful but whichever stage I use the sampling planner, the execution fails for the above reason.
Finally I also logged the solutions being sent out on /solutions for both the scenarios and the working pick and place example which also uses the sampling planner.
I see that in the trajectory all the timestamps in my error case are at zero - not incrementing, but in the other two scenarios it does increase. Moreover, the velocity and acceleration fields in my error case are also empty.
error case (sampling planner) :
Cartesian only:
My Code for the task generation is simple: This works in planning - and fails execution at the first sampling planner based stage. Am I doing something wrong or is this some sort of a bug? And in the pick and place example, sampling planners are used only in connect stages, never in the moveTo or moveRelative stages so is it an inherent limitation? I tried changing one of the MoveRelatives in the pick and place example to sampling and that seemed to work - and that is just another node in a file in the same package and environment i'm running. i.e : The controllers, settings all are the same.
Any other information needed can be provided! I'd appreciate any help in this.
Aside from this, as I learn I am creating sample tasks using merger/Alternatives/Fallbacks(which I cant find info or get to work) and other stages so people can understand MTC more easily!