-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
VTOL Offboard attitude setpoints getting reset/overwritten #13310
Comments
@Jaeyoung-Lim any thoughts here? |
I tried reproducing it through from the current master I cannot reproduce the problem with the setpoints jumping. The log can be seen as below. Also attitude setpoints in MC mode looked reasonable: I sent attitude setpoints which is supposed to track a circular trajectory for VTOL MC mode and send a transition service through mavros to push it to vtol FW mode. The attitude setpoints are being streamed at a 100Hz. The type mask is also defined as 7. @RicardoM17 I am not sure what is going on with your setup. Could you explain more on what the performance of the node means? |
To add some more information. Here is the recorded rosbag from the respective topics.
As you can see the value is "normal" with only small jumps that come from my controllers. However compared to the same plot in As you can see the graphics somewhat match but there is tons of dropouts where the value is In this test To clarify the "performance of the node statement". Currently the node that is sending the I'll test with your node next and get back here with the results. |
Another update: It seems that this is not directly related to my node (but it could be something with my system. Any debug tips or possible solutions are very much appreciated). I started a gazebo simulation with a tailstter, took off and transitioned via QGC and then published a message at 100 Hz using:
https://logs.px4.io/plot_app?log=14f6e81b-9c2b-42d1-96bd-93e349043f63 I also managed to replicate this in another machine: https://logs.px4.io/plot_app?log=cc945981-3ece-443a-90c0-24771b922460 Edit: I understand that this particular quaternion doesn't have the correct norm. However results are the same with a 0,0,0,1 no rotation quaternion. |
During my research I found something interesting. In #13209 @ThomasRigi shares a log in which some similar behaviour is observed. The difference between that it's not being observed at all times and also not in thrust but only in Pitch and Roll. attached link for convenience: https://logs.px4.io/plot_app?log=1fae08b3-82f3-4a45-b5d9-ff997bb9e7a3 @ThomasRigi is this something that you have experienced in your tests/development? I understand that you are using the MAVSDK but perhaps there is some overlap here. |
@RicardoM17 I don't think that these issues are very related. I had a look at your attitude setpoint in the .csv file generated with pyulog. The faulty zero thrust setpoints are new setpoints that the drone receives from somewhere (the timestamp is increasing on every setpoint). In my case the issue is (HIL) that there is an old attitude setpoint that gets copied ever and ever again, suppressing/overwriting the new ones. This problem has been completely solved in #13141 for SITL, but somehow not for HIL (why HIL doesn't work is still completely unclear to me). On a sidenote: thrust is also affected, it just doesn't show up on the plot. It should be 0.6 during the first offboard phase. I have never touched ROS, but I think your issue lies between /mavros/setpoint_raw/attitude and /mavros/setpoint_raw/target_attitude (what is the difference / why are there two of them? :S ) I hope you find the bug soon! |
I'm digging in and thanks for the feedback :) Yes I agree with you @ThomasRigi those faulty setpoints are coming from someplace else (I suspect from the PX4 side as from ROS nodes I've gone to using I just mentioned you because I saw in your log stuff like this: Which to me looks similar. Is this the old setpoint that you mentioned that gets copied? From the mavlink docs it says about the
https://mavlink.io/en/messages/common.html#ATTITUDE_TARGET Which is not happening. I'll have to check where this message is sent in PX4 and investigate further but obviously it would be good to have some tips from the more experienced devs ;) |
I see this part of the graph for the first time now 😬 This happens during the offboard body control phase, using The problem with the old setpoint is only when using |
@RicardoM17 A rosbag would be helpful to find out what is going on. I suspect that the zero setpoints are actually being sent by something and not being set by the firmware |
@Jaeyoung-Lim here is the rosbag: (Github doesn't support this format so I had to use WeTransfer but if you wish let me know and I can send it to you directly via Slack/e-mail). Here is the corresponding log: https://logs.px4.io/plot_app?log=81650a2b-abbc-4f6c-82e4-80b9d544a68f (there is quite some idle time at the beginning while I was setting everything up but the rosbag doesn't have this issue.) For the record I had a rostopic publishing into Also here is the exact same procedure but without transitioning into VTOL FW https://logs.px4.io/plot_app?log=4a2a1af2-2cb3-49dc-a533-179483f55ecd Obviously the trajectory followed is junk as I didn't want to change the published message but as you can see this issue is not present so I fear it's something on the Firmware side, more precisely either on the FW attitude controller or the VTOL controller. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
@likehengqq Please do not hijack the topic of this issue. You can post a new issue or post your question in |
So I'm currently trying to run a VTOL Offboard simulation in gazebo but I'm having some issues.
The model used is the standard gazebo tailsitter. Using yesterdays master though I don't think it's too relevant.
I'm publishing a message on
/mavros/setpoint_raw/attitude
with the attitude quaternion and a thrust value. The type_mask used is 7.The published message is pretty much always the same and without any major issues. However as you can see by this log the setpoints keep getting "reset" or overwritten which disrupts the performance of the drone.
https://logs.px4.io/plot_app?log=83530229-b60d-422a-83e0-5aeb800bbc27
This is a log running the same code in another machine in which we don't have this issue:
https://logs.px4.io/plot_app?log=69b60928-77ee-4fab-9908-0944b598d715
However even in this scenario it's only because it hit the "sweet spot" because depending on the performance of the offboard "node" it can also have the same issue.
If I look at the the topic
/mavros/setpoint_raw/target_attitude
I see instead that it jumps a lot. For example in the thrust it's always jumping between 0 and 1.0.Am I wrong in assuming that #13141 should support this type of control or perhaps it's just that I am doing something wrong.
Also I understand that the publishing rate is quite important but I am wrong in assuming that if there is a a small delay in the publishing the message won't be overwritten? (which is the case I'm finding where a message is overwritten several times a second).
Apologies if this is not the right place to ask.
The text was updated successfully, but these errors were encountered: