DESERT 3.5.1
Loading...
Searching...
No Matches
uwsc-clmsg.cc
Go to the documentation of this file.
1//
2// Copyright (c) 2024 Regents of the SIGNET lab, University of Padova.
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// 1. Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// 2. Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in the
12// documentation and/or other materials provided with the distribution.
13// 3. Neither the name of the University of Padova (SIGNET lab) nor the
14// names of its contributors may be used to endorse or promote products
15// derived from this software without specific prior written permission.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
38#include "uwsc-clmsg.h"
39
40
42 : ClMessage(CLMSG_CTR2MC_VERBOSITY, CLMSG_CTR2MC_GETPOS, UNICAST, dest_id)
43 , rov_position(nullptr)
44{
45}
46
49{
50 return new ClMsgCtr2McPosition(*this);
51}
52
53void
55{
56 rov_position = position;
57}
58
59Position*
64
66
68 : ClMessage(CLMSG_MC2CTR_VERBOSITY, CLMSG_MC2CTR_SETPOS, UNICAST, dest_id)
69 , rov_destination(nullptr)
70{
71}
72
75{
76 return new ClMsgMc2CtrPosition(*this);
77}
78
79void
81{
82 rov_destination = destination;
83}
84
85Position*
90
92
94 : ClMessage(CLMSG_MC2CTR_VERBOSITY, CLMSG_MC2CTR_SETSTATUS, UNICAST, dest_id)
95 , rov_status(false)
96{
97}
98
101{
102 return new ClMsgMc2CtrStatus(*this);
103}
104
105void
107{
108 rov_status = status;
109}
110
111bool
113{
114 return rov_status;
115}
116
118
121 dest_id)
122 , track_position(nullptr)
123{
124}
125
128{
129 return new ClMsgTrack2McPosition(*this);
130}
131
132void
134{
135 track_position = position;
136}
137
138Position*
143
145
147 : ClMessage(CLMSG_TRACK2MC_VERBOSITY,
148 CLMSG_TRACK2MC_GETSTATUS, UNICAST, dest_id)
149 , mine_status(false)
150{
151}
152
155{
156 return new ClMsgTrack2McStatus(*this);
157}
158
159void
161{
162 mine_status = remove;
163}
164
165bool
ClMessage_t CLMSG_MC2CTR_SETPOS
ClMessage_t CLMSG_TRACK2MC_TRACKPOS
ClMessage_t CLMSG_CTR2MC_GETPOS
ClMessage_t CLMSG_TRACK2MC_GETSTATUS
ClMessage_t CLMSG_MC2CTR_SETSTATUS
Class that manages cross layer messages that require the position of the ROV follower.
Definition uwsc-clmsg.h:62
ClMsgCtr2McPosition * copy()
Creates a copy of the object.
Definition uwsc-clmsg.cc:48
ClMsgCtr2McPosition(int dest_id)
Class constructor.
Definition uwsc-clmsg.cc:41
Position * rov_position
Rov follower current position.
Definition uwsc-clmsg.h:95
void setRovPosition(Position *position)
Sets the ROV follower position.
Definition uwsc-clmsg.cc:54
Position * getRovPosition() const
Get the ROV follower current position.
Definition uwsc-clmsg.cc:60
Class that manages cross layer messages that require the new destination of the ROV follower.
Definition uwsc-clmsg.h:103
Position * getRovDestination() const
Get the ROV follower destination.
Definition uwsc-clmsg.cc:86
ClMsgMc2CtrPosition(int dest_id)
Class constructor.
Definition uwsc-clmsg.cc:67
void setRovDestination(Position *destination)
Sets the ROV follower destination.
Definition uwsc-clmsg.cc:80
Position * rov_destination
Rov follower new destination.
Definition uwsc-clmsg.h:137
ClMsgMc2CtrPosition * copy()
Creates a copy of the object.
Definition uwsc-clmsg.cc:74
Class that manages cross layer messages that require the status of the ROV follower.
Definition uwsc-clmsg.h:145
bool rov_status
Status of the rov follower, true if detected a mine.
Definition uwsc-clmsg.h:179
ClMsgMc2CtrStatus(int dest_id)
Class constructor.
Definition uwsc-clmsg.cc:93
ClMsgMc2CtrStatus * copy()
Creates a copy of the object.
bool getRovStatus() const
Get the rov follower status.
void setRovStatus(bool detect)
Sets the rov follower status.
Class that manages cross layer messages that require the track position of the ROV follower.
Definition uwsc-clmsg.h:187
Position * track_position
Track position received from UwTracker module.
Definition uwsc-clmsg.h:220
ClMsgTrack2McPosition * copy()
Creates a copy of the object.
ClMsgTrack2McPosition(int dest_id)
Class constructor.
void setTrackPosition(Position *position)
Sets the track position.
Position * getTrackPosition() const
Get the track position.
Class that manages cross layer messages that require the status of a mine tracked from a rov follower...
Definition uwsc-clmsg.h:228
ClMsgTrack2McStatus(int dest_id)
Class constructor.
bool getMineStatus() const
Get the current mine status.
void setMineStatus(bool remove)
Sets the current mine status.
ClMsgTrack2McStatus * copy()
Creates a copy of the object.
bool mine_status
Status of the current mine; true if removed, false otherwise.
Definition uwsc-clmsg.h:262
#define CLMSG_TRACK2MC_VERBOSITY
Verbosity level.
Definition uwsc-clmsg.h:47
#define CLMSG_MC2CTR_VERBOSITY
Verbosity level.
Definition uwsc-clmsg.h:45
#define CLMSG_CTR2MC_VERBOSITY
Verbosity level.
Definition uwsc-clmsg.h:46