-
Notifications
You must be signed in to change notification settings - Fork 466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APM Planner not working with mavrouter #1270
Comments
I added debug statements to mavlink-router yesterday night,
APM planner sends message as 1/1 (which is the ardupilot) to mavlink-router
this throws off the mavlink router.
the issue is the message id 2, |
Ok, I believe this is wrong apm_planner/src/uas/UASWaypointManager.cc Line 877 in 7897793
It should record the component id that the drone is sending and use that, because of this mission exchange fails. |
I tried component ID 1 - which is what the AP was using, with no luck - did you ever try this solution? |
Yes, i forked the mavrouter for this. I made a new flag called ignore comp id. So now all messages for sys id goes to the same interface, ignores component id. Here https://github.com/kaangoksal/mavlink-router/tree/ignore_comp_id_fix |
Let me know if you want more help with setting my new flag up |
@kaangoksal thanks - as you have this running - I assume you have the current master on APMPlanner2 too. |
Ok i can do that, glad someone is looking at this :D
…On Thu, Feb 2, 2023, 1:19 PM André Kjellstrup ***@***.***> wrote:
@kaangoksal <https://github.com/kaangoksal> thanks - as you have this
running - I assume you have the current master on APMPlanner2 too.
I am trying to fix AP2. If you could print a debug text identifying the
incorrect packets from AP2 .. that would help me a lot. - could you please
do so? (I hope you have most of it accessible, and it's merely about adding
some print functions)
Identifying the bad packets from AP2 would be of great help - I tried to
fix them "blindly" and it did not work.
—
Reply to this email directly, view it on GitHub
<#1270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5IG2Y4PKYAGJUJLY6WAFDWVQQGLANCNFSM6AAAAAATGJM3IY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
also: please test the build mentioned here #1248 (comment) (latest appimage). |
Setup
There are two issues, one is for some reason apm planner sends a message with sys/comp id 1/1, this makes the mavlink router think that it the system 1/1 also exists on the interface that the apm planner is attached.
this can be mitigated with this to continue testing:
|
It's not wrong. The original spec had the mission plan sent to component 190. That was how it worked. TBH. The 'component id' just confuses the protocol. You really just need to send the message to the sys_id and let the system figure out where the message goes. ie. comp_id of 1 should be default. I'm not sure about the 1/1 message. That maybe a bug. normally it would have just been ignored, but the the router just gets confused! |
@billbonney then we need to fix the mavlink router, or add my new addition IgnoreCompId. Just opened a PR mavlink-router/mavlink-router#385 we need to solve the 1/1 message for apm planner because that one is pretty bad. |
https://github.com/kaangoksal/mavlink-router/tree/additional_debugging_for_apm pull it and run the commands on the readme,
here I added additional debug statements. It adds messages like
we should not be seeing a message coming from the interface of the GCS as from 1/1, it should always be 2**/* I used the latest app image release with all of my trials |
APM Planner is connected to sys_id 1 comp_id 1. That is the drone on single drone system. APM Planner is 252 sys_id. I would expect to see packets from APM Planner to drone and vice versa. I've not looked at mavrouter, so I can help there. |
I already opened the pr for mavlink router. The problem with APM Planner is, it sends a packet with origin 1/1. It should never do that. |
I'll put my neck on the the line and guess this is the bug send msg 1/1 @AndKe https://github.com/ArduPilot/apm_planner/blame/7897793b782180fea87fd6fd15d6cd4ee94631b1/src/uas/UAS.cc#L1431 |
the system that I'm testing with does not have any gps attached |
Nothing to do with GPS |
Hi @kaangoksal, the _encode message functions take the sending system_id and the sending component_id The problem with the message when we get a MAVLINK_MSG_ID_TIMESYNC ie message id 111 in your log. Is that a response is sent, but the sending id/ comp id is set to that of the received message. ie 1/1 not 252/1 or 190 it should be The sending of a message needs to follow this pattern |
so we found the problem! I will work with the mavlink-router team to get that comp id issue merged, so we can have apm planner working with the router as well. |
even though you fix this one (sending the time sync with wrong comp/sysid), mavlink-router needs to ignore comp ids to make mission sync work. At the moment mission sync does not work with APM Planner, but works with Mission planner. Mission planner sends the missions to 1/1. There are two issues. |
I totally agree with @billbonney on the guilty mavlink_msg_timesync_encode() - that's the only place where AP2 assembles TIMESYNC packets. To my best knowledge - I also agree with @kaangoksal as I've been working with several self-made systems - and while sending to comp_id 190 is documented https://mavlink.io/en/messages/common.html#MAV_COMP_ID_MISSIONPLANNER - but still kind of odd - I can't remember to have seen such adressing before - and it is a trivial test to test for them with the other GCS's.
Finally: I would have built-and-tested more of this - but right now, my build-environment is no good and produces a AP2 that cannot exchange missions at all: #1248 (comment) |
I think you should add an option to change the comp_id to 1 (or change it be default) but allow it to be set to 190 (as that will work with Ardupilot Mega boards and older FW) |
@billbonney Thank you for finding the culprit. I will fix the timesync message in the next days. |
It's actually the comp_id in this file that needs to be allowed to change when writing missions and all. apm_planner/src/uas/UASWaypointManager.cc Line 373 in f3b0b41
Like I said, it was always an off choice. Should just let the system decide on where to route messages. Anyway, thanks @kaangoksal for bringing the issue up. Looks like we understand the root cause and can fix. Probs good to hit up the QGC guys to this issue to fix as well. 👍 |
Hi,
I'm testing APM planner with mavrouter, and its currently not working, there are two major problems
mavlink-router/mavlink-router#382 (comment)
its mainly due that APM Planner sends messages to 1/190 sys/comp id, ardupilot does not advertise 1/190, so router doesn't route it. Details on how mavlinkrouter works is here: mavlink-router/mavlink-router#371
APM Planner needs to send messages to 1/1 not 1/190
I believe this is the line which is wrong.
apm_planner/src/uas/UASWaypointManager.cc
Line 877 in 7897793
we need to be targeting uas comp id.
The text was updated successfully, but these errors were encountered: