Esempio n. 1
0
	bool srvCallback_Recover(cob_srvs::Trigger::Request &req,
				  	 cob_srvs::Trigger::Response &res )
	{
		if (isInitialized_ == true) {
			ROS_INFO("Recovering camera axis");
			
			// stopping all arm movements
			if (CamAxis_->RecoverAfterEmergencyStop()) {
				ROS_INFO("Recovering camera axis succesful");
				res.success = 0; // 0 = true, else = false
			} else {
				ROS_ERROR("Recovering camera axis not succesful. error");
			}
		} else {
			ROS_ERROR("...camera axis already recovered...");			
		}

		return true;
	}
	bool srvCallback_Recover(cob_srvs::Trigger::Request &req,
				  	 cob_srvs::Trigger::Response &res )
	{
		if (isInitialized_) {
			ROS_INFO("Recovering camera axis");
			
			// stopping all arm movements
			if (CamAxis_->RecoverAfterEmergencyStop()) {
				ROS_INFO("Recovering camera axis successfully");
				res.success.data = true;
				res.error_message.data = "camera axis successfully recovered";
			} else {
				ROS_ERROR("Recovering camera axis not successfully. error");
				res.success.data = false;
				res.error_message.data = "recovering camera axis failed";
			}
		} else {
			ROS_WARN("...camera axis already recovered...");			
			res.success.data = true;
			res.error_message.data = "camera axis already recovered";
		}

		return true;
	}