-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
Need mechanism in Copter to reset yaw to follow vehicle heading in guided mode #2427
Comments
@hamishwillee |
Edited: Deleted, Randy knows best (below) what is supported in different modes. |
@Guohao91, by "NoGPS" mode do you mean while using the mode called "Guided_NoGPS" or do you mean while doing non-GPS position estimation (using one of these methods: https://ardupilot.org/copter/docs/common-non-gps-navigation-landing-page.html). Guided_NoGPS won't work with the condition-yaw command. Auto and Guided modes should accept the condition-yaw I think regardless of whether GPS or one of the alternative methods of position estimation is used. |
@rmackay9 I mean try to call condition-yaw command while using the mode "Guided_NOGPS". Anyways, thanks your answer! |
@Guohao91, ok, so as mentioned above, the condition-yaw command won't work with Guided_NoGPS. Still, to use Guided_NoGPS you'll need to send in set-attitude-target mavlink messages which has a "body_yaw_rate" and "q" field which can be used to set the earth-frame yaw angle or z-axis rotation rate which is the same (I think) as what the condition-yaw command supports. |
@rmackay9 Thanks a lot Mr.Randy! Yeah I am actually using "set-attitude-target" mavlink messages currently. I just found condition-yaw is more straight so I gave a try to ask. |
yap u can use set attitude like this for guided_nogps. |
anyone can change altitude on guided_nogps? |
By default when you enter guided mode, the yaw of the vehicle follows the vehicle heading. If you change the yaw using MAV_CMD_CONDITION_YAW you will have to control the yaw manually for the rest of the script, because there is no way good way to reset the yaw back to following vehicle heading (actually, you can toggle the mode away from GUIDED and back again, but then RC Controller settings for throttle etc may affect vehicle behaviour - so this is not acceptable).
A desirable implementation is to update MAV_CMD_CONDITION_YAW param4 to have a third option that sets the yaw as relative to the vehicle heading (in addition to the absolute values and relative to the last yaw setting). Setting this and a heading of zero would emulate the default behaviour. Setting this and a heading of anything else would allow a yaw to be specified relative to the vehicle's direction of travel.
A less desirable but still good implementation would be to simply reset to the default behaviour, perhaps using Param 5.
The text was updated successfully, but these errors were encountered: