Change mocap timeout in lpe position estimator

I pass mocap data to pixhawk. When I use lpe estimator i get mocap timeouts every second or very frequently. I believe that the mocap data is somehow getting published at a slower rate than 0.2s or has some other issue. I tried to debug the reason for timeout but failed.

I want to know if i can instead change the MOCAP_TIMEOUT constant in Firmware/src/modules/local_position_estimator/sensors/mocap.cpp code ? Is it recommended? Do I need to clone a fresh copy of firmware alter the MOCAP_TIMEOUT constant, make it and upload it to pixhawk? Is that the only interface to change the parameter or is there any other way to change MOCAP_TIMEOUT constant?

Its unlikely your system will fly well if the mocap data arrives slower than 5 Hz. You really should check that its getting sent fast enough and that the serial link can sustain the update rate. Consider increasing the baud rate of the serial link and try to put ROS_INFO() calls into the MAVROS plugin sending them to check that you get more than 5 Hz.

Note that if you send the data over the serial link faster than it can sustain it will start to truncate packets. So its well possible you need to throttle it to 50 Hz or so to make it work (or work with a faster baud rate).