21 #ifndef UAV_ABSTRACTION_LAYER_BACKEND_DUMMY_H 22 #define UAV_ABSTRACTION_LAYER_BACKEND_DUMMY_H 24 #include <uav_abstraction_layer/backend.h> 28 namespace grvc {
namespace ual {
34 ROS_WARN(
"BackendDummy is only for testing porposes");
38 bool isReady()
const override {
return true; }
40 virtual Pose
pose()
override {
return Pose(); }
42 virtual Velocity
velocity()
const override {
return Velocity(); }
44 virtual Odometry
odometry()
const override {
return Odometry(); }
48 out.header.stamp = ros::Time::now();
49 out.header.frame_id =
"uav_1_home";
50 out.child_frame_id =
"uav_1";
51 out.transform.translation.x = 0;
52 out.transform.translation.y = 0;
53 out.transform.translation.z = 0;
54 out.transform.rotation.x = 0;
55 out.transform.rotation.y = 0;
56 out.transform.rotation.z = 0;
57 out.transform.rotation.w = 1;
63 void setPose(
const geometry_msgs::PoseStamped& _pose)
override {
64 ROS_INFO(
"BackendDummy::setPose: p.x = %f, p.y = %f, p.z = %f, q.x = %f, q.y = %f, q.z = %f, q.w = %f", _pose.pose.position.x, _pose.pose.position.y, _pose.pose.position.z,
65 _pose.pose.orientation.x, _pose.pose.orientation.y, _pose.pose.orientation.z, _pose.pose.orientation.w);
71 double yaw = 2 * atan2(_wp.pose.orientation.z, _wp.pose.orientation.w);
72 ROS_INFO(
"BackendDummy::goToWaypoint: x = %f, y = %f, z = %f, yaw = %f", _wp.pose.position.x, _wp.pose.position.y, _wp.pose.position.z, yaw);
78 ROS_INFO(
"BackendDummy::goToWaypointGeo: latitude = %f, longitude = %f, altitude = %f", _wp.latitude, _wp.longitude, _wp.altitude);
86 ROS_INFO(
"BackendDummy::takeOff: height = %f", _height);
90 ROS_INFO(
"BackendDummy::land");
95 ROS_INFO(
"BackendDummy::setVelocity: vx = %f, vy = %f, vz = %f, wz = %f", _vel.twist.linear.x, _vel.twist.linear.y, _vel.twist.linear.z, _vel.twist.angular.z);
100 ROS_INFO(
"BackendDummy::recoverFromManual");
104 ROS_INFO(
"BackendDummy::setHome: set_z = %s", set_z ?
"true" :
"false");
110 #endif // UAV_ABSTRACTION_LAYER_BACKEND_DUMMY_H void setPose(const geometry_msgs::PoseStamped &_pose) override
Definition: backend_dummy.h:63
void setVelocity(const Velocity &_vel) override
Definition: backend_dummy.h:94
virtual Odometry odometry() const override
Latest odometry estimation of the robot.
Definition: backend_dummy.h:44
void land() override
Land on the current position.
Definition: backend_dummy.h:89
void takeOff(double _height) override
Follow a list of waypoints, one after another.
Definition: backend_dummy.h:85
virtual Transform transform() const override
Latest transform estimation of the robot.
Definition: backend_dummy.h:46
void recoverFromManual() override
Definition: backend_dummy.h:99
Common interface for back-end implementations of ual.
Definition: backend.h:46
void setHome(bool set_z) override
Set home position.
Definition: backend_dummy.h:103
void goToWaypointGeo(const WaypointGeo &_wp) override
Definition: backend_dummy.h:77
Definition: backend_dummy.h:30
void goToWaypoint(const Waypoint &_wp) override
Definition: backend_dummy.h:70
bool isReady() const override
Backend is initialized and ready to run tasks?
Definition: backend_dummy.h:38
virtual Velocity velocity() const override
Latest velocity estimation of the robot.
Definition: backend_dummy.h:42
Backend()
Constructor inits node.
virtual Pose pose() override
Latest pose estimation of the robot.
Definition: backend_dummy.h:40