Skip to content

Commit

Permalink
DESERT Release 3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fedefava86 committed Jan 29, 2025
1 parent 94da80a commit ac25ef6
Show file tree
Hide file tree
Showing 47 changed files with 3,921 additions and 908 deletions.
56 changes: 31 additions & 25 deletions DESERT_Addons/uwswarm_control/initlib.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
// Copyright (c) 2024 Regents of the SIGNET lab, University of Padova.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand All @@ -10,39 +10,42 @@
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. Neither the name of the University of Padova (SIGNET lab) nor the
// names of its contributors may be used to endorse or promote products
// 3. Neither the name of the University of Padova (SIGNET lab) nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/**
* @file initlib.cc
* @author Filippo Campagnaro, Vincenzo Cimino
* @author Vincenzo Cimino
* @version 1.0.0
*
* \brief Provides the initialization of uwswarm_control libraries.
*
* Provides the initialization of uwswarm_control libraries.
*
*
*/

#include <tclcl.h>
#include "uwsc-clmsg.h"
#include "uwsc-tracker-follower-packet.h"
#include <tclcl.h>

extern EmbeddedTcl Uwswarm_controlTclCode;

int hdr_uwSCFTracker::offset_; /**< Offset used to access in
<i>hdr_uwTracker</i> packets header. */

packet_t PT_UWSCFTRACKER;

