NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
ground_truth_localizer_nodelet.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 #ifndef GROUND_TRUTH_LOCALIZER_GROUND_TRUTH_LOCALIZER_NODELET_H_
19 #define GROUND_TRUTH_LOCALIZER_GROUND_TRUTH_LOCALIZER_NODELET_H_
20 
21 #include <ff_msgs/Heartbeat.h>
22 #include <ff_msgs/SetEkfInput.h>
23 #include <ff_util/ff_nodelet.h>
26 
27 #include <geometry_msgs/PoseStamped.h>
28 #include <geometry_msgs/TwistStamped.h>
29 #include <ros/node_handle.h>
30 #include <ros/publisher.h>
31 #include <ros/subscriber.h>
32 #include <std_srvs/Empty.h>
33 #include <tf2_ros/transform_broadcaster.h>
34 
35 #include <boost/optional.hpp>
36 
37 #include <Eigen/Core>
38 #include <Eigen/Geometry>
39 
40 #include <string>
41 
44  public:
46 
47  private:
48  void Initialize(ros::NodeHandle* nh);
49 
50  void SubscribeAndAdvertise(ros::NodeHandle* nh);
51 
52  bool SetMode(ff_msgs::SetEkfInput::Request& req, ff_msgs::SetEkfInput::Response& res);
53 
54  bool DefaultServiceResponse(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res);
55 
56  void PoseCallback(geometry_msgs::PoseStamped::ConstPtr const& pose);
57 
58  void TwistCallback(geometry_msgs::TwistStamped::ConstPtr const& twist);
59 
60  void PublishLocState(const localization_common::Time& timestamp);
61 
62  std::string platform_name_;
63  ros::Time last_time_;
64  boost::optional<Eigen::Isometry3d> pose_;
65  boost::optional<Twist> twist_;
66  int input_mode_ = ff_msgs::SetEkfInputRequest::MODE_TRUTH;
67  ros::Subscriber pose_sub_, twist_sub_;
68  ros::Publisher state_pub_, pose_pub_, twist_pub_, heartbeat_pub_, reset_pub_;
69  ff_msgs::Heartbeat heartbeat_;
70  tf2_ros::TransformBroadcaster transform_pub_;
71  ros::ServiceServer input_mode_srv_, bias_srv_, bias_from_file_srv_, reset_srv_;
72 };
73 } // namespace ground_truth_localizer
74 
75 #endif // GROUND_TRUTH_LOCALIZER_GROUND_TRUTH_LOCALIZER_NODELET_H_
ground_truth_localizer::GroundTruthLocalizerNodelet
Definition: ground_truth_localizer_nodelet.h:43
ff_nodelet.h
ground_truth_localizer::GroundTruthLocalizerNodelet::GroundTruthLocalizerNodelet
GroundTruthLocalizerNodelet()
Definition: ground_truth_localizer_nodelet.cc:31
time.h
ff_util::FreeFlyerNodelet
Definition: ff_nodelet.h:57
twist.h
ground_truth_localizer
Definition: ground_truth_localizer_nodelet.h:42
localization_common::Time
double Time
Definition: time.h:23