PX4/mavros local position estimation and publishing

We have been facing two issues:

Firstly the accuracy associated with publishing the set point using the
\setpoint_position\local in ROS where in there exists a lot of error to
reach the given set points what could be the reason for the same?

Secondly, we need to get the feedback of the position reached by the
coptor which we are subscribing to using the \local_position\pose but we
are getting values in the range of e^-17 which do not seem to be
correct even after accumulation. Are there any changes required to be
done w.r.t. parameters or firmware?

Our configuration:

We are using px4 stable firmware and have connected optical flow sensor instead of gps for position estimation.

Hi there,

As I understand, in order to achieve local position control there are some sensor requirements. The optical flow quality in particular needs to be above a certain threshold before local position estimates will be valid.

Depending on the estimator in use and the sensors you have present in your platform, the vehicle local position topic may not contain valid data.

Are you able to place the vehicle into position control mode via a radio transmitter? This is a good test to see if your opitcal flow quality and ground distance measurements are sufficient for the local position estimator. Position control mode is rejected unless the xyz values in the vehicle_local_position topic are valid.