17 #ifndef ROTORS_HIL_INTERFACE_H_ 18 #define ROTORS_HIL_INTERFACE_H_ 20 #include <mav_msgs/Actuators.h> 22 #include <mavros_msgs/HilControls.h> 27 #include <mavlink/v2.0/common/mavlink.h> 44 return (static_cast<uint64_t>(rostime.
nsec * 1
e-3) +
45 static_cast<uint64_t>(rostime.
sec * 1e6));
50 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 std::vector<mavros_msgs::Mavlink>
virtual CollectData() = 0;
139 #endif // ROTORS_HIL_INTERFACE_H_ uint64_t gps_interval_nsec_
Interval between outgoing HIL_GPS messages.
boost::mutex mtx_
Mutex lock for thread safety of reading hil data.
ros::Subscriber mag_sub_
ROS magnetometer subscriber.
ros::Subscriber pressure_sub_
ROS air pressure subscriber.
ros::Subscriber ground_speed_sub_
ROS ground speed subscriber.
Eigen::Matrix3f R_S_B_
Rotation, in matrix form, from body into sensor (NED) frame.
mavlink_hil_gps_t hil_gps_msg_
MAVLINK HIL_GPS message.
HilData hil_data_
Object for storing the latest data.
ros::Subscriber imu_sub_
ROS IMU subscriber.
uint64_t last_gps_pub_time_nsec_
Nanosecond portion of the last HIL_GPS message timestamp.
ros::NodeHandle nh_
ROS node handle.
mavlink_hil_state_quaternion_t hil_state_qtrn_msg_
MAVLINK HIL_STATE_QUATERNION message.
mavlink_hil_sensor_t hil_sensor_msg_
MAVLINK HIL_SENSOR message.
static const std::string kDefaultPressureSubTopic
virtual EIGEN_MAKE_ALIGNED_OPERATOR_NEW ~HilInterface()
Destructor.
Eigen::Quaterniond q_S_B_
Rotation, in quaternion form, from body into sensor (NED) frame.
virtual std::vector< mavros_msgs::Mavlink > CollectData()=0
Gather data collected from ROS messages into MAVLINK messages.
u_int64_t RosTimeToMicroseconds(const ros::Time &rostime)
Convert ros::Time into single value in microseconds.
ros::Subscriber air_speed_sub_
ROS air speed subscriber.
HilListeners hil_listeners_
Object with callbacks for receiving data.
static constexpr double kDefaultGpsFrequency
static constexpr int kAllFieldsUpdated
mavlink::mavlink_message_t mavlink_message_t
ros::Subscriber gps_sub_
ROS GPS subscriber.
std::recursive_mutex mutex