Skip to content

Commit

Permalink
mission_raw_server: match types for sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Aug 5, 2021
1 parent 1ac5ac6 commit 0178ded
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/plugins/mission_raw_server/mission_raw_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void MissionRawServerImpl::set_current_item_complete()
_parent->get_own_system_id(),
_parent->get_own_component_id(),
&mission_reached,
_current_seq);
static_cast<uint16_t>(_current_seq));
_parent->send_message(mission_reached);
if (_current_seq + 1 == _current_mission.size()) {
_mission_completed = true;
Expand All @@ -320,7 +320,7 @@ void MissionRawServerImpl::set_current_item_complete()
}
}

void MissionRawServerImpl::set_current_seq(uint16_t seq)
void MissionRawServerImpl::set_current_seq(std::size_t seq)
{
if (_current_mission.size() <= static_cast<size_t>(seq)) {
return;
Expand All @@ -337,8 +337,8 @@ void MissionRawServerImpl::set_current_seq(uint16_t seq)
_parent->get_own_system_id(),
_parent->get_own_component_id(),
&mission_current,
_current_seq);
static_cast<uint16_t>(_current_seq));
_parent->send_message(mission_current);
}

} // namespace mavsdk
} // namespace mavsdk
6 changes: 3 additions & 3 deletions src/plugins/mission_raw_server/mission_raw_server_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MissionRawServerImpl : public PluginImplBase {
std::atomic<bool> _stop_work_thread = false;

std::vector<MAVLinkMissionTransfer::ItemInt> _current_mission;
uint16_t _current_seq;
std::size_t _current_seq;

struct MissionData {
mutable std::recursive_mutex mutex{};
Expand All @@ -66,7 +66,7 @@ class MissionRawServerImpl : public PluginImplBase {
MAVLinkMissionTransfer::Result result,
const std::vector<MAVLinkMissionTransfer::ItemInt>& int_items);

void set_current_seq(uint16_t seq);
void set_current_seq(std::size_t seq);

void add_task(std::function<void()> task)
{
Expand All @@ -82,4 +82,4 @@ class MissionRawServerImpl : public PluginImplBase {
bool _enable_absolute_gimbal_yaw_angle{true};
};

} // namespace mavsdk
} // namespace mavsdk

0 comments on commit 0178ded

Please sign in to comment.