Skip to content

Commit 37190d4

Browse files
MaEtUgRsfuhrer
authored andcommitted
navigator: refactor naming of break instead of brake functions
1 parent b8a6024 commit 37190d4

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

src/modules/navigator/land.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Land::on_activation()
6060

6161
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
6262
&& _navigator->get_local_position()->xy_global) { // only execute if global position is valid
63-
_navigator->calculate_breaking_stop(_mission_item.lat, _mission_item.lon);
63+
_navigator->preproject_stop_point(_mission_item.lat, _mission_item.lon);
6464
}
6565

6666
mission_item_to_position_setpoint(_mission_item, &pos_sp_triplet->current);
@@ -89,8 +89,7 @@ Land::on_active()
8989
struct position_setpoint_triplet_s *pos_sp_triplet = _navigator->get_position_setpoint_triplet();
9090

9191
// create a wp in front of the VTOL while in back-transition, based on MPC settings that will apply in MC phase afterwards
92-
_navigator->calculate_breaking_stop(pos_sp_triplet->current.lat, pos_sp_triplet->current.lon);
93-
92+
_navigator->preproject_stop_point(pos_sp_triplet->current.lat, pos_sp_triplet->current.lon);
9493
_navigator->set_position_setpoint_triplet_updated();
9594
}
9695

src/modules/navigator/loiter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Loiter::set_loiter_position()
109109
setLoiterItemFromCurrentPositionSetpoint(&_mission_item);
110110

111111
} else if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
112-
setLoiterItemFromCurrentPositionWithBreaking(&_mission_item);
112+
setLoiterItemFromCurrentPositionWithBraking(&_mission_item);
113113

114114
} else {
115115
setLoiterItemFromCurrentPosition(&_mission_item);

src/modules/navigator/mission_block.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,11 +772,11 @@ MissionBlock::setLoiterItemFromCurrentPosition(struct mission_item_s *item)
772772
}
773773

774774
void
775-
MissionBlock::setLoiterItemFromCurrentPositionWithBreaking(struct mission_item_s *item)
775+
MissionBlock::setLoiterItemFromCurrentPositionWithBraking(struct mission_item_s *item)
776776
{
777777
setLoiterItemCommonFields(item);
778778

779-
_navigator->calculate_breaking_stop(item->lat, item->lon);
779+
_navigator->preproject_stop_point(item->lat, item->lon);
780780

781781
item->altitude = _navigator->get_global_position()->alt;
782782
item->loiter_radius = _navigator->get_loiter_radius();

src/modules/navigator/mission_block.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class MissionBlock : public NavigatorMode
183183
void setLoiterItemFromCurrentPositionSetpoint(struct mission_item_s *item);
184184

185185
void setLoiterItemFromCurrentPosition(struct mission_item_s *item);
186-
void setLoiterItemFromCurrentPositionWithBreaking(struct mission_item_s *item);
186+
void setLoiterItemFromCurrentPositionWithBraking(struct mission_item_s *item);
187187

188188
void setLoiterItemCommonFields(struct mission_item_s *item);
189189

src/modules/navigator/navigator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class Navigator : public ModuleBase<Navigator>, public ModuleParams
278278
void release_gimbal_control();
279279
void set_gimbal_neutral();
280280

281-
void calculate_breaking_stop(double &lat, double &lon);
281+
void preproject_stop_point(double &lat, double &lon);
282282

283283
void stop_capturing_images();
284284
void disable_camera_trigger();

src/modules/navigator/navigator_main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ void Navigator::run()
356356
if (_vstatus.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
357357
&& (get_position_setpoint_triplet()->current.type != position_setpoint_s::SETPOINT_TYPE_TAKEOFF)) {
358358

359-
calculate_breaking_stop(rep->current.lat, rep->current.lon);
359+
preproject_stop_point(rep->current.lat, rep->current.lon);
360360

361361
} else {
362362
// For fixedwings we can use the current vehicle's position to define the loiter point
@@ -467,7 +467,7 @@ void Navigator::run()
467467
if (_vstatus.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING
468468
&& (get_position_setpoint_triplet()->current.type != position_setpoint_s::SETPOINT_TYPE_TAKEOFF)) {
469469

470-
calculate_breaking_stop(rep->current.lat, rep->current.lon);
470+
preproject_stop_point(rep->current.lat, rep->current.lon);
471471
}
472472

473473
if (PX4_ISFINITE(curr->current.loiter_radius) && curr->current.loiter_radius > FLT_EPSILON) {
@@ -1588,7 +1588,7 @@ bool Navigator::geofence_allows_position(const vehicle_global_position_s &pos)
15881588
return true;
15891589
}
15901590

1591-
void Navigator::calculate_breaking_stop(double &lat, double &lon)
1591+
void Navigator::preproject_stop_point(double &lat, double &lon)
15921592
{
15931593
// For multirotors we need to account for the braking distance, otherwise the vehicle will overshoot and go back
15941594
const float course_over_ground = atan2f(_local_pos.vy, _local_pos.vx);

0 commit comments

Comments
 (0)