NASA Astrobee Robot Software  Astrobee Version:
Flight software for the Astrobee robots operating inside the International Space Station.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.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_UTIL_H_
20 #define COMMS_BRIDGE_UTIL_H_
21 
22 #include <ros/time.h>
23 
24 #include <rapidDds/Header.h>
25 #include <rapidDds/HeaderSupport.h>
26 
27 #include <rapidUtil/RapidHelper.h>
28 
29 #include <std_msgs/Header.h>
30 
31 #include <stdint.h>
32 
33 #include <string>
34 
35 namespace comms_util {
36 
37  // Time-related helpers
38  ::ros::Time RapidTime2RosTime(const int64_t dds_time);
39 
40  int64_t RosTime2RapidTime(::ros::Time const& ros_time);
41 
42  // Header-related helpers
43  void RosHeader2Rapid(::std_msgs::Header const& ros_hdr,
44  ::rapid::Header* rapid_hdr,
45  int status = 0,
46  int serial = -1);
47 
48  void RapidHeader2Ros(::rapid::Header const& rapid_hdr,
49  ::std_msgs::Header* ros_hdr,
50  std::string const& frame_id = "world");
51 
52 } // end namespace comms_util
53 
54 #endif // COMMS_BRIDGE_UTIL_H_
comms_util::RapidHeader2Ros
void RapidHeader2Ros(::rapid::Header const &rapid_hdr, ::std_msgs::Header *ros_hdr, std::string const &frame_id="world")
comms_util
Definition: util.h:35
comms_util::RosTime2RapidTime
int64_t RosTime2RapidTime(::ros::Time const &ros_time)
comms_util::RosHeader2Rapid
void RosHeader2Rapid(::std_msgs::Header const &ros_hdr, ::rapid::Header *rapid_hdr, int status=0, int serial=-1)
comms_util::RapidTime2RosTime
::ros::Time RapidTime2RosTime(const int64_t dds_time)
Definition: util.cpp:23
localization_common::Time
double Time
Definition: time.h:23