jellosubmarine / droonituuled

0 stars 0 forks source link

Altitude calibration on flight node startup #10

Closed jellosubmarine closed 5 years ago

jellosubmarine commented 5 years ago

/mavros/vfr_hud tends to be not publishing, fix was to calibrate altitude in QGroundControl. Need to implement this in code, probably through some service or find a workaround.

jellosubmarine commented 5 years ago

https://discuss.ardupilot.org/t/solving-barometer-drift/6172

johankytt commented 5 years ago

Results from testing:

Might be that Pixhawk wants a 3d fix and QGC automatically provides it upon connection.

jellosubmarine commented 5 years ago

http://forum.erlerobotics.com/t/ros-topics-not-publishing-anything/142

You need to set the stream rate:

rosservice call /mavros/set_stream_rate 0 10 1

or if you are using C++:

ros::NodeHandle n;
ros::ServiceClient client = n.serviceClient<mavros::StreamRate>("/mavros/set_stream_rate");
mavros::StreamRate srv;
srv.request.stream_id = 0;
srv.request.message_rate = 10;
srv.request.on_off = 1;
if(client.call(srv)){
    ROS_INFO("Service called");
}else{
    ROS_INFO("Failed to call service");
}
johankytt commented 5 years ago

Moved the code added by Rando to main(). Seems to work, not tested on hardware.