ClMessage_t CLMSG_MC2CTR_SETPOS;
Expand All @@ -54,18 +57,21 @@ ClMessage_t CLMSG_TRACK2MC_GETSTATUS;
/**
* Adds the header for <i>hdr_uwTRACK</i> packets in ns2.
*/
static class UwSCFTrackPktClass : public PacketHeaderClass {
static class UwSCFTrackPktClass : public PacketHeaderClass
{
public:

UwSCFTrackPktClass() : PacketHeaderClass("PacketHeader/UWSCFTRACK", sizeof (hdr_uwSCFTracker)) {
this->bind();
bind_offset(&hdr_uwSCFTracker::offset_);
}
UwSCFTrackPktClass()
: PacketHeaderClass("PacketHeader/UWSCFTRACK", sizeof(hdr_uwSCFTracker))
{
this->bind();
bind_offset(&hdr_uwSCFTracker::offset_);
}
} class_uwSCFTRACK_pkt;

extern "C" int
Uwswarm_control_Init() {
PT_UWSCFTRACKER = p_info::addPacket("UWSCFTRACK");
extern "C" int
Uwswarm_control_Init()
{
PT_UWSCFTRACKER = p_info::addPacket("UWSCFTRACK");
CLMSG_MC2CTR_SETPOS = ClMessage::addClMessage();
CLMSG_MC2CTR_SETSTATUS = ClMessage::addClMessage();
CLMSG_CTR2MC_GETPOS = ClMessage::addClMessage();
Expand Down
26 changes: 3 additions & 23 deletions DESERT_Addons/uwswarm_control/uwsc-clmsg.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
// Copyright (c) 2024 Regents of the SIGNET lab, University of Padova.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -44,10 +44,6 @@ ClMsgCtr2McPosition::ClMsgCtr2McPosition(int dest_id)
{
}

ClMsgCtr2McPosition::~ClMsgCtr2McPosition()
{
}

ClMsgCtr2McPosition*
ClMsgCtr2McPosition::copy()
{
Expand All @@ -74,10 +70,6 @@ ClMsgMc2CtrPosition::ClMsgMc2CtrPosition(int dest_id)
{
}

ClMsgMc2CtrPosition::~ClMsgMc2CtrPosition()
{
}

ClMsgMc2CtrPosition*
ClMsgMc2CtrPosition::copy()
{
Expand All @@ -104,10 +96,6 @@ ClMsgMc2CtrStatus::ClMsgMc2CtrStatus(int dest_id)
{
}

ClMsgMc2CtrStatus::~ClMsgMc2CtrStatus()
{
}

ClMsgMc2CtrStatus*
ClMsgMc2CtrStatus::copy()
{
Expand All @@ -129,16 +117,12 @@ ClMsgMc2CtrStatus::getRovStatus() const
////////////////////////////////////////////////////////

ClMsgTrack2McPosition::ClMsgTrack2McPosition(int dest_id)
: ClMessage(CLMSG_TRACK2MC_VERBOSITY,
CLMSG_TRACK2MC_TRACKPOS, UNICAST, dest_id)
: ClMessage(CLMSG_TRACK2MC_VERBOSITY, CLMSG_TRACK2MC_TRACKPOS, UNICAST,
dest_id)
, track_position(nullptr)
{
}

ClMsgTrack2McPosition::~ClMsgTrack2McPosition()
{
}

ClMsgTrack2McPosition*
ClMsgTrack2McPosition::copy()
{
Expand Down Expand Up @@ -166,10 +150,6 @@ ClMsgTrack2McStatus::ClMsgTrack2McStatus(int dest_id)
{
}

ClMsgTrack2McStatus::~ClMsgTrack2McStatus()
{
}

ClMsgTrack2McStatus*
ClMsgTrack2McStatus::copy()
{
Expand Down
57 changes: 29 additions & 28 deletions DESERT_Addons/uwswarm_control/uwsc-clmsg.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Regents of the SIGNET lab, University of Padova.
// Copyright (c) 2024 Regents of the SIGNET lab, University of Padova.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -42,9 +42,9 @@
#include <clmessage.h>
#include <node-core.h>

#define CLMSG_MC2CTR_VERBOSITY 3 /**< Verbosity level. */
#define CLMSG_CTR2MC_VERBOSITY 3 /**< Verbosity level. */
#define CLMSG_TRACK2MC_VERBOSITY 3 /**< Verbosity level. */
#define CLMSG_MC2CTR_VERBOSITY 3 /**< Verbosity level. */
#define CLMSG_CTR2MC_VERBOSITY 3 /**< Verbosity level. */
#define CLMSG_TRACK2MC_VERBOSITY 3 /**< Verbosity level. */

extern ClMessage_t CLMSG_MC2CTR_SETPOS;
extern ClMessage_t CLMSG_MC2CTR_SETSTATUS;
Expand All @@ -64,30 +64,30 @@ class ClMsgCtr2McPosition : public ClMessage

/**
* Class constructor.
* @param dest_id id of the destination module
* @param int ID of the destination module
*/
ClMsgCtr2McPosition(int dest_id);

/**
* Destructor of ClMsgCtr2McPosition class.
*/
virtual ~ClMsgCtr2McPosition();
virtual ~ClMsgCtr2McPosition() = default;

/**
* Creates a copy of the object.
* @return Pointer to a copy of the object
* @return ClMsgCtr2McPosition* Pointer to a copy of the object
*/
ClMsgCtr2McPosition* copy();

/**
* Sets the ROV follower position.
* @param position rov follower current position
* @param Position* Pointer to rov follower current position
*/
void setRovPosition(Position* position);

/**
* Get the ROV follower current position.
* @return rov_position rov follower current position
* @return Position* Pointer to rov follower current position
*/
Position* getRovPosition() const;

Expand All @@ -105,29 +105,30 @@ class ClMsgMc2CtrPosition : public ClMessage

/**
* Class constructor
* @param dest_id id of the destination module
* @param int Id of the destination module
*/
ClMsgMc2CtrPosition(int dest_id);

/**
* Destructor of ClMsgMc2CtrPosition class.
*/
virtual ~ClMsgMc2CtrPosition();
virtual ~ClMsgMc2CtrPosition() = default;

/**
* Creates a copy of the object
* @return Pointer to a copy of the object
* @return ClMsgMc2CtrPosition* Pointer to a copy of the object
*/
ClMsgMc2CtrPosition* copy();

/**
* Sets the ROV follower destination.
* @param destination rov follower destination
* @param Position* Pointer to rov follower destination
*/
void setRovDestination(Position* destination);

/**
* Get the ROV follower destination. @return rov_destination rov follower destination
* Get the ROV follower destination.
* @return Position* Pointer to rov follower destination
*/
Position* getRovDestination() const;

Expand All @@ -146,30 +147,30 @@ class ClMsgMc2CtrStatus : public ClMessage

/**
* Class constructor.
* @param dest_id id of the destination module
* @param int ID of the destination module
*/
ClMsgMc2CtrStatus(int dest_id);

/**
* Destructor of ClMsgMc2CtrStatus class.
*/
virtual ~ClMsgMc2CtrStatus();
virtual ~ClMsgMc2CtrStatus() = default;

/**
* Creates a copy of the object.
* @return Pointer to a copy of the object
* @return ClMsgMc2CtrStatus* Pointer to a copy of the object
*/
ClMsgMc2CtrStatus* copy();

/**
* Sets the rov follower status.
* @param detect rov follower status
* @param bool Rov follower status
*/
void setRovStatus(bool detect);

/**
* Get the rov follower status.
* @return rov_detect rov follower status
* @return bool Rov follower status
*/
bool getRovStatus() const;

Expand All @@ -188,30 +189,30 @@ class ClMsgTrack2McPosition : public ClMessage

/**
* Class constructor.
* @param dest_id id of the destination module
* @param int Id of the destination module
*/
ClMsgTrack2McPosition(int dest_id);

/**
* Destructor of ClMsgTrack2McPosition class.
*/
virtual ~ClMsgTrack2McPosition();
virtual ~ClMsgTrack2McPosition() = default;

/**
* Creates a copy of the object.
* @return Pointer to a copy of the object
* @return ClMsgTrack2McPosition* Pointer to a copy of the object
*/
ClMsgTrack2McPosition* copy();

/**
* Sets the track position
* @param track_position Tracked position from UwTracker module
* @param Position* Tracked position from UwTracker module
*/
void setTrackPosition(Position* position);

/**
* Get the track position.
* @return track_position Tracked position from UwTracker module
* @return Position* Tracked position from UwTracker module
*/
Position* getTrackPosition() const;

Expand All @@ -236,23 +237,23 @@ class ClMsgTrack2McStatus : public ClMessage
/**
* Destructor of ClMsgTrack2McStatus class.
*/
virtual ~ClMsgTrack2McStatus();
virtual ~ClMsgTrack2McStatus() = default;

/**
* Creates a copy of the object.
* @return Pointer to a copy of the object
* @return ClMsgTrack2McStatus* Pointer to a copy of the object
*/
ClMsgTrack2McStatus* copy();

/**
* Sets the current mine status.
* @param remove status of the current mine
* @param bool Status of the current mine
*/
void setMineStatus(bool remove);

/**
* Get the current mine status.
* @return mine_status status of the current mine
* @return bool Status of the current mine
*/
bool getMineStatus() const;

Expand Down
Loading

0 comments on commit ac25ef6

Please sign in to comment.