gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Multicopter Attitude and Position Controller

Open mihirk284 opened this issue 1 year ago • 7 comments

Desired behavior

The current gz-sim implements a system that incorporates a multicopter plugin based on the RotorS Simulator's setup. This plugin is only used to command the velocity of the robot in the vehicle frame. Currently, attitude controllers that are able to command the desired roll, pitch, yaw rate, and thrust are not a part of the simulator. I want to propose addition of a Position controller and Attitude Controller based on the same paper that the current LeeVelocityController is implemented from.

One major reason for this recommendation is that it would be extremely easy for users to implement their own software to use multirotors in simulation directly by providing position commands (in the world frame), thus allowing them to develop software to command robots without having to explicitly write a controller that commands robot velocities.

Alternatives considered

I have considered a rotors_control-like structure that uses ROS nodes that implement the controller externally and provide motor commands to the actuators. However the inbuilt functionality of directly reading the RotorConfiguration and robot mass/inertia properties from the SDF reduces room for errors and thus, implementation of the position and attitude controllers as a simulator plugin appears as a natural solution to the problem.

I am interested in developing this further for our own use and if the Gazebo Team is interested, I would be happy to open a pull-request to this repository for it to be merged with the open-source simulator. The added feature (with basic working functionality, with some room for improvements) can be seen on the following commit to the fork of gz-sim repo: https://github.com/ntnu-arl/gz-sim/tree/dev/multicopter_control.

Implementation suggestion

I am in the process of implementing the controller myself for internal use at our research group, however it would be great if these can be incorporated within the open-source simulator. The current implementation that I am working with has created two different systems that include multicopter_attitude_control and multicopter_position_control systems. These are similar in nature to the current multicopter_system that controls only the velocity in vehicle frame for the robot, however the attitude control system commands the attitude in the vehicle frame, and the position control system is able to command the position in the world frame (thus exploiting available ground truth pose information available in the simulator).

The current implementation (in progress) can be found here: https://github.com/ntnu-arl/gz-sim/tree/dev/multicopter_control, however if this is planned to be incorporated in the simulator, it can be changed as per your recommendations.

Additional Context


mihirk284 avatar Mar 13 '23 16:03 mihirk284