@netgittemp you can add sensors like cameras and rangefinders to the offboard computer, have a high-level logic to generate offboard commands and then command PX4 using those offboard commands through MAVROS.
We have a similar challenge as described here, and are therefore interested in this topic. As an alternative solution, would it be possible to connect the optical flow sensor to the pixhawk via i2c, utilize PX4s state estimator and send state updates to the companion computer via MAVLINK? I guess that would give a simpler setup on the companion computer. (Unless you need to fuse more sensors that PX4 does not support)
Fundamentally, they’re both capable of doing what you’re trying to achieve.
The key differences are the licensing, code structure and flexibility. It’s probably not worth me going into the technical merits of each, as that can get subjective quite quickly, and I’m not out to start arguments.
License: bsd vs GPLv3. Basically with ArduPilot if you distribute a firmware binary to someone, you have to offer them the source with it. With px4 you don’t, unless you choose to.
Code structure: px4 is modular, with uorb pub/sub. ArduPilot is a bit more complex. Merits to both, and it’s subjective.
Flexibility: the variety of sensors, simulators, gcs tools, etc is much greater with ArduPilot, but for those features/options implemented in px4, px4 is sometimes better documented.
If there are particular features you absolutely need, it’s worth researching both options, to see what best or more closely meets your need. Many people/companies have wasted a lot of time and money heading down one path only to hit a brick wall and have to switch.