We are using this package for Drone in both indoor and outdoor environments, and the high load of mocap_node significantly limits the computation resource to perform other process such as image processing. So, we think this PR is very critical for users who use onboard compact computes.
We found two problems when using this package:
An infinite and nonstop loop process in initialize(), if there is no Motive server in the same network. This will lead to a very high load for CPU (occupy entire one core of CPU).Then, we add following line to relieve the load: https://github.com/tongtybj/mocap_optitrack/blob/befbeaf2e2180db6cf0571a57e1510c21fd4b9bf/src/mocap_node.cpp#L96
A nonstop loop process in run(), when
updateDataModelFromServer()
returns false. This always happens when new packet is not sent from Motive. This also leads to a very high load for CPU Then, we add following line to relive the load: https://github.com/tongtybj/mocap_optitrack/blob/befbeaf2e2180db6cf0571a57e1510c21fd4b9bf/src/mocap_node.cpp#L145-L146We are using this package for Drone in both indoor and outdoor environments, and the high load of mocap_node significantly limits the computation resource to perform other process such as image processing. So, we think this PR is very critical for users who use onboard compact computes.