#include <ros/ros.h>
#include <geometry_msgs/PoseStamped.h>
#include <visualization_msgs/Marker.h> /*rviz中使用MarkerArray绘制地图线*/
#include <visualization_msgs/MarkerArray.h>
#include <message_filters/subscriber.h> /*使用message_filters进行多传感器消息同步*/
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <std_msgs/Float32.h>
#include <tf/transform_datatypes.h> /*tf坐标变换*/
#include <fstream> /*文件指针,fstream类同时支持>>和<<操作符,即能输出输入文件。
ofstream是从内存到硬盘,ifstream是从硬盘到内存;Ifstream类支持>>操作符,ofstream类支持<<操作符;一个输入文件,一个输出文件*/
#include "libwaypoint_follower/libwaypoint_follower.h"
static const int SYNC_FRAMES = 50;
/*
使用关键字 typedef 可以为类型起一个新的别名。typedef 的用法一般为:
typedef oldName newName;
oldName 是类型原来的名字,newName 是类型新的名字。例如:
typedef int INTEGER;
INTEGER a, b;
a = 1;
b = 2;
INTEGER a, b;等效于int a, b;。
*/
typedef message_filters::sync_policies::ApproximateTime<geometry_msgs::TwistStamped, geometry_msgs::PoseStamped>
TwistPoseSync;
/* C++中使用关键字 class 来定义类, 其基本形式如下:
class 类名
{
public 与 private 为属性/方法限制的关键字
public:
//公共的行为或属性 public 表示公开的属性和方法, 外界可以直接访问或者调用
private:
//公共的行为或属性 private 表示该部分内容是私密的, 不能被外部所访问或调用, 只能被本类内部访问
};
*/
class WaypointSaver
{
public:
WaypointSaver();
~WaypointSaver();
private:
// functions
/*
一般情况下,返回类型是void的函数使用return语句是为了引起函数的强制结束,这种return的用法类似于循环结构中的break语句的作用。
示例一:交换两个整型变量数值的函数
#include <iostream>
using namespace std;
void swap(int& a, int&b)
{
if(a == b)
{
return;//若两值相等,无需
(一)学习笔记autoware源码core_planning(waypoint_saver)
最新推荐文章于 2024-05-29 08:47:34 发布