Developing a custom controller

We will discuss how to build a controller for an arbitrary MAV. The message passing is managed by gazebo_controller_interface, and the motor dynamics are handled in gazebo_motor_model. Thus, the task of developing a custom controller can be reduced to subscribing to state estimator messages, reference commands, and publishing actuator messages on the command/motor_speed topic. Alternatively, we can also execute the RollPitchYawrate-ThrustController and develop a custom position controller that publishes MultiDOFJointTrajectory messages. Here, the custom position controller subscribes to MultiDOFJointTrajectory messages as a control input, whereas the roll-pitch-yawrate-thrust controller subscribes to RollPitchYaw-rateThrust messages.

We can split the design of the controller into two parts; the first part handles the the parameters and the message passing, and the second part of the controller is a library, which does all the computations. Moreover, we recommend using the template of controller ROS-nodes, located in the rotors_control/src/nodes folder. It reads the controller parameters from the ROS parameter server as YAML files, which get split up into controller specific parameters and vehicle specific parameters. The vehicle parameter file includes the mass of the MAV, its inertia, and rotor configuration, whereas controller gains are specified in the controller parameters file.

Our custom controller libraries are located in the rotors_control/src/library folder. Another time, we recommend using one of the libraries as a template to develop our custom controller. We have a method, CalculateRotorVelocities, that gets called in every control loop, and computes the required rotor velocities ω, based on the state information of the MAV.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.157.45