// service callback functions // function will be called when a service is querried bool srvCallback_Init(cob_srvs::Trigger::Request &req, cob_srvs::Trigger::Response &res ) { if (isInitialized_ == false) { ROS_INFO("...initializing camera axis..."); // init powercubes if (CamAxis_->Init(CamAxisParams_)) { ROS_INFO("Initializing of camera axis succesful"); isInitialized_ = true; res.success = 0; // 0 = true, else = false } else { ROS_ERROR("Initializing camera axis not succesful \n"); //res.success = 1; // 0 = true, else = false //res.errorMessage.data = PCube->getErrorMessage(); } } else { ROS_ERROR("...camera axis already initialized..."); res.success = 1; res.errorMessage.data = "camera axis already initialized"; } return true; }
// service callback functions // function will be called when a service is querried bool srvCallback_Init(cob_srvs::Trigger::Request &req, cob_srvs::Trigger::Response &res ) { if (isInitialized_ == false) { ROS_INFO("...initializing camera axis..."); // init powercubes if (CamAxis_->Init(CamAxisParams_)) { CamAxis_->setGearPosVelRadS(0.0f, MaxVel_); ROS_INFO("Initializing of camera axis succesful"); isInitialized_ = true; res.success.data = true; res.error_message.data = "initializing camera axis successfull"; } else { ROS_ERROR("Initializing camera axis not succesful \n"); res.success.data = false; res.error_message.data = "initializing camera axis not successfull"; } } else { ROS_WARN("...camera axis already initialized..."); res.success.data = true; res.error_message.data = "camera axis already initialized"; } return true; }