mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
actually handle return values in traversal code...
This commit is contained in:
parent
e0e1c77eb4
commit
3c3ae44517
@ -108,16 +108,19 @@ bool traverseFullTrajectories(
|
|||||||
moveit::task_constructor::Task::SolutionCallback& cb,
|
moveit::task_constructor::Task::SolutionCallback& cb,
|
||||||
std::vector<robot_trajectory::RobotTrajectoryPtr>& trace)
|
std::vector<robot_trajectory::RobotTrajectoryPtr>& trace)
|
||||||
{
|
{
|
||||||
|
bool ret= true;
|
||||||
|
|
||||||
if(start.trajectory)
|
if(start.trajectory)
|
||||||
trace.push_back(start.trajectory);
|
trace.push_back(start.trajectory);
|
||||||
|
|
||||||
if(nr_of_trajectories == 1){
|
if(nr_of_trajectories == 1){
|
||||||
cb(trace);
|
ret= cb(trace);
|
||||||
}
|
}
|
||||||
else if( start.end ){
|
else if( start.end ){
|
||||||
for( const moveit::task_constructor::SubTrajectory* successor : start.end->next_trajectory ){
|
for( const moveit::task_constructor::SubTrajectory* successor : start.end->next_trajectory ){
|
||||||
if( !traverseFullTrajectories(*successor, nr_of_trajectories-1, cb, trace) )
|
if( !traverseFullTrajectories(*successor, nr_of_trajectories-1, cb, trace) )
|
||||||
return false;
|
ret= false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +150,8 @@ bool publishSolution(ros::Publisher& pub, moveit_msgs::DisplayTrajectory& dt, st
|
|||||||
std::cout << "publishing solution" << std::endl;
|
std::cout << "publishing solution" << std::endl;
|
||||||
pub.publish(dt);
|
pub.publish(dt);
|
||||||
ros::Duration(10.0).sleep();
|
ros::Duration(10.0).sleep();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user