Open JSchaaf2 opened 2 years ago
Do you mind sharing the stacktrace when it segfaults?
instead of being class members declaring the tasks like:
mtc::Task task_ = createTask(); mtc::Task task2 = createTask();
makes the segfault go away.
I wonder if it's related to the class implementation, is it possible to share the whole class code?
It is the tutorial code from the pick and place example in the moveit humble docs.
I thought we fixed this with https://github.com/ros-planning/moveit_task_constructor/commit/e923fbc0c6bd477d15532b335581734857d0eafc, I'll take a look later this week!
I thought we fixed this with e923fbc, I'll take a look later this week!
Actually it look like the issue might be fixed, but I don't think it was e923fbc. I didn't properly clean everything and was still using 1e65027 (the commit after e923fbc), Using the latest commit in the ros2 branch that I can build without issues f28b6c4, the segfault from my example doesn't happen anymore. I don't see anything related to this that changed in the commits in between though.
Between 1e65027 and f28b6c4 there was no actual code change. Hence, it is surprising to me that the former exhibits the segfault while the latter does not. You mention build issues with the latest ros2 branch. Could you please report them in a new issue?
Could you please report them in a new issue?
I had some other issues with the moveit update, but I wanted to update before making the issue. I have updated to the latest ros2 and moveit version but I still have the same issues so I made #406.
I was creating a minimal example for another issue and finally stumbled on a something that looks a lot like another issue I had but never found a minimal example for.
modefied doTask() from pick and place tutorial
```c++ void MTCTaskNode::doTask() { task_ = createTask(); task2 = createTask(); try { task_.init(); } catch (mtc::InitStageException& e) { RCLCPP_ERROR_STREAM(LOGGER, e); return; } if (!task_.plan(5)) { RCLCPP_ERROR_STREAM(LOGGER, "Task planning failed"); return; } try { task2.init(); } catch (mtc::InitStageException& e) { RCLCPP_ERROR_STREAM(LOGGER, e); return; } if (!task2.plan(5)) { RCLCPP_ERROR_STREAM(LOGGER, "Task planning failed"); return; } return; } ```The above code causes a segfault in the collision checking of the IK wrapper for the second task and the following warning is very rarely given (I have only seen it once): [moveit_task_constructor_visualization.task_list_model]: unknown task: ... . This might not be the only situation this happens but I have no other examples that are simple or fail reliably. The other cases also didn't show the warning so I don't know if that is just something I did wrong. Changing the code such that the
task2 = createTask();
line appears after the first one is initialised, or instead of being class members declaring the tasks like:makes the segfault go away.