18 #ifndef ROS_POSE_EXTRAPOLATOR_ROS_POSE_EXTRAPOLATOR_NODELET_H_
19 #define ROS_POSE_EXTRAPOLATOR_ROS_POSE_EXTRAPOLATOR_NODELET_H_
21 #include <ff_msgs/EkfState.h>
22 #include <ff_msgs/FlightMode.h>
23 #include <ff_msgs/GraphLocState.h>
24 #include <ff_msgs/GraphVIOState.h>
25 #include <ff_msgs/Heartbeat.h>
29 #include <ros/node_handle.h>
30 #include <ros/publisher.h>
31 #include <ros/subscriber.h>
32 #include <sensor_msgs/Imu.h>
33 #include <tf2_ros/transform_broadcaster.h>
35 #include <boost/optional.hpp>
45 void Initialize(ros::NodeHandle* nh)
final;
47 void SubscribeAndAdvertise(ros::NodeHandle* nh);
49 void ImuCallback(
const sensor_msgs::Imu::ConstPtr& imu_msg);
51 void FlightModeCallback(ff_msgs::FlightMode::ConstPtr
const&
mode);
53 void LocalizationStateCallback(
const ff_msgs::GraphLocState::ConstPtr& graph_loc_state_msg);
55 void GraphVIOStateCallback(
const ff_msgs::GraphVIOState::ConstPtr& graph_vio_state_msg);
57 boost::optional<ff_msgs::EkfState> PublishLatestExtrapolatedLocalizationState();
59 void PublishPoseAndTwistAndTransform(
const ff_msgs::EkfState& loc_msg);
63 void PublishHeartbeat();
66 std::string platform_name_;
67 ros::NodeHandle imu_nh_, loc_nh_, vio_nh_;
68 ros::CallbackQueue imu_queue_, loc_queue_, vio_queue_;
69 ros::Subscriber imu_sub_, flight_mode_sub_, loc_sub_, vio_sub_;
70 ros::Publisher state_pub_, pose_pub_, twist_pub_, heartbeat_pub_;
71 ff_msgs::Heartbeat heartbeat_;
72 tf2_ros::TransformBroadcaster transform_pub_;
75 boost::optional<ros::Time> last_state_msg_time_;
79 #endif // ROS_POSE_EXTRAPOLATOR_ROS_POSE_EXTRAPOLATOR_NODELET_H_