18 #ifndef IMU_AUGMENTOR_IMU_AUGMENTOR_NODELET_H_
19 #define IMU_AUGMENTOR_IMU_AUGMENTOR_NODELET_H_
21 #include <ff_msgs/EkfState.h>
22 #include <ff_msgs/FlightMode.h>
23 #include <ff_msgs/GraphState.h>
24 #include <ff_msgs/Heartbeat.h>
28 #include <ros/node_handle.h>
29 #include <ros/publisher.h>
30 #include <ros/subscriber.h>
31 #include <sensor_msgs/Imu.h>
32 #include <tf2_ros/transform_broadcaster.h>
34 #include <boost/optional.hpp>
44 void Initialize(ros::NodeHandle* nh)
final;
46 void SubscribeAndAdvertise(ros::NodeHandle* nh);
48 void ImuCallback(
const sensor_msgs::Imu::ConstPtr& imu_msg);
50 void FlightModeCallback(ff_msgs::FlightMode::ConstPtr
const&
mode);
52 void LocalizationStateCallback(
const ff_msgs::GraphState::ConstPtr& loc_msg);
54 boost::optional<ff_msgs::EkfState> PublishLatestImuAugmentedLocalizationState();
56 void PublishPoseAndTwistAndTransform(
const ff_msgs::EkfState& loc_msg);
60 void PublishHeartbeat();
63 std::string platform_name_;
64 ros::NodeHandle imu_nh_, loc_nh_;
65 ros::CallbackQueue imu_queue_, loc_queue_;
66 ros::Subscriber imu_sub_, flight_mode_sub_, state_sub_;
67 ros::Publisher state_pub_, pose_pub_, twist_pub_, heartbeat_pub_;
68 ff_msgs::Heartbeat heartbeat_;
69 tf2_ros::TransformBroadcaster transform_pub_;
72 boost::optional<ros::Time> last_state_msg_time_;
76 #endif // IMU_AUGMENTOR_IMU_AUGMENTOR_NODELET_H_