18 #ifndef ROS_GRAPH_LOCALIZER_ROS_GRAPH_LOCALIZER_NODELET_H_
19 #define ROS_GRAPH_LOCALIZER_ROS_GRAPH_LOCALIZER_NODELET_H_
22 #include <ff_msgs/GraphVIOState.h>
23 #include <ff_msgs/VisualLandmarks.h>
24 #include <ff_msgs/Heartbeat.h>
25 #include <ff_msgs/ResetMap.h>
26 #include <ff_msgs/SetEkfInput.h>
34 #include <image_transport/image_transport.h>
35 #include <ros/node_handle.h>
36 #include <ros/publisher.h>
37 #include <ros/subscriber.h>
38 #include <sensor_msgs/PointCloud2.h>
39 #include <std_srvs/Empty.h>
40 #include <tf2_ros/transform_broadcaster.h>
52 void Initialize(ros::NodeHandle* nh)
final;
55 void SubscribeAndAdvertise(ros::NodeHandle* nh);
58 bool SetMode(ff_msgs::SetEkfInput::Request& req, ff_msgs::SetEkfInput::Response& res);
62 void DisableLocalizerAndVIO();
65 void EnableLocalizerAndVIO();
68 bool localizer_and_vio_enabled()
const;
71 bool ResetBiasesAndLocalizer(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res);
74 bool ResetBiasesFromFileAndResetLocalizer(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res);
77 bool ResetBiasesFromFileAndResetLocalizer();
80 void ResetAndEnableLocalizer();
84 bool ResetMap(ff_msgs::ResetMap::Request& req, ff_msgs::ResetMap::Response& res);
87 void PublishGraphLocalizerState();
90 void PublishReset()
const;
93 void PublishGraphLocalizerMessages();
96 void PublishHeartbeat();
99 void PublishWorldTBodyTF();
102 void PublishWorldTDockTF();
105 void ARVisualLandmarksCallback(
const ff_msgs::VisualLandmarks::ConstPtr& visual_landmarks_msg);
108 void SparseMapVisualLandmarksCallback(
const ff_msgs::VisualLandmarks::ConstPtr& visual_landmarks_msg);
111 void FeaturePointsCallback(
const ff_msgs::Feature2dArray::ConstPtr& feature_array_msg);
114 void DepthOdometryCallback(
const ff_msgs::DepthOdometry::ConstPtr& depth_odom_msg);
117 void DepthPointCloudCallback(
const sensor_msgs::PointCloud2ConstPtr& point_cloud_msg);
120 void DepthImageCallback(
const sensor_msgs::ImageConstPtr& image_msg);
123 void ImuCallback(
const sensor_msgs::Imu::ConstPtr& imu_msg);
126 void FlightModeCallback(ff_msgs::FlightMode::ConstPtr
const&
mode);
136 ros::NodeHandle private_nh_;
137 ros::CallbackQueue private_queue_;
138 bool localizer_and_vio_enabled_ =
true;
139 ros::Subscriber sparse_map_vl_sub_, ar_tag_vl_sub_;
140 ros::Publisher graph_loc_pub_, reset_pub_, heartbeat_pub_;
141 tf2_ros::TransformBroadcaster transform_pub_;
142 ros::ServiceServer bias_srv_, bias_from_file_srv_, reset_map_srv_, reset_srv_, input_mode_srv_;
143 std::string platform_name_;
144 ff_msgs::Heartbeat heartbeat_;
153 ros::Publisher graph_vio_state_pub_, graph_vio_pub_, depth_odom_pub_;
154 ros::Subscriber imu_sub_, depth_point_cloud_sub_, depth_odom_sub_, fp_sub_, flight_mode_sub_;
155 image_transport::Subscriber depth_image_sub_;
159 #endif // ROS_GRAPH_LOCALIZER_ROS_GRAPH_LOCALIZER_NODELET_H_