From f8905e20805ce9a2eaf4cc0d2b4d60f8fb69498d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Caruso?= <niccolo.caruso@skywarder.eu> Date: Wed, 2 Oct 2024 15:17:14 +0200 Subject: [PATCH] [GS/ARP] System and component ID updated System ID and component ID updated, now ARP/GS have different systems ID --- .../Groundstation/Common/Config/GeneralConfig.h | 12 +++++++----- src/boards/Groundstation/LyraGS/BoardStatus.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/boards/Groundstation/Common/Config/GeneralConfig.h b/src/boards/Groundstation/Common/Config/GeneralConfig.h index b7c8b8d3f..9d0314170 100644 --- a/src/boards/Groundstation/Common/Config/GeneralConfig.h +++ b/src/boards/Groundstation/Common/Config/GeneralConfig.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2023 Skyward Experimental Rocketry - * Author: Davide Mor +/* Copyright (c) 2023-2024 Skyward Experimental Rocketry + * Authors: Davide Mor, Nicolò Caruso * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,12 +22,14 @@ #pragma once -#include <cstdint> +#include <common/Mavlink.h> +#include <cstdint> namespace Groundstation { - +constexpr uint8_t GS_SYSTEM_ID = SysIDs::MAV_SYSID_GS; constexpr uint8_t GS_COMPONENT_ID = 1; -constexpr uint8_t GS_SYSTEM_ID = 1; +constexpr uint8_t ARP_SYSTEM_ID = SysIDs::MAV_SYSID_ARP; +constexpr uint8_t ARP_COMPONENT_ID = 1; } // namespace Groundstation \ No newline at end of file diff --git a/src/boards/Groundstation/LyraGS/BoardStatus.cpp b/src/boards/Groundstation/LyraGS/BoardStatus.cpp index b65ce88af..03038a32f 100644 --- a/src/boards/Groundstation/LyraGS/BoardStatus.cpp +++ b/src/boards/Groundstation/LyraGS/BoardStatus.cpp @@ -123,8 +123,8 @@ void BoardStatus::arpRoutine() } mavlink_message_t msg; - mavlink_msg_arp_tm_encode(SysIDs::MAV_SYSID_ARP, - Groundstation::GS_COMPONENT_ID, &msg, &tm); + mavlink_msg_arp_tm_encode(Groundstation::ARP_SYSTEM_ID, + Groundstation::ARP_COMPONENT_ID, &msg, &tm); getModule<HubBase>()->dispatchIncomingMsg(msg); } @@ -181,7 +181,8 @@ void BoardStatus::GSRoutine() } mavlink_message_t msg; - mavlink_msg_arp_tm_encode(GS_SYSTEM_ID, GS_COMPONENT_ID, &msg, &tm); + mavlink_msg_arp_tm_encode(Groundstation::GS_SYSTEM_ID, GS_COMPONENT_ID, + &msg, &tm); getModule<HubBase>()->dispatchIncomingMsg(msg); } -- GitLab