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

Rotwing takeoff update. #3269

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion conf/flight_plans/tudelft/rotating_wing_EHVB.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,21 @@
</block>
<block name="Start Engine" strip_button="Start Engines" strip_icon="on.png">
<call_once fun="rotwing_request_configuration(ROTWING_CONFIGURATION_HOVER)"/>
<call_once fun="nav_set_heading_current()"/>
<call_once fun="NavResurrect()"/>
<attitude pitch="0" roll="0" throttle="0" until="stage_time>10" vmode="throttle"/>
</block>
<block name="Wait takeoff">
<exception cond="stage_time > 10" deroute="Holding point"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should avoid using >' characters. Use @gtor@DEREF` if needed. See https://wiki.paparazziuav.org/wiki/Flight_Plans#Expressions

<attitude pitch="0" roll="0" throttle="0" until="(fabs(DegOfRad(stateGetNedToBodyEulers_f()->theta)) @LT 3.0) @AND (fabs(DegOfRad(stateGetNedToBodyEulers_f()->phi)) @LT 3.0)" vmode="throttle"/>
</block>
<block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<call_once fun="rotwing_request_configuration(ROTWING_CONFIGURATION_HOVER)"/>
<exception cond="agl_dist_valid @AND (agl_dist_value @GT 1.0)" deroute="Climb"/>
<call_once fun="autopilot_set_in_flight(true)"/><!-- this is a hack to solve INDI not being active fast enough -->

<call_once fun="NavSetWaypointHere(WP_CLIMB)"/>
<set var="stage_timer_msec" value="get_sys_time_msec()"/>
<attitude pitch="DegOfRad(stateGetNedToBodyEulers_f()->theta)" roll="DegOfRad(stateGetNedToBodyEulers_f()->phi)" throttle="0.75" until="(get_sys_time_msec()-stage_timer_msec)>250" vmode="throttle"/>
<attitude pitch="0" roll="0" throttle="0.75" until="stage_time>3" vmode="throttle"/>
</block>
<block name="Climb">
Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/firmwares/rotorcraft/navigation.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ void nav_init_stage(void)
}
}

uint32_t stage_timer_msec = 0;

Comment on lines +256 to +257
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add local variables directly to the flight plan. See: https://github.com/paparazzi/paparazzi/blob/master/conf/flight_plans/ENAC/fish_outdoor.xml#L44

#include <stdio.h>
void nav_periodic_task(void)
{
Expand Down
2 changes: 2 additions & 0 deletions sw/airborne/firmwares/rotorcraft/navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,6 @@ static inline void NavGlide(uint8_t wp_start, uint8_t wp_end)
*/
#define NavFollow(_i, _d, _h) {}

extern uint32_t stage_timer_msec;

#endif /* NAVIGATION_H */