AP_Camera: Add Camera Tracking functionality (WIP)
This adds support for a companion computer to perform image tracking using any of the backends
Could you rebase this and also clarify what testing has been done?
Could you create a separate PR with the python script in a new directory AP_Camera/examples?
We should also consume the CAMERA_TRACKING_IMAGE_STATUS message and update the user
We should implement MAV_CMD_CAMERA_STOP_TRACKING
@khanasif786, thanks for all your efforts on this. Could you rebase this on master too?
Let's also make it "ready for review" instead of "WIP"
Binary Name Text [B] Data [B] BSS (B) Total Flash Change [B] (%) Flash Free After PR (B)
--------------- --------------- ----------- ------------- ---------------------------- -------------------------
antennatracker 916 (+0.0688%) 0 (0.0000%) -4 (-0.0015%) 916 (+0.0687%) 631372
arduplane 1048 (+0.0583%) 0 (0.0000%) 0 (0.0000%) 1048 (+0.0582%) 164728
blimp 916 (+0.0677%) 0 (0.0000%) 4 (+0.0015%) 916 (+0.0675%) 609112
arducopter-heli 1076 (+0.0598%) 0 (0.0000%) 4 (+0.0015%) 1076 (+0.0597%) 162656
arducopter 1072 (+0.0596%) 0 (0.0000%) 0 (0.0000%) 1072 (+0.0594%) 161680
ardusub 1088 (+0.0684%) 0 (0.0000%) 0 (0.0000%) 1088 (+0.0683%) 371252
ardurover 1060 (+0.0643%) 0 (0.0000%) 4 (+0.0015%) 1060 (+0.0642%) 313360
@khanasif786, I think perhaps the follow-functionality should be split into a separate PR, with this one focussing on the core camera tracking changes.
The addition of MSG_CAMERA_TRACKING_IMAGE_STATUS is needed though if we are to run the tracker on a companion computer and want to send the GCS information about the current bounding box so it can be displayed in the GUI. I'm running into just this issue in testing.
I've written a MAVProxy module (camtrack) to test this PR in simulation and on hardware. There's a mavproxy GUI module to engage / disengage the tracker, and a separate headless module that may run on either the GCS computer, or on the companion computer.
It's working in simulation, still having a few issues setting up correct sys_id and component_id for all components on hardware (CubeOrangePlus with RPi4 companion). AFAICT the RPi4 copes with the cv2.legacy.TrackerCSTR tracker.
The MAVProxy code is here: https://github.com/srmainwaring/MAVProxy/tree/wips/wip-camera-tracking. It is a WIP with a lot of debug message code included that will eventually be pruned. Let me know if you'd like a walk through.
A rebase of this PR on master here: https://github.com/srmainwaring/ardupilot/tree/mav_cmd_camera_final_rebased. I'd force push, but don't have access. There are a few conflicts resolved.
@khanasif786 are you still working on this?
@vicradon , Yes! Testing phase. do you have any suggestions or something let me know.
The architecture of the Follow Library has been changed so much, which is why the merge conflict, So eventually this PULL will require so much rework. Let me come back here with a new and compatible patch
The new working PR is here - #30941