42#define HDR_UWROV_MONITORING(p) (hdr_uwROV_monitoring::access(p))
60 TclObject*
create(
int,
const char*
const*) {
73 Tcl& tcl = Tcl::instance();
75 if (strcasecmp(argv[1],
"setLeaderId") == 0) {
78 tcl.resultf(
"%s",
"leader_id Setted\n");
83 if (strcasecmp(argv[1],
"sendPosition") == 0) {
86 newX = std::atof(argv[2]);
87 newY = std::atof(argv[3]);
88 newZ = std::atof(argv[4]);
93 tcl.resultf(
"%s",
"position Setted");
98 if (strcasecmp(argv[1],
"sendPosition") == 0) {
101 newX = std::atof(argv[2]);
102 newY = std::atof(argv[3]);
103 newZ = std::atof(argv[4]);
104 speed = std::atof(argv[5]);
109 tcl.resultf(
"%s",
"position Setted");
121 Position temp_rov_position = Position();
122 temp_rov_position.setX(monitoring->
x());
123 temp_rov_position.setY(monitoring->
y());
124 temp_rov_position.setZ(monitoring->
z());
131 std::cout << NOW <<
" UwSCROVCtrModule::recv(Packet *p) ROV monitoring "
132 <<
"(" << m.getSource() <<
")"
133 <<
" position: X = " << temp_rov_position.getX()
134 <<
", Y = " << temp_rov_position.getY()
135 <<
", Z = " << temp_rov_position.getZ() << std::endl;
156 std::cout << NOW <<
" UwSCROVCtrModule::recvSyncClMsg(ClMessage* m)"
157 <<
" Set new destination of ROV " << m->getDest()
158 <<
" to position: X = " <<
newX <<
", Y = " <<
newY
159 <<
", Z = " <<
newZ << std::endl;
168 std::cout << NOW <<
" UwSCROVCtrModule::recvSyncClMsg(ClMessage* m)"
169 <<
" Mine detected at position: X = " <<
x_rov
171 <<
" is removed " << std::endl;
176 return UwCbrModule::recvSyncClMsg(m);
ClMessage_t CLMSG_MC2CTR_SETPOS
ClMessage_t CLMSG_MC2CTR_SETSTATUS
Class that manages cross layer messages that require the position of the ROV follower.
void setRovPosition(Position *position)
Sets the ROV follower position.
Class that manages cross layer messages that require the new destination of the ROV follower.
Class that manages cross layer messages that require the status of the ROV follower.
int debug_
Flag to enable several levels of debug.
UwROVCtrModule class is used to manage UWROVCtr packets and to collect statistics about them.
float y_rov
Y of the last ROV position monitored.
Packet * p
Sequence number of the last control packet sent.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
float x_rov
X of the last ROV position monitored.
float newY
Y of the new position sent to the ROV.
float newZ
Z of the new position sent to the ROV.
float z_rov
Z of the last ROV position monitored.
float newX
X of the new position sent to the ROV.
void reset_retx()
Reset retransmissions.
virtual void recv(Packet *)
Performs the reception of packets from upper and lower layers.
virtual void transmit()
Creates and transmits a packet.
float speed
Moving speed sent to the ROV.
Class that represents the binding with the tcl configuration script.
UwSCROVCtrModuleClass()
Constructor of the class.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
UwSCROVCtrModule class adds to the UwROVCtrModule class the possibility to receive and send cross lay...
virtual void recv(Packet *) override
Performs the reception of packets from upper and lower layers.
bool rov_status
Status of the ROV follower, true if detected a mine.
int leader_id
Id of the Mission Coordinator module.
virtual int command(int argc, const char *const *argv) override
TCL command interpreter.
virtual int recvSyncClMsg(ClMessage *m) override
Recv syncronous cross layer messages to require an operation from another module.
UwSCROVCtrModule()
Constructor of UwSCROVCtrModule class.
hdr_uwROV_monitoring describes UWROV_monitoring packets sent by the ROV to the base station for monit...
#define HDR_UWROV_MONITORING(p)
UwSCROVCtrModuleClass class_module_uwROV_ctr
Provides the definition of the class UWSCROVCTR.