⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 robotaction.cpp

📁 一个简单使用的控制器
💻 CPP
字号:
#include <iostream>#include <iomanip>#include "RobotAction.h"#include "OdometryState.h"#include "msg_types.h"#include "ipc/ipc.h"#include "util/timeutil.h"#include "util/robotId.h"#include "com/ipc_com.h"RobotAction::RobotAction(bool useKalmanPoses){   odometry = OdometryState::getSingleton(useKalmanPoses);}RobotAction::~RobotAction(){}void RobotAction::setVelocity(int tv, int rv){   rescue_velocity_message msg;   msg.transVel = tv;   msg.rotVel = rv;   msg.robot.id = getRobotId();   msg.robot.ts = getCurrentTime();   ComPublishToRobot(RESCUE_VELOCITY_NAME, &msg);}void RobotAction::setMotorStop(){   rescue_motor_message msg;   msg.motorCommand=2;   msg.robot.id = getRobotId();   msg.robot.ts = getCurrentTime();   ComPublishToRobot(RESCUE_MOTOR_NAME, &msg);}void RobotAction::setMotorOff(){   rescue_motor_message msg;   msg.motorCommand=0;   msg.robot.id = getRobotId();   msg.robot.ts = getCurrentTime();   ComPublishToRobot(RESCUE_MOTOR_NAME, &msg);}void RobotAction::setMotorOn(){   rescue_motor_message msg;   msg.motorCommand=1;   msg.robot.id = getRobotId();   msg.robot.ts = getCurrentTime();   ComPublishToRobot(RESCUE_MOTOR_NAME, &msg);}/********************************************************************* * (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 + -