23 #include <geometry_msgs/Vector3Stamped.h> 26 namespace std_plugins {
36 sp_nh(
"~setpoint_accel"),
42 PluginBase::initialize(uas_);
71 using mavlink::common::MAV_FRAME;
76 uint16_t ignore_all_except_a_xyz = (3 << 10) | (7 << 3) | (7 << 0);
79 ignore_all_except_a_xyz |= (1 << 9);
85 ignore_all_except_a_xyz,
86 Eigen::Vector3d::Zero(),
87 Eigen::Vector3d::Zero(),
95 Eigen::Vector3d accel_enu;
MAVROS Plugin base class.
std::shared_ptr< MAVConnInterface const > ConstPtr
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
Setpoint acceleration/force plugin.
void set_position_target_local_ned(uint32_t time_boot_ms, uint8_t coordinate_frame, uint16_t type_mask, Eigen::Vector3d p, Eigen::Vector3d v, Eigen::Vector3d af, float yaw, float yaw_rate)
Message specification: https://mavlink.io/en/messages/common.html#SET_POSITION_TARGET_LOCAL_NED.
PluginBase()
Plugin constructor Should not do anything before initialize()
void vectorMsgToEigen(const geometry_msgs::Vector3 &m, Eigen::Vector3d &e)
void initialize(UAS &uas_)
Plugin initializer.
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
Mixin for setpoint plugins.
ros::Subscriber accel_sub
friend class SetPositionTargetLocalNEDMixin
T transform_frame_enu_ned(const T &in)
Transform data expressed in ENU to NED frame.
This mixin adds set_position_target_local_ned()
std::vector< HandlerInfo > Subscriptions
Subscriptions vector.
Subscriptions get_subscriptions()
Return vector of MAVLink message subscriptions (handlers)
SetpointAccelerationPlugin()
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void send_setpoint_acceleration(const ros::Time &stamp, Eigen::Vector3d &accel_enu)
Send acceleration/force to FCU acceleration controller.
void accel_cb(const geometry_msgs::Vector3Stamped::ConstPtr &req)
constexpr std::underlying_type< _T >::type enum_value(_T e)