PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.14k stars 13.35k forks source link

[Bug] Navigator no longer sends fake ADSB / wrong instructions #21810

Open hamishwillee opened 1 year ago

hamishwillee commented 1 year ago

Describe the bug

The navigator fake_traffic command description is wrong.

fake_traffic publishes 4 fake transponder_report_s uORB messages

If you run the command nothing happens.

The faketrigger code is still called, but all the triggers are commented out: https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/adsb/AdsbConflict.cpp#L391.

This was changed in #21283 .

To Reproduce

Start a console (or use MAVLink console. Enter Simulator say) and enter navigator fake_traffic. Nothing changes.

If you uncomment the code in https://github.com/PX4/PX4-Autopilot/blob/main/src/lib/adsb/AdsbConflict.cpp#L391, rebuild, and try again, the console will show the changes and ADSB warnings appear on QGC.

Expected behavior

The command should match the behaviour - it doesn't fire off the warnings.

It looks like the commented code probably creates test data around the vehicle - not sure, depends on what is passed in by navigator. This is good. However some or all of this should be uncommented, and the navigator command docs updated to reflect what calling the command actually does.

Note that more extensive "faking" code might be provided by a MAVLink test suite.

Screenshot / Media

No response

Flight Log

NA

Software Version

PX4 main, QGC daily.

Flight controller

Simulator, but doesn't matter

Vehicle type

Multicopter

How are the different components wired up (including port information)

No response

Additional context

No response

asimopunov commented 11 months ago

I wasn't able to find a way around commenting out fake_traffic. See commit https://github.com/PX4/PX4-Autopilot/pull/21283/commits/f81944efc46a16cd9d8bc5b02ed72668b5da2bf4

asimopunov commented 4 months ago

Should be added back in https://github.com/PX4/PX4-Autopilot/pull/21663