How long to wait before being able to call service on mavros

asked 2020-07-07 17:58:52 -0500

maxime gravatar image

updated 2020-07-07 17:59:02 -0500

Hello everyone,

So this issue is mostly related with mavros but maybe you guys can still help.

I have a callback subscribed to "mavros/state":

void Telemetry::state_cb(const mavros_msgs::State::ConstPtr& msg) {
   this->connected = msg->connected;
}

Right after this->connected gets true. I'm calling a get_service to get "MAV_SYS_ID". However, it shows up some error on mavros: However, if after this->connected = true, I sleep 10 seconds or more (not less) then I can call the get_service to get the MAV_SYS_ID, it works. Why so ? Is it normal ?

edit retag flag offensive close merge delete