Skip to content

UAL interfaces

franreal edited this page Jan 23, 2019 · 7 revisions

There are two ways of interfacing with UAL: via ROS services/topics and directly via C++ object.

C++ class interface

The UAL class is defined in ual.h. You can directly create one UAL object in your app and access its public methods.

  • pose() -> Get the latest pose estimation of the robot
  • velocity() -> Get the latest velocity estimation of the robot
  • odometry() -> Get the latest odometry estimation of the robot
  • transform() -> Get the latest transform estimation of the robot
  • takeOff(double _height, bool _blocking = true) -> Perform a take off maneuver
  • land(bool _blocking = true) -> Land on the current position
  • setPose(const PoseStamped& _pose) -> Set the specified pose as a reference to position control
  • goToWaypoint(const Waypoint& _wp, bool _blocking = true) -> Go to the specified waypoint smoothly, following a straight line
  • setVelocity(const Velocity& _vel) -> Set velocities
  • setHome(bool set_z = false) -> Set current pose as home. Set x, y and optionally z to zero.
  • recoverFromManual() -> Recover from manual flight mode
  • state() -> Get current system state: UNINITIALIZED, LANDED_DISARMED, LANDED_ARMED, TAKING_OFF, FLYING_AUTO, FLYING_MANUAL, LANDING.

ROS interface

The UAL class offers a ROS interface based on topics and services. It can be disabled if the param ual_server is set to off.

Topics

Each topic publishes periodically (at parameter ~pub_rate, that defaults to 30Hz) the information got from the corresponding methods.

  • ual/pose
  • ual/velocity
  • /tf

Services

Each service provides access to each corresponding method.

  • ual/take_off
  • ual/land
  • ual/go_to_waypoint
  • ual/set_velocity
  • ual/set_home
  • ual/recover_from_manual
Clone this wiki locally