NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
astrobee_astrobee_bridge.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_ASTROBEE_ASTROBEE_BRIDGE_H_
20 #define DDS_ROS_BRIDGE_ASTROBEE_ASTROBEE_BRIDGE_H_
21 
22 #include <pluginlib/class_list_macros.h>
23 
24 #include <map>
25 #include <memory>
26 #include <string>
27 #include <vector>
28 
30 
32 #include "dds_ros_bridge/rapid_sub_ros_pub.h"
33 #include "dds_ros_bridge/ros_sub_rapid_pub.h"
34 
39 
40 #include "ff_msgs/ResponseOnly.h"
41 
42 #include "ff_common/ff_names.h"
43 #include "ff_util/ff_nodelet.h"
44 
45 // SoraCore Includes
46 #include "knDds/DdsSupport.h"
47 #include "knDds/DdsEntitiesFactory.h"
48 #include "knDds/DdsEntitiesFactorySvc.h"
49 
50 // miro includes
51 #include "miro/Configuration.h"
52 #include "miro/Robot.h"
53 #include "miro/Log.h"
54 
55 namespace kn {
56  class DdsEntitiesFactorySvc;
57 } // end namespace kn
58 
59 namespace dds_ros_bridge {
60 
61 class RosSubRapidPub;
62 
64  public:
67 
68  template<typename T, typename ... Args>
69  int BuildRosToRapid(const std::string& name, Args&& ... args); // NOLINT
70 
71  template<typename T, typename ... Args>
72  int BuildRapidToRos(Args&& ... args); // NOLINT
73 
74  protected:
75  virtual void Initialize(ros::NodeHandle *nh);
76  bool ReadParams();
78  std::string &topic_name, bool &enable, float &rate);
79 
80  private:
81  bool Run();
82  bool Start(ff_msgs::ResponseOnly::Request& req,
83  ff_msgs::ResponseOnly::Response& res);
84 
85  config_reader::ConfigReader config_params_;
86 
87  int components_;
88  bool started_;
89  bool run_on_start_;
90 
91  ros::NodeHandle nh_;
92  ros::ServiceServer trigger_srv_;
93 
94  std::map<std::string, ff::RosSubRapidPubPtr> ros_sub_rapid_pubs_;
95  std::shared_ptr<kn::DdsEntitiesFactorySvc> dds_entities_factory_;
96  std::string agent_name_, participant_name_, read_params_error_;
97  std::vector<ff::RapidPubPtr> rapid_pubs_;
98  std::vector<ff::RapidSubRosPubPtr> rapid_sub_ros_pubs_;
99 };
100 
101 } // end namespace dds_ros_bridge
102 
103 #endif // DDS_ROS_BRIDGE_ASTROBEE_ASTROBEE_BRIDGE_H_
dds_ros_bridge::AstrobeeAstrobeeBridge::BuildRosToRapid
int BuildRosToRapid(const std::string &name, Args &&... args)
Definition: astrobee_astrobee_bridge.cc:380
dds_ros_bridge::AstrobeeAstrobeeBridge::AstrobeeAstrobeeBridge
AstrobeeAstrobeeBridge()
Definition: astrobee_astrobee_bridge.cc:22
dds_ros_bridge::AstrobeeAstrobeeBridge::ReadSharedItemConf
bool ReadSharedItemConf(config_reader::ConfigReader::Table &conf, std::string &topic_name, bool &enable, float &rate)
Definition: astrobee_astrobee_bridge.cc:357
ff_nodelet.h
rapid_ekf_ros_ekf.h
ros_guest_science.h
dds_ros_bridge::AstrobeeAstrobeeBridge::~AstrobeeAstrobeeBridge
~AstrobeeAstrobeeBridge()
Definition: astrobee_astrobee_bridge.cc:30
dds_ros_bridge::AstrobeeAstrobeeBridge::ReadParams
bool ReadParams()
Definition: astrobee_astrobee_bridge.cc:206
name
std::string name
Definition: eps_simulator.cc:48
kn
Definition: smart_dock_node.h:55
dds_ros_bridge::AstrobeeAstrobeeBridge::BuildRapidToRos
int BuildRapidToRos(Args &&... args)
Definition: astrobee_astrobee_bridge.cc:389
ff_util::FreeFlyerNodelet
Definition: ff_nodelet.h:57
ff_names.h
rapid_pub.h
config_reader::ConfigReader
Definition: config_reader.h:48
ros_ekf_rapid_ekf.h
config_reader.h
dds_ros_bridge::AstrobeeAstrobeeBridge::Initialize
virtual void Initialize(ros::NodeHandle *nh)
Definition: astrobee_astrobee_bridge.cc:33
rapid_gs_data_ros_gs_data.h
config_reader::ConfigReader::Table
Definition: config_reader.h:54
dds_ros_bridge
Definition: astrobee_astrobee_bridge.h:59
dds_ros_bridge::AstrobeeAstrobeeBridge
Definition: astrobee_astrobee_bridge.h:63