Pose.hpp截图,我正在尝试catkin_make一个简单的包,并且我得到了错误
.../Pose.hpp:17:1: expected class-name before token...
.../Odometry.cpp:12:3: expected class-name before token...在此对负责任的Pose头文件进行采样如下:
#ifndef POSE_HPP
#define POSE_HPP
#include <string>
#include <vector>
#include <ostream>
#include "ros/serialization.h"
#include "ros/builtin_message_traits.h"
#include "ros/message_operations.h"
#include "ros/message.h"
#include "ros/time.h"
namespace turtle
{//line 17
template <class ContainerAllocator>
struct Pose_ : public ros::Message
{
typedef Pose_<ContainerAllocator> Type;
}; // struct Pose
...
} // namespace turtle在引用的头文件上,在odometry.cpp中引用,如
#include <geometry_msgs/TwistWithCovarianceStamped.h>
#include <tf/transform_datatypes.h>
#include <robot_localization_demo/odometry.hpp>
namespace robot_localization_demo {
TurtleOdometry::TurtleOdometry(ros::NodeHandle node_handle, double frequency):
node_handle_{node_handle},
turtle_pose_subscriber_{node_handle_.subscribe("turtle1/pose", 16, &TurtleOdometry::turtlePoseCallback, this)},
turtle_twist_publisher_{node_handle_.advertise<geometry_msgs::TwistWithCovarianceStamped>("turtle1/sensors/twist", 16)},
frequency_{frequency},
{//line 12
;
}测定仪也包括姿势。我在这里错过了什么?
发布于 2020-04-01 13:57:16
ros::Message的官方文件说:
对于基于模板的序列化和特性系统来说,这个基类是不可取的。
在官方源代码中,它看起来仍然是定义的,但是在我发现的一个控制版本中,整个类定义被#if 0删除了
namespace ros {
#if 0
class Message {
//
};
#endif
}因此,您很可能需要找到一个不同的基类。
https://stackoverflow.com/questions/60972362
复制相似问题