Skip to content
Snippets Groups Projects
Commit e31c1dbc authored by phfriedl's avatar phfriedl
Browse files

fixed service race condition at startup, crazyflie resets before shutdown

parent 5e28532a
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,8 @@ if __name__ == '__main__':
rospy.spin()
rospy.loginfo("Turning off crazyflie")
cf_client._send_to_commander(0, 0, 0, 0, 0, 0, 0, 0, CONTROLLER_MOTOR)
#wait for client to send its commands
time.sleep(1.0)
cf_client._cf.close_link()
rospy.loginfo("Link closed")
else:
......
......@@ -88,8 +88,7 @@ void ppsClientToController(ViconData data, bool autocontrolOn){
//onboardControllerType = ??????????????????????
}
else{
} else {
ROS_ERROR("Failed to call SafeControllerService");
//return 1; //return some useful stuff
}
......@@ -171,6 +170,7 @@ int main(int argc, char* argv[]){
//service
//to be expanded with additional services depending on controller (currently only one available)
ros::service::waitForService("/SafeControllerService/RateController");
safeController = nodeHandle.serviceClient<RateController>("/SafeControllerService/RateController", true);
//safeController = nodeHandle.serviceClient<d_fall_pps::RateController>("/SafeControllerService/RateController", true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment