48 #ifndef FASTRACK_SENSOR_SENSOR_H 49 #define FASTRACK_SENSOR_SENSOR_H 54 #include <visualization_msgs/Marker.h> 55 #include <geometry_msgs/TransformStamped.h> 56 #include <tf2_ros/transform_listener.h> 61 template<
typename E,
typename M,
typename P>
123 template<
typename E,
typename M,
typename P>
125 name_ = ros::names::append(n.getNamespace(),
"Sensor");
128 ROS_ERROR(
"%s: Failed to load parameters.",
name_.c_str());
133 ROS_ERROR(
"%s: Failed to register callbacks.",
name_.c_str());
138 if (!
env_.Initialize(n)) {
139 ROS_ERROR(
"%s: Failed to initialize environment.",
name_.c_str());
149 template<
typename E,
typename M,
typename P>
151 ros::NodeHandle nl(n);
154 if (!nl.getParam(
"topic/sensor_pub",
sensor_topic_))
return false;
155 if (!nl.getParam(
"vis/sensor",
vis_topic_))
return false;
158 if (!nl.getParam(
"frame/fixed",
fixed_frame_))
return false;
159 if (!nl.getParam(
"frame/sensor",
sensor_frame_))
return false;
162 if (!nl.getParam(
"time_step",
time_step_))
return false;
168 template<
typename E,
typename M,
typename P>
170 ros::NodeHandle nl(n);
176 vis_pub_ = nl.advertise<visualization_msgs::Marker>(
187 template<
typename E,
typename M,
typename P>
tf2_ros::TransformListener tf_listener_
std::string sensor_frame_
std::string sensor_topic_
void TimerCallback(const ros::TimerEvent &e)
bool RegisterCallbacks(const ros::NodeHandle &n)
virtual bool LoadParameters(const ros::NodeHandle &n)
ros::Publisher sensor_pub_
virtual void Visualize() const =0
tf2_ros::Buffer tf_buffer_
bool Initialize(const ros::NodeHandle &n)
virtual void UpdateParameters()=0