NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
generic_rapid_msg_ros_pub.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 COMMS_BRIDGE_GENERIC_RAPID_MSG_ROS_PUB_H_
20 #define COMMS_BRIDGE_GENERIC_RAPID_MSG_ROS_PUB_H_
21 
24 #include <comms_bridge/util.h>
25 
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 #include "dds_msgs/GenericCommsAdvertisementInfoSupport.h"
31 #include "dds_msgs/GenericCommsContentSupport.h"
32 
33 // default time to delay between advertisement and publishing on that topic [sec]
34 #define DEFAULT_ADVERTISE_TO_PUB_DELAY 3.0
35 
36 namespace ff {
37 
39  public:
40  explicit GenericRapidMsgRosPub(double ad2pub_delay = DEFAULT_ADVERTISE_TO_PUB_DELAY);
41  virtual ~GenericRapidMsgRosPub();
42 
43  void InitializeDDS(std::vector<std::string> const& connections, bool enable_advertisement_info_request);
44 
46  rapid::ext::astrobee::GenericCommsAdvertisementInfo const* data);
47  void ConvertContent(rapid::ext::astrobee::GenericCommsContent const* data,
48  std::string const& connecting_robot);
49 
50  void RequestAdvertisementInfo(std::string const& output_topic,
51  std::string const& connecting_robot);
52 
53  private:
54  bool dds_initialized_, enable_advertisement_info_request_;
55 
56  std::map<std::string, RapidPubRequestPtr> robot_connections_;
57 };
58 
59 } // end namespace ff
60 
61 #endif // COMMS_BRIDGE_GENERIC_RAPID_MSG_ROS_PUB_H_
BridgePublisher
Definition: bridge_publisher.h:47
ff::GenericRapidMsgRosPub::ConvertContent
void ConvertContent(rapid::ext::astrobee::GenericCommsContent const *data, std::string const &connecting_robot)
Definition: generic_rapid_msg_ros_pub.cpp:76
ff::GenericRapidMsgRosPub
Definition: generic_rapid_msg_ros_pub.h:38
rapid_pub_request.h
bridge_publisher.h
ff::GenericRapidMsgRosPub::ConvertAdvertisementInfo
void ConvertAdvertisementInfo(rapid::ext::astrobee::GenericCommsAdvertisementInfo const *data)
Definition: generic_rapid_msg_ros_pub.cpp:50
ff
Definition: generic_rapid_msg_ros_pub.h:36
ff::GenericRapidMsgRosPub::~GenericRapidMsgRosPub
virtual ~GenericRapidMsgRosPub()
Definition: generic_rapid_msg_ros_pub.cpp:33
ff::GenericRapidMsgRosPub::RequestAdvertisementInfo
void RequestAdvertisementInfo(std::string const &output_topic, std::string const &connecting_robot)
Definition: generic_rapid_msg_ros_pub.cpp:118
ff::GenericRapidMsgRosPub::GenericRapidMsgRosPub
GenericRapidMsgRosPub(double ad2pub_delay=DEFAULT_ADVERTISE_TO_PUB_DELAY)
Definition: generic_rapid_msg_ros_pub.cpp:27
util.h
ff::GenericRapidMsgRosPub::InitializeDDS
void InitializeDDS(std::vector< std::string > const &connections, bool enable_advertisement_info_request)
Definition: generic_rapid_msg_ros_pub.cpp:35
DEFAULT_ADVERTISE_TO_PUB_DELAY
#define DEFAULT_ADVERTISE_TO_PUB_DELAY
Definition: generic_rapid_msg_ros_pub.h:34