NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
ros_gnc_fam_cmd_state.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 
20 #ifndef DDS_ROS_BRIDGE_ROS_GNC_FAM_CMD_STATE_H_
21 #define DDS_ROS_BRIDGE_ROS_GNC_FAM_CMD_STATE_H_
22 
23 #include <string>
24 
25 #include "dds_ros_bridge/ros_sub_rapid_pub.h"
26 #include "dds_ros_bridge/util.h"
27 
28 #include "ff_msgs/FamCommand.h"
29 
30 #include "knDds/DdsTypedSupplier.h"
31 
32 #include "rapidDds/RapidConstants.h"
33 
34 #include "rapidIo/RapidIoParameters.h"
35 
36 #include "rapidUtil/RapidHelper.h"
37 
38 #include "dds_msgs/AstrobeeConstants.h"
39 #include "dds_msgs/GncFamCmdStateSupport.h"
40 
41 namespace ff {
42 
44  public:
45  RosGncFamCmdStateToRapid(const std::string& subscribe_topic,
46  const std::string& pub_topic,
47  const ros::NodeHandle& nh,
48  const unsigned int queue_size = 10);
49 
50  void CopyVec3D(rapid::Vec3d& vec_out, const geometry_msgs::Vector3& vec_in);
51  void MsgCallback(const ff_msgs::FamCommandConstPtr& msg);
52  void PubGncFamCmdState(const ros::TimerEvent& event);
53  void SetGncPublishRate(float rate);
54 
55  private:
56  ff_msgs::FamCommandConstPtr fam_msg_;
57 
58  using StateSupplier =
59  kn::DdsTypedSupplier<rapid::ext::astrobee::GncFamCmdState>;
60  using StateSupplierPtr = std::unique_ptr<StateSupplier>;
61 
62  StateSupplierPtr state_supplier_;
63 
64  ros::Timer gnc_timer_;
65 };
66 
67 } // end namespace ff
68 
69 #endif // DDS_ROS_BRIDGE_ROS_GNC_FAM_CMD_STATE_H_
ff::RosGncFamCmdStateToRapid::PubGncFamCmdState
void PubGncFamCmdState(const ros::TimerEvent &event)
Definition: ros_gnc_fam_cmd_state.cc:68
ff::RosSubRapidPub
Definition: ros_sub_rapid_pub.h:30
ff::RosGncFamCmdStateToRapid
Definition: ros_gnc_fam_cmd_state.h:43
ff::RosGncFamCmdStateToRapid::SetGncPublishRate
void SetGncPublishRate(float rate)
Definition: ros_gnc_fam_cmd_state.cc:104
ff::RosGncFamCmdStateToRapid::RosGncFamCmdStateToRapid
RosGncFamCmdStateToRapid(const std::string &subscribe_topic, const std::string &pub_topic, const ros::NodeHandle &nh, const unsigned int queue_size=10)
Definition: ros_gnc_fam_cmd_state.cc:24
ff
Definition: generic_rapid_msg_ros_pub.h:36
ff::RosGncFamCmdStateToRapid::CopyVec3D
void CopyVec3D(rapid::Vec3d &vec_out, const geometry_msgs::Vector3 &vec_in)
Definition: ros_gnc_fam_cmd_state.cc:56
ff::RosGncFamCmdStateToRapid::MsgCallback
void MsgCallback(const ff_msgs::FamCommandConstPtr &msg)
Definition: ros_gnc_fam_cmd_state.cc:63