Skip to content
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

Open
hamishwillee opened this issue Jun 17, 2015 · 8 comments

Comments

@hamishwillee
Copy link
Contributor

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.

@Guohao91
Copy link

@hamishwillee
Hi. Wonder if the raw command "mavutil.mavlink.MAV_CMD_CONDITION_YAW" can be used under NoGPS mode?

@hamishwillee
Copy link
Contributor Author

hamishwillee commented Jun 1, 2020

Edited: Deleted, Randy knows best (below) what is supported in different modes.

@rmackay9
Copy link
Contributor

rmackay9 commented Jun 1, 2020

@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.

@Guohao91
Copy link

Guohao91 commented Jun 1, 2020

@rmackay9 I mean try to call condition-yaw command while using the mode "Guided_NOGPS". Anyways, thanks your answer!

@rmackay9
Copy link
Contributor

rmackay9 commented Jun 2, 2020

@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.

@Guohao91
Copy link

Guohao91 commented Jun 2, 2020

@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.
well now, I am not so sure: does set-attitude-target mavlink messages recognize minus yaw angle? i.e. I typed : set_attitude(yaw_angle = -25, duration = 2). does this functionlly work?

@malfarizit
Copy link

@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.
well now, I am not so sure: does set-attitude-target mavlink messages recognize minus yaw angle? i.e. I typed : set_attitude(yaw_angle = -25, duration = 2). does this functionlly work?

yap u can use set attitude like this for guided_nogps.

@malfarizit
Copy link

anyone can change altitude on guided_nogps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants