NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
ros_data_to_disk.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 
19 #ifndef DDS_ROS_BRIDGE_ROS_DATA_TO_DISK_H_
20 #define DDS_ROS_BRIDGE_ROS_DATA_TO_DISK_H_
21 
22 #include <string>
23 #include <memory>
24 
25 #include "dds_ros_bridge/ros_sub_rapid_pub.h"
26 #include "dds_ros_bridge/util.h"
27 
28 #include "ff_msgs/DataToDiskState.h"
29 #include "ff_msgs/DataTopicsList.h"
30 #include "ff_msgs/SaveSettings.h"
31 
32 #include "knDds/DdsTypedSupplier.h"
33 
34 #include "rapidUtil/RapidHelper.h"
35 
36 #include "dds_msgs/AstrobeeConstants.h"
37 #include "dds_msgs/DataToDiskStateSupport.h"
38 #include "dds_msgs/DataTopicsListSupport.h"
39 
40 namespace ff {
41 
43  public:
44  RosDataToDiskToRapid(const std::string& state_subscribe_topic,
45  const std::string& topics_subscribe_topic,
46  const std::string& pub_topic,
47  const ros::NodeHandle& nh,
48  const unsigned int queue_size = 10);
49 
50  void StateCallback(ff_msgs::DataToDiskStateConstPtr const& state);
51  void TopicsCallback(ff_msgs::DataTopicsListConstPtr const& topics);
52 
53  private:
54  using StateSupplier =
55  kn::DdsTypedSupplier<rapid::ext::astrobee::DataToDiskState>;
56  using StateSupplierPtr = std::unique_ptr<StateSupplier>;
57 
58  StateSupplierPtr state_supplier_;
59 
60  using TopicsSupplier =
61  kn::DdsTypedSupplier<rapid::ext::astrobee::DataTopicsList>;
62  using TopicsSupplierPtr = std::unique_ptr<TopicsSupplier>;
63 
64  TopicsSupplierPtr topics_supplier_;
65 
66  ros::Subscriber topics_sub_;
67 
68  std::string state_subscribe_topic_, topics_subscribe_topic_;
69 };
70 
71 } // end namespace ff
72 
73 #endif // DDS_ROS_BRIDGE_ROS_DATA_TO_DISK_H_
ff::RosSubRapidPub
Definition: ros_sub_rapid_pub.h:30
ff::RosDataToDiskToRapid::RosDataToDiskToRapid
RosDataToDiskToRapid(const std::string &state_subscribe_topic, const std::string &topics_subscribe_topic, const std::string &pub_topic, const ros::NodeHandle &nh, const unsigned int queue_size=10)
Definition: ros_data_to_disk.cc:41
ff
Definition: generic_rapid_msg_ros_pub.h:36
ff::RosDataToDiskToRapid::StateCallback
void StateCallback(ff_msgs::DataToDiskStateConstPtr const &state)
Definition: ros_data_to_disk.cc:76
state
uint8_t state
Definition: signal_lights.h:90
ff::RosDataToDiskToRapid
Definition: ros_data_to_disk.h:42
ff::RosDataToDiskToRapid::TopicsCallback
void TopicsCallback(ff_msgs::DataTopicsListConstPtr const &topics)
Definition: ros_data_to_disk.cc:123