NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
ros_gnc_control_state.h
Go to the documentation of this file.
1 // Copyright 2017 Intelligent Robotics Geoup, NASA ARC
2 
3 #ifndef DDS_ROS_BRIDGE_ROS_GNC_CONTROL_STATE_H_
4 #define DDS_ROS_BRIDGE_ROS_GNC_CONTROL_STATE_H_
5 
6 #include <string>
7 
8 #include "dds_ros_bridge/ros_sub_rapid_pub.h"
9 #include "dds_ros_bridge/util.h"
10 
11 #include "ff_msgs/ControlState.h"
12 
13 #include "knDds/DdsTypedSupplier.h"
14 
15 #include "rapidDds/RapidConstants.h"
16 
17 #include "rapidIo/RapidIoParameters.h"
18 
19 #include "rapidUtil/RapidHelper.h"
20 
21 #include "dds_msgs/AstrobeeConstants.h"
22 #include "dds_msgs/GncControlStateSupport.h"
23 
24 namespace ff {
25 
27  public:
28  RosGncControlStateToRapid(const std::string& subscribe_topic,
29  const std::string& pub_topic,
30  const ros::NodeHandle& nh,
31  const unsigned int queue_size = 10);
32 
33  void CopyVec3D(rapid::Vec3d& vec_out, const geometry_msgs::Vector3& vec_in);
34  void MsgCallback(const ff_msgs::ControlStateConstPtr& msg);
35  void PubGncControlState(const ros::TimerEvent& event);
36  void SetGncPublishRate(float rate);
37 
38  private:
39  ff_msgs::ControlStateConstPtr gnc_msg_;
40 
41  using StateSupplier =
42  kn::DdsTypedSupplier<rapid::ext::astrobee::GncControlState>;
43  using StateSupplierPtr = std::unique_ptr<StateSupplier>;
44 
45  StateSupplierPtr state_supplier_;
46 
47  ros::Timer gnc_timer_;
48 };
49 
50 } // end namespace ff
51 
52 #endif // DDS_ROS_BRIDGE_ROS_GNC_CONTROL_STATE_H_
ff::RosGncControlStateToRapid::CopyVec3D
void CopyVec3D(rapid::Vec3d &vec_out, const geometry_msgs::Vector3 &vec_in)
Definition: ros_gnc_control_state.cc:56
ff::RosGncControlStateToRapid::PubGncControlState
void PubGncControlState(const ros::TimerEvent &event)
Definition: ros_gnc_control_state.cc:68
ff::RosGncControlStateToRapid::SetGncPublishRate
void SetGncPublishRate(float rate)
Definition: ros_gnc_control_state.cc:100
ff::RosSubRapidPub
Definition: ros_sub_rapid_pub.h:30
ff
Definition: generic_rapid_msg_ros_pub.h:36
ff::RosGncControlStateToRapid::MsgCallback
void MsgCallback(const ff_msgs::ControlStateConstPtr &msg)
Definition: ros_gnc_control_state.cc:63
ff::RosGncControlStateToRapid
Definition: ros_gnc_control_state.h:26
ff::RosGncControlStateToRapid::RosGncControlStateToRapid
RosGncControlStateToRapid(const std::string &subscribe_topic, const std::string &pub_topic, const ros::NodeHandle &nh, const unsigned int queue_size=10)
Definition: ros_gnc_control_state.cc:24