21 #ifndef UAV_ABSTRACTION_LAYER_BACKEND_LIGHT_H 22 #define UAV_ABSTRACTION_LAYER_BACKEND_LIGHT_H 27 #include <uav_abstraction_layer/backend.h> 30 #include <geometry_msgs/PoseStamped.h> 31 #include <geometry_msgs/TwistStamped.h> 32 #include <geometry_msgs/TransformStamped.h> 33 #include <tf2_ros/static_transform_broadcaster.h> 35 namespace grvc {
namespace ual {
45 virtual Pose
pose()
override;
47 virtual Velocity
velocity()
const override;
49 virtual Odometry
odometry()
const override;
51 virtual Transform
transform()
const override;
55 void setPose(
const geometry_msgs::PoseStamped& _pose)
override;
67 void takeOff(
double _height)
override;
81 bool referencePoseReached()
const;
83 Velocity calcVel(Pose _target_pose);
85 geometry_msgs::PoseStamped home_pose_;
86 geometry_msgs::PoseStamped ref_pose_;
87 geometry_msgs::PoseStamped cur_pose_;
88 geometry_msgs::PoseStamped cur_pose_noisy_;
89 geometry_msgs::PoseStamped gazebo_pose_;
90 geometry_msgs::TwistStamped ref_vel_;
91 geometry_msgs::TwistStamped cur_vel_;
94 std::string link_name_;
95 ros::Publisher link_state_publisher_;
98 std::default_random_engine generator_;
99 std::normal_distribution<double>* distribution_;
102 bool flying_ =
false;
103 bool control_in_vel_ =
false;
107 float max_pose_error_;
108 float max_orient_error_;
111 std::string pose_frame_id_;
112 std::string uav_home_frame_id_;
113 std::string uav_frame_id_;
114 tf2_ros::StaticTransformBroadcaster * static_tf_broadcaster_;
115 std::map <std::string, geometry_msgs::TransformStamped> cached_transforms_;
116 ros::Time last_command_time_;
118 std::thread offboard_thread_;
123 #endif // UAV_ABSTRACTION_LAYER_BACKEND_LIGHT_H void goToWaypointGeo(const WaypointGeo &_wp) override
void takeOff(double _height) override
virtual Pose pose() override
Latest pose estimation of the robot.
virtual Odometry odometry() const override
Latest odometry estimation of the robot.
void land() override
Land on the current position.
void recoverFromManual() override
Definition: backend_light.h:75
void goToWaypoint(const Waypoint &_wp) override
void setHome(bool set_z) override
Set home position.
Definition: backend_light.h:77
Definition: backend_light.h:37
Common interface for back-end implementations of ual.
Definition: backend.h:46
bool isReady() const override
Backend is initialized and ready to run tasks?
virtual Velocity velocity() const override
Latest velocity estimation of the robot.
void setVelocity(const Velocity &_vel) override
virtual Transform transform() const override
Latest transform estimation of the robot.
void setPose(const geometry_msgs::PoseStamped &_pose) override