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

Invalid setpoint yaw after takeoff #7313

Closed
imrhch opened this issue May 30, 2017 · 3 comments
Closed

Invalid setpoint yaw after takeoff #7313

imrhch opened this issue May 30, 2017 · 3 comments

Comments

@imrhch
Copy link

imrhch commented May 30, 2017

https://github.com/PX4/Firmware/blob/master/src/modules/navigator/mission_block.cpp#L528

I believe sp.yaw_valid should be set correctly in the MissionBlock::mission_item_to_position_setpoint according to (mission) item->yaw.
When yaw_valid is already true (in my case it was set when taking off using MAV_CMD_NAV_TAKEOFF) and mission_item_to_position_setpoint is called with mission item containing yaw=NAN (is happens whan take-off is finished: https://github.com/PX4/Firmware/blob/master/src/modules/navigator/takeoff.cpp#L95), the yaw remains set to NAN and the yaw_valid remains true. When I switch to offboard (without valid yaw set), NAN value from yaw propagates thru the control and causes invalidating attitude setpoint (most values are set to NAN). This leads to instant crash.

@imrhch
Copy link
Author

imrhch commented Jun 1, 2017

It seems that adding line
sp->yaw_valid = !isnanf(item->yaw);
after this one
https://github.com/PX4/Firmware/blob/master/src/modules/navigator/mission_block.cpp#L528
solves the problem.

Without changing the firmware, I was able to overcome the problem by sending few SET_POSITION_TARGET_LOCAL_NED messages with yaw set just after switching to offboard mode and return to sending yaw_rate only after short time.

@sanderux
Copy link
Member

Could you add a pr on this?

@Seanmatthews
Copy link
Contributor

@imrhch @sanderux Created the pull request to get this out of the way, and loosely deals with some issues on which I've been working.

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

No branches or pull requests

4 participants