运行roscore,turtlesim
设置速度rosparam set /publish_velocity/max_vel 1
//发布者程序,改进最大速度版,教程的老是撞墙,重新调整了角度
//先手动设置rosparam set /publish_velocity/max_vel 1 速度为一避免有那种撞墙的反应
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>//这里使用了turtlesim的消息类型
#include <cstdlib>//使用随机函数
int main(int argc,char **argv)
{
//创建发布者对象,声明发布类型和发布的topic,并且,这里的topic恰好是乌龟默认的turtle1/cmd_vel
//当我们不使用默认名称