Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tag ID and Radius to Autonomy Waypoint Packets #52

Merged
merged 6 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/RoveComm
Submodule RoveComm updated 2 files
+2 −2 README.md
+2 −2 manifest.json
47 changes: 24 additions & 23 deletions src/RoveComm/RoveCommManifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*
* @file RoveCommManifest.h
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
*
* @copyright Copyright Mars Rover Design Team 2024 - All Rights Reserved
* @copyright Copyright Mars Rover Design Team 2025 - All Rights Reserved
******************************************************************************/

#ifndef MANIFEST_H
Expand All @@ -25,7 +25,7 @@ namespace manifest
* @brief Enumeration of Data Types to be used in RoveComm
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
enum DataTypes
{
Expand All @@ -44,7 +44,7 @@ namespace manifest
* @brief IP Address Object for RoveComm.
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
struct AddressEntry
{
Expand All @@ -60,7 +60,7 @@ namespace manifest
* @brief Manifest Entry Object for RoveComm.
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
struct ManifestEntry
{
Expand All @@ -74,7 +74,7 @@ namespace manifest
* @brief Core Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Core
{
Expand Down Expand Up @@ -134,7 +134,7 @@ namespace manifest
* @brief PMS Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace PMS
{
Expand Down Expand Up @@ -174,7 +174,7 @@ namespace manifest
* @brief Nav Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Nav
{
Expand Down Expand Up @@ -203,7 +203,7 @@ namespace manifest
* @brief BaseStationNav Board IP Address, Commands, Telemetry, and Error
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace BaseStationNav
{
Expand All @@ -222,7 +222,7 @@ namespace manifest
* @brief SignalStack Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace SignalStack
{
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace manifest
* @brief Arm Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Arm
{
Expand Down Expand Up @@ -294,7 +294,7 @@ namespace manifest
* @brief ScienceActuation Board IP Address, Commands, Telemetry, and Error
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace ScienceActuation
{
Expand Down Expand Up @@ -337,7 +337,7 @@ namespace manifest
* @brief Autonomy Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Autonomy
{
Expand All @@ -349,8 +349,9 @@ namespace manifest
{"STARTAUTONOMY", ManifestEntry{11000, 1, DataTypes::UINT8_T}},
{"DISABLEAUTONOMY", ManifestEntry{11001, 1, DataTypes::UINT8_T}},
{"ADDPOSITIONLEG", ManifestEntry{11002, 2, DataTypes::DOUBLE_T}},
{"ADDMARKERLEG", ManifestEntry{11003, 2, DataTypes::DOUBLE_T}},
{"ADDOBJECTLEG", ManifestEntry{11004, 2, DataTypes::DOUBLE_T}},
{"ADDMARKERLEG", ManifestEntry{11003, 4, DataTypes::DOUBLE_T}},
{"ADDOBJECTLEG", ManifestEntry{11004, 3, DataTypes::DOUBLE_T}},
{"ADDOBSTACLE", ManifestEntry{11008, 3, DataTypes::DOUBLE_T}},
{"CLEARWAYPOINTS", ManifestEntry{11005, 1, DataTypes::UINT8_T}},
{"SETMAXSPEED", ManifestEntry{11006, 1, DataTypes::FLOAT_T}},
{"SETLOGGINGLEVELS", ManifestEntry{11007, 3, DataTypes::UINT8_T}},
Expand Down Expand Up @@ -401,7 +402,7 @@ namespace manifest
* @brief Camera1 Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Camera1
{
Expand Down Expand Up @@ -432,7 +433,7 @@ namespace manifest
* @brief Camera2 Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Camera2
{
Expand All @@ -458,7 +459,7 @@ namespace manifest
* @brief CameraServer Board IP Address, Commands, Telemetry, and Error
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace CameraServer
{
Expand Down Expand Up @@ -495,7 +496,7 @@ namespace manifest
* @brief IRSpectrometer Board IP Address, Commands, Telemetry, and Error
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace IRSpectrometer
{
Expand All @@ -514,7 +515,7 @@ namespace manifest
* @brief Instruments Board IP Address, Commands, Telemetry, and Error Packet
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Instruments
{
Expand Down Expand Up @@ -548,7 +549,7 @@ namespace manifest
* @brief RoveComm General Information
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace General
{
Expand All @@ -563,7 +564,7 @@ namespace manifest
* @brief RoveComm System Information
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace System
{
Expand All @@ -579,7 +580,7 @@ namespace manifest
* @brief RoveComm Helper Functions
*
* @author Missouri S&T - Mars Rover Design Team
* @date 2024-11-14
* @date 2025-01-06
******************************************************************************/
namespace Helpers
{
Expand Down
10 changes: 7 additions & 3 deletions src/RoveComm/RoveCommPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ namespace rovecomm
// INT8_T, UINT8_T, CHAR
if constexpr (sizeof(T) == sizeof(uint8_t))
{
// No need to convert to network order.
memcpy(pDataPtr, &pPacketData[unInter], sizeof(uint8_t));
pDataPtr += sizeof(uint8_t);
// Check if unIter is within the bounds of the packet data.
if (unInter < stPacket.vData.size())
{
// No need to convert to network order.
memcpy(pDataPtr, &pPacketData[unInter], sizeof(uint8_t));
pDataPtr += sizeof(uint8_t);
}
}
// INT16_T, UINT16_T
else if constexpr (sizeof(T) == sizeof(uint16_t))
Expand Down
Loading