-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update repository to be compatible with the new VRTK2 software
- Loading branch information
Facundo Garcia
committed
Oct 7, 2024
1 parent
0a7922f
commit 84a4c9d
Showing
40 changed files
with
1,669 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* @file | ||
* @brief Implementation of FP_A-EOE parser | ||
* | ||
* \verbatim | ||
* ___ ___ | ||
* \ \ / / | ||
* \ \/ / Fixposition AG | ||
* / /\ \ All right reserved. | ||
* /__/ \__\ | ||
* \endverbatim | ||
* | ||
*/ | ||
|
||
/* PACKAGE */ | ||
#include <fixposition_driver_lib/messages/fpa_type.hpp> | ||
#include <fixposition_driver_lib/messages/base_converter.hpp> | ||
|
||
namespace fixposition { | ||
|
||
/// msg field indices | ||
static constexpr int msg_type_idx = 1; | ||
static constexpr int msg_version_idx = 2; | ||
static constexpr int gps_week_idx = 3; | ||
static constexpr int gps_tow_idx = 4; | ||
static constexpr int epoch_idx = 5; | ||
|
||
void FP_EOE::ConvertFromTokens(const std::vector<std::string>& tokens) { | ||
bool ok = tokens.size() == kSize_; | ||
if (!ok) { | ||
// Size is wrong | ||
std::cout << "Error in parsing FP_A-EOE string with " << tokens.size() << " fields!\n"; | ||
} else { | ||
// If size is ok, check version | ||
const int _version = std::stoi(tokens.at(msg_version_idx)); | ||
|
||
ok = _version == kVersion_; | ||
if (!ok) { | ||
// Version is wrong | ||
std::cout << "Error in parsing FP_A-EOE string with version " << _version << "!\n"; | ||
} | ||
} | ||
|
||
if (!ok) { | ||
// Reset message and return | ||
ResetData(); | ||
return; | ||
} | ||
|
||
// Parse time | ||
stamp = ConvertGpsTime(tokens.at(gps_week_idx), tokens.at(gps_tow_idx)); | ||
|
||
// Populate fields | ||
epoch = tokens.at(epoch_idx); | ||
} | ||
|
||
} // namespace fixposition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.