mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
Connect: Fix segfault when accessing solutions from multiple plan() calls
Connect::init() was resetting its dynamically created JMG merged_jmg_, thus invalidating all previous solutions. Only reset the JMG in reset().
This commit is contained in:
parent
c7151dcc48
commit
3a7a4eb953
@ -86,9 +86,8 @@ void Connect::init(const core::RobotModelConstPtr& robot_model) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!errors && groups.size() >= 2) { // enable merging?
|
||||
if (!errors && groups.size() >= 2 && !merged_jmg_) { // enable merging?
|
||||
try {
|
||||
merged_jmg_.reset();
|
||||
merged_jmg_.reset(task_constructor::merge(groups));
|
||||
} catch (const std::runtime_error& e) {
|
||||
ROS_INFO_STREAM_NAMED("Connect", this->name() << ": " << e.what() << ". Disabling merging.");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user