ros_subcribe

#include

#include

#include

#include

// 电机引脚定义

const int enA = 9;

const int in1 = 5;

const int in2 = 6;

const int enB = 10;

const int in3 = 7;

const int in4 = 8;

// 速度设置

const int rotationSpeed = 200; // 左转右转速度

const int moveSpeed = 200; // 前进后退速度

// 全局变量

float angle = 0.0;

int time_interval = 0;

bool angle_received = false;

bool time_received = false;

bool rotation_done = false;

bool executing = false; // 当前是否在执行中,避免提前接收新指令

ros::NodeHan

你可能感兴趣的:(机器人,笔记)