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

Copter: support cw, ccw field of condition_yaw #1640

Closed
GrahamDyer opened this issue Nov 27, 2014 · 10 comments
Closed

Copter: support cw, ccw field of condition_yaw #1640

GrahamDyer opened this issue Nov 27, 2014 · 10 comments

Comments

@GrahamDyer
Copy link

Currently condition_yaw behaves like this:
*Copter facing north (0°) when armed, CCW = counter clock-wise:

Condition_yaw, 90°, CW, abs (0) = copter yaws 90° CW to face east (correct)
Condition_yaw, 270°, CW, rel (1) = copter yaws 90° CCW to face north (not 270° CW to face north!)

Condition_yaw, 90°, CCW , abs (0) = copter yaws 90° CW to face south (not 90° CCW to face north)
Condition_yaw, 270°, CCW, rel (1) = copter yaws 90° CCW to face north (not 270° CCW to face south!)

Condition_yaw, 90°, CW, abs (0) = copter yaws 90° CW to face east (correct)
Condition_yaw, 90°, CCW, rel (1) = copter yaws 90° CW to face south (not 90° CCW to face north! Same as previous)

So to fix this:
a) the copter needs to turn in the direction of the amount of degrees, so +270 should turn clockwise 270° not 90° counter clockwise to achieve 270°
or
b) CCW/CW instruction needs to be adhered to.

@GrahamDyer GrahamDyer changed the title Fix condition_yaw Copter: Fix condition_yaw Nov 27, 2014
@rmackay9
Copy link
Contributor

Yes, copter doesn't support the direction field. The code that needs to be changed is in the set_auto_yaw_look_at_heading() function. https://github.com/diydrones/ardupilot/blob/master/ArduCopter/control_auto.pde#L541
We support using the direction for relative angles but not for the absolute angles.

@paradisephill
Copy link

I think this is a documentation enhancement and not a code enhancement. I've found Condition-Yaw to work quite well, however the documentation (at http://copter.ardupilot.com/wiki/mission-command-list/#Condition-Yaw) is misleading and needs to be changed to the following:


Point the nose of the vehicle to the specified heading or change the heading by a specified amount.

Deg – the desired heading in degrees (0 = North, 90 = East, etc) when "abs" is specified or the change in heading when "rel" is specified.
Sec – not supported. meant to limit the rotation speed (in deg/sec) as the vehicle turns to the desired heading

Dir (1=CW, -1=CCW) – Used for a relative ("rel") yaw and denotes whether the flight controller should add (CW) or subtract (CCW) the degrees (Deg) from the current heading to calculate the target heading. The vehicle will always turn in direction that most quickly gets it to the new target heading regardless if CW or CCW are used.

rel/abs – allows specifying the heading (i.e “Deg” field) as an absolute heading (if “0”) or relative to the current heading (if “1”)

@rmackay9
Copy link
Contributor

@paradisephill,
I've updated the wiki with your changes, Thanks!

@GrahamDyer
Copy link
Author

So speed of rotation and the CW or CCW instruction do not work, I'll leave this open then.
In my application I need the çopter to do a slow 90° or 180° or 360° rotation (1-5 deg/sec) in a certain direction, this is not currently functioning.

@robustini
Copy link
Contributor

+1

@chris669
Copy link

chris669 commented Oct 9, 2015

Hi, one point with CONDITION_YAW, does the command need to be "sandwitched" between waypoints? Each time? My syntax is:
WAYPOINT 1
CONDITION_YAW 90° it works
WAYPOINT 2 it cancel the last CONDITION_YAW

So my question is, after each waypoint, I have to add a new CONDITION_LAW?
In my small bain, I could imagine something like:

WAYPOINT 1
CONDITION_YAW 90°
WAYPOINT 2
WAYPOINT 3
WAYPOINT 4
CONDITION_YAW 0° (or stop CONDITION_YAW)

Does it make some sense for other people than me?

Thanks for reading.

chris

@rmackay9 rmackay9 changed the title Copter: Fix condition_yaw Copter: support cw, ccw field of condition_yaw Oct 9, 2015
@rmackay9
Copy link
Contributor

rmackay9 commented Oct 9, 2015

@chris669, after each waypoint, by default the yaw will return to the WP_YAW_BEHAVIOR. So if you set that to "0" for example it will never try to control the yaw as part of the mission and it will continue to obey the condition-yaw commands across waypoints. Alternatively we could change it so that it always continues to obey the condition-yaw across waypoints but we'd need to figure out a way for the user to specify explicitly that they want the behaviour to return to the default.

@chris669
Copy link

chris669 commented Oct 9, 2015

Ok, thanks, I had WP_YAW_BEHAVIOR : 3 in my config, I will try it ASAP. I know that it's very difficult to satisfy everybody, and do not know what would be the best procedure to validate such "nice to have" features. Maybe listing what are the possibilities, and let the user choose if it's not possible to easy set a new parameter for this. Or define a group of beta testers? Another point, I've seen in the MP interface that by default the field "Dir" is set to 0. And then, in documentation http://copter.ardupilot.com/wiki/mission-command-list/#condition-yaw we have two possibilities for the value 1 and -1: (1=CW, -1=CCW) Used for a relative yaw. True values for this parameter is 0,1 or -1,1 ??? Thanks anyway for the good job, I will stay available for testing. A nice day.

@waTeim
Copy link

waTeim commented May 16, 2016

Following up here from the referenced dronekit issue. When operating in GUIDED mode, there is a need to control the yaw rate so that yaw angle transitions are not perceived to hitch from one angle to another, but rather smoothly and if possible continuously transition. This seems to be a longstanding limitation and related (in addition) to #1635, #1758, and #4134.

@IamPete1
Copy link
Member

IamPete1 commented Aug 6, 2021

closed by #17539

@IamPete1 IamPete1 closed this as completed Aug 6, 2021
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

7 participants