ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_DDS: Enabling offboard attitude control via ros2

Open Astik-2002 opened this issue 1 year ago • 2 comments

This PR enables off-board attitude control via ros2. A custom message (AngularVelandAccn.msg) is defined, containing orientation (quaternion), angular velocity (vector3f), angular acceleration (vector3f) and thrust (double) commands. Angular acceleration is not used for reference by arducopter's control architecture, but can be used by custom controllers (geometric control for eg).

Astik-2002 avatar Apr 09 '24 10:04 Astik-2002

Hi @Astik-2002, this looks like a good addition, and it's a pre-requisite for your system identification work, so may be worth providing some context in the header comment. The feedback I had for https://github.com/ArduPilot/ardupilot/pull/26339 was that a good autotest suite was required, and the same will apply to this PR. There is some preparatory work needed to generate Dubins paths in Python for the plane PR, but once I have that in place we could work together to fill out the test cases.

For the ROS 2 / DDS interface we are trying to conform to ROS standards where possible. We have used the proposed GlobalPosition message from ROS REP 147 for external position control, but it does not quite cover what you require. One option would be to extend that message to support attitude control as well rather than introduce a new message? There is a community working group for aerial robotics with a stream covering standards and messages we could raise this with them.

I'll need to run this up for a more detailed review, and will add further comments as I work through it.

srmainwaring avatar Apr 12 '24 07:04 srmainwaring

Hi @srmainwaring. Are there any updates on the review regarding attitude message? I considered extending the existing position control message to include attitude commands also, but decided against it for following reasons: a) Attitude commands are generally in body frame, whereas global position control is in inertial frame. b) Since the current AP controller is decoupled between translational and rotational controller, it wouldn't make sense to waste bandwidth sending dummy translation commands while we are overridinig the position controller.

The attitude controller message that I created is based on https://github.com/uzh-rpg/rpg_quadrotor_common/blob/master/quadrotor_msgs/msg/ControlCommand.msg . RPG group from university of zurich uses this framework for uav control and it has been used in multiple packages. So can we consider adding this in the AP ros2 framework?

Astik-2002 avatar Apr 24 '24 04:04 Astik-2002