Will calling a service whilst processing a message from a topic in a callback lead to a deadlock
If I'm using AsyncSpinner spinner(1); will calling a service whilst processing a message from a topic in a callback lead to a deadlock?
I think yes; but would like to double check I've diagnosed things correctly.
Screen shot below; the most relevant lines are 82, 85 &52
Upading to AsyncSpinner spinner(2) the code is able to progress past line 52
void planningSceneAction(const moveit_msgs::PlanningScene::ConstPtr& msg)
{
......
moveit::planning_interface::MoveGroupInterface::Plan my_plan;
//DEADLOCKK ISSUES???? Even though its "this thread" invoking the service
// the response can't be recieved if there is only a single thread?
bool success = (move_group.plan(my_plan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
......
}
int main(int argc, char** argv)
{
......
ros::Subscriber subPlanningScene = node_handle.subscribe("/planning_scene", 3, planningSceneAction);
......
ros::AsyncSpinner spinner(2); // using 1 hits deadlock
}
I think this is similar to the python version discussed here: https://discourse.ros.org/t/synchrono...C:\fakepath\deadlock-able.png
Please paste the text as code. Screenshots of terminal and code are discouraged because they are not searchable.