📄 rfidaction.cpp
字号:
#include <iostream>#include <iomanip>#include "RFIDAction.h"#include "msg_types.h"#include "ipc/ipc.h"#include "util/timeutil.h"#include "util/robotId.h"#include "com/ipc_com.h"RFIDAction::RFIDAction(){ _tagCount=0; _lastDeployTime.tv_sec = 0; _lastDeployTime.tv_usec = 0;}RFIDAction::~RFIDAction(){}int RFIDAction::deployTag(){ timeval now; gettimeofday(&now,0); double diff = TimevalDiff(&now, &_lastDeployTime); if (diff > MIN_WAIT_TIME_BETWEEN_DEPLOYMENT) { rescue_rfid_actuator_message msg; msg.triggerTag=1; msg.robot.id = getRobotId(); msg.robot.ts = getCurrentTime(); ComPublishToRobot(RESCUE_RFID_ACTUATOR_NAME, &msg); gettimeofday(&_lastDeployTime,0); return _tagCount++; } return -1;}/********************************************************************* * (C) Copyright 2006 Albert Ludwigs University Freiburg * Institute of Computer Science * * All rights reserved. Use of this software is permitted for * non-commercial research purposes, and it may be copied only * for that use. All copies must include this copyright message. * This software is made available AS IS, and neither the authors * nor the Albert Ludwigs University Freiburg make any warranty * about the software or its performance. *********************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -