58 TclObject*
create(
int,
const char*
const*) {
77 Tcl& tcl = Tcl::instance();
80 if (strcasecmp(argv[1],
"setTrack") == 0) {
87 tcl.resultf(
"%s",
"position Setted\n");
91 tcl.resultf(
"%s",
"position error\n");
106 Position temp_position;
113 if((*it)->getDist(&temp_position) < 1e-3)
173 std::cout << NOW <<
"UwSCFTrackerModule::updateMineRemove()"
177 <<
" is detected" << std::endl;
199 double min_distance = new_track_position->getDist(&
auv_position);
206 if(distance < min_distance)
208 min_distance = distance;
209 new_track_position = pos;
214 std::cout << NOW <<
" UwSCFTrackerModule::updateTrackPosition()"
215 <<
"New track position: X = " << new_track_position->
getX()
216 <<
" Y = " << new_track_position->
getY()
217 <<
" Z = " << new_track_position->
getZ()
220 return new_track_position;
245 module->updateMineRemove();
virtual double getY()
Method that return the current projection of the node on the y-axis.
virtual double getX()
Method that return the current projection of the node on the x-axis.
virtual double getZ()
Method that return the current projection of the node on the z-axis.
virtual void setX(double x)
int debug_
Flag to enable several levels of debug.
UwSendTimer sendTmr_
Timer which schedules packet transmissions.
Class that represents the binding with the tcl configuration script.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
UwSCFTrackerModuleClass()
Constructor of the class.
UwSCFTrackerModule class is used to track mines via sonar and share tracking information via packets.
void updateMineRemove()
Update the mine measure.
virtual void stop() override
Stop to send packets.
FollowerState auv_state
Current state of the follower.
hdr_uwSCFTracker mine_measure
Detected mine packets.
void sendPkt()
Allocates, initialize and sends a packet with the default priority flag set from tcl.
virtual int command(int argc, const char *const *argv) override
TCL command interpreter.
UWSMPosition * updateTrackPosition()
Update the current track position with the nearest mine position.
@ DETECT
Detecting a mine.
double demine_period
Timer to schedule packets transmission.
virtual void start() override
Start to send packets.
virtual void initPkt(Packet *p) override
Initializes a monitoring data packet passed as argument with the default values.
std::vector< UWSMPosition * > mine_positions
Positions of the mines in the area.
UwSCFTrackerModule()
Default Constructor of UwSCFTrackerModule class.
Position auv_position
Current position of the follower.
UwUpdateMineStatus mine_timer
Timer to schedule detecting measurements.
UwTrackerModule class is used to track mobile nodes via sonar and share tracking information via pack...
virtual void stop()
Stop to send packets.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
UwUpdateTrackMeasure measure_timer
timer to schedule tracking measurements
double tracking_period
period between tracking measurements
void sendPkt()
Allocates, initialize and sends a packet with the default priority flag set from tcl.
hdr_uwTracker track_measure
Track position.
virtual void start()
Start to send packets.
virtual void initPkt(Packet *p)
Initializes a monitoring data packet passed as argument with the default values.
UWSMPosition * track_position
Track position.
virtual void expire(Event *e)
hdr_uwSCFTracker describes the position and status of the current detected mine.
float & timestamp()
Reference to the timestamp variable.
float & y()
Reference to the y variable.
float & x()
Reference to the x variable.
bool & mine_remove()
Reference to the speed variable.
float & z()
Reference to the z variable.
float & x()
Reference to the x variable.
float & z()
Reference to the z variable.
float & y()
Reference to the y variable.
UwSCFTrackerModuleClass class_module_uwSCFTracker
Provides the definition of the class UWSCFTRACKER.
#define HDR_UWSCFTRACK(p)