Skip to content

Commit

Permalink
Added NAV_HYBRID_GOTO_MODE as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
tmldeponti committed Apr 11, 2024
1 parent 7b626f0 commit d7df024
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions sw/airborne/modules/nav/nav_rotorcraft_hybrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ float nav_hybrid_pos_gain = 1.0f;
bool force_forward = 0.0f;
#endif

#ifndef NAV_OPTITRACK
#define NAV_OPTITRACK FALSE
#ifndef NAV_HYBRID_GOTO_MODE
#define NAV_HYBRID_GOTO_MODE NAV_SETPOINT_MODE_SPEED
#endif

/** Implement basic nav function for the hybrid case
*/

Expand Down Expand Up @@ -123,13 +124,7 @@ static void nav_hybrid_goto(struct EnuCoor_f *wp)

VECT2_COPY(nav.speed, speed_sp);
nav.horizontal_mode = NAV_HORIZONTAL_MODE_WAYPOINT;

// In optitrack tests use position mode for more precise hovering
if (NAV_OPTITRACK){
nav.setpoint_mode = NAV_SETPOINT_MODE_POS;
}else{
nav.setpoint_mode = NAV_SETPOINT_MODE_SPEED;
}
nav.setpoint_mode = NAV_HYBRID_GOTO_MODE;
}

static void nav_hybrid_route(struct EnuCoor_f *wp_start, struct EnuCoor_f *wp_end)
Expand Down

0 comments on commit d7df024

Please sign in to comment